<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — App compiled with debug flags is rejected due to hash]]></title>
		<link>https://www.wolfssl.com/forums/topic2335-app-compiled-with-debug-flags-is-rejected-due-to-hash.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2335.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in App compiled with debug flags is rejected due to hash.]]></description>
		<lastBuildDate>Tue, 08 Jul 2025 10:34:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: App compiled with debug flags is rejected due to hash]]></title>
			<link>https://www.wolfssl.com/forums/post8421.html#p8421</link>
			<description><![CDATA[<p>Hello kind folks at wolfSSL Support,</p><p>I had missed that this was the official support channels. I first wanted to see if I could remedy it myself, but I might need your help yes.</p><p>First I wanted to know if there were some things I might have missed when compiling with debug flags? Right now I am intrigued to find that the example in debug mode AND the application in release mode are verified fine but not the application in debug mode. </p><p>This is for a commercial effort.</p><p>Specifically, we are using STMH753ZIT6</p>]]></description>
			<author><![CDATA[null@example.com (alexloss)]]></author>
			<pubDate>Tue, 08 Jul 2025 10:34:43 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8421.html#p8421</guid>
		</item>
		<item>
			<title><![CDATA[Re: App compiled with debug flags is rejected due to hash]]></title>
			<link>https://www.wolfssl.com/forums/post8420.html#p8420</link>
			<description><![CDATA[<p>Hello Alex,</p><p>What model of STM32H7 are you running on?</p><p>Kind Regards,</p><p>Daniele - wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (danielinux)]]></author>
			<pubDate>Mon, 07 Jul 2025 17:55:48 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8420.html#p8420</guid>
		</item>
		<item>
			<title><![CDATA[Re: App compiled with debug flags is rejected due to hash]]></title>
			<link>https://www.wolfssl.com/forums/post8419.html#p8419</link>
			<description><![CDATA[<p>Hello Alex,</p><p>Thanks for contacting wolfSSL Support. Can you tell us a bit about your project using wolfBoot? Is this a personal or commercial effort?</p><p>I am requesting a review of this topic by our engineers.</p><p>Kind regards,<br />Eric - wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Mon, 07 Jul 2025 17:32:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8419.html#p8419</guid>
		</item>
		<item>
			<title><![CDATA[App compiled with debug flags is rejected due to hash]]></title>
			<link>https://www.wolfssl.com/forums/post8414.html#p8414</link>
			<description><![CDATA[<p>I have successfully booted<br />- my custom application when it is compiled with speed optimisation -O3 (although it will crash later down the line, need to access to debugger to figure out why)<br />- the test-app wolfBoot/hal/stm32h7.c <strong>with</strong> the debug flags</p><p>Hash generated from tools/keytools/sign differs from the sha256 calculated from the bootloader when I compile my application with -g -g3 or -Ofast -g</p><p>To be precise, it fails in the integrity check (verified using wolfboot config DEBUG=1)</p><div class="codebox"><pre><code>int wolfBoot_start(void)
{
    struct wolfBoot_image os_image;
    int ret = 0;
    memset(&amp;os_image, 0, sizeof(os_image));

    os_image.hdr = (uint8_t*)gImage;

    if ((ret = wolfBoot_open_image_address(&amp;os_image, (uint8_t*)gImage)) &lt; 0) {
        goto exit;
    }

    if ((ret = wolfBoot_verify_integrity(&amp;os_image)) &lt; 0) {
        goto exit; // &lt;= Application images compiled with debug flags fail this check
    }

    if ((ret = wolfBoot_verify_authenticity(&amp;os_image)) &lt; 0) {
        goto exit;
    }

    wolfBoot_printf(&quot;Firmware Valid\n&quot;);

    do_boot((uint32_t*)os_image.fw_base);
    /* ... */
}</code></pre></div><p>Are there any tips as to what I should look to integrate my app with the bootloader? I have exhausted all online docs I could find.</p><p>The app was created long before we needed a bootloader, so there had been no considerations taken. It is an STM32h7 project mostly bootstrapped with CubeMX.</p><p>WolfBoot version v2.5.0</p><p>My project file tree<br /></p><div class="codebox"><pre><code>/build.sh
/CMakeLists.txt
/bootloader/wolfBoot/
link_with_bootloader.ld
link_no_bootloader.ld
/* ... Application source files ... */</code></pre></div><p>I have zip&#039;ped relevant build files as an attachment</p><div class="codebox"><pre><code>ARCH?=ARM
TARGET?=stm32h7
SIGN?=ECC256
HASH?=SHA256
DEBUG?=1
DEBUG_UART?=0
VTOR?=1
NO_ASM?=0
EXT_FLASH?=0
SPI_FLASH?=0
QSPI_FLASH?=0
OCTOSPI_FLASH?=0
ALLOW_DOWNGRADE?=0
NVM_FLASH_WRITEONCE?=0
WOLFBOOT_VERSION?=1
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
WOLFBOOT_PARTITION_SIZE?=0xC0000
WOLFBOOT_SECTOR_SIZE?=0x20000
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x8020000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x80E0000
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x81A0000
CFLAGS_EXTRA?=-mfloat-abi=hard -mfpu=fpv4-sp-d16
PULL_LINKER_DEFINES?=1</code></pre></div><p><strong>Notes</strong></p><p>- I always bin-assemble the bootloader.bin and the application_v1_signed.bin into a factory.bin before flashing it to the target<br />- I changed the WOLFBOOT_PARTITION_SIZE from 0xD0000 to 0xC0000, because 0xD0000 is NOT a multiple of WOLFBOOT_SECTOR_SIZE=0x20000<br />- I made an early return in the clock setup for the bootloader. My board is custom and the configuration failed when setting up the external high-speed oscillator (HSE) </p><div class="codebox"><pre><code>/* This implementation will setup HSI RC 64 MHz as System Clock Source */
static void clock_pll_on(int powersave)
{
    /* ... */
    pllm = 1;
    plln = 120;
    pllp = 2;
    pllq = 20;
    pllr = 2;
    d1cpre =   RCC_PRESCALER_DIV_NONE;
    hpre  =    RCC_PRESCALER_DIV_2;
    d1ppre =  (RCC_PRESCALER_DIV_2 &gt;&gt; 1);
    d2ppre1 = (RCC_PRESCALER_DIV_2 &gt;&gt; 1);
    d2ppre2 = (RCC_PRESCALER_DIV_2 &gt;&gt; 1);
    d3ppre =  (RCC_PRESCALER_DIV_2 &gt;&gt; 1);
    flash_waitstates = 4;

    flash_set_waitstates(flash_waitstates);

    /* Enable internal high-speed oscillator. */
    RCC_CR |= RCC_CR_HSION;
    DMB();
    while ((RCC_CR &amp; RCC_CR_HSIRDY) == 0) {};

    /* Select HSI as SYSCLK source. */
    reg32 = RCC_CFGR;
    reg32 &amp;= ~((1 &lt;&lt; 2) |(1 &lt;&lt; 1) | (1 &lt;&lt; 0));
    RCC_CFGR = (reg32 | RCC_CFGR_SW_HSISYS);
    DMB();
    return; // &lt;= Early return
    /* Enable external high-speed oscillator. */
    reg32 = RCC_CR;
    reg32 |= RCC_CR_HSEBYP;
    /* ... */
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (alexloss)]]></author>
			<pubDate>Fri, 04 Jul 2025 09:55:47 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8414.html#p8414</guid>
		</item>
	</channel>
</rss>
