Skip to main content
Visitor II
August 20, 2025
Question

STM32H573I-Dk not jumping to application from Bootloader - reg

  • August 20, 2025
  • 3 replies
  • 599 views

Hello Team,

I'm using STM32H573I-DK for our application. I'm using MCUBoot application on Zephyr project directory to setup a secure boot and firmware update on this DK.

I created a RSA key ( cd zephyrproject\\bootloader\\mcuboot, python ./scripts/imgtool.py keygen -k mykey.pem -t rsa-2048 ). I'm using this key in prj.conf of both the bootloader and application.

In Application part I modified device tree to add partition to the flash memory. I'll share conf file, editted DTS below.

   chosen {
        zephyr,console = &usart1;
        zephyr,shell-uart = &usart1;
        zephyr,sram = &sram1;
        zephyr,flash = &flash0;
        zephyr,code-partition = &slot0_area;
        zephyr,canbus = &fdcan1;
        zephyr,display = &st7789v;
    };
&flash0 {
    partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;

        boot_partition: partition@0 {
            label = "mcuboot";
            reg = <0x00000000 DT_SIZE_K(64)>;  // 64 KB
        };

        slot0_area: partition@10000 {
            label = "img-0";
            reg = <0x00010000 DT_SIZE_K(448)>;  // Primary slot
        };

        slot1_area: partition@80000 {
            label = "img-1";
            reg = <0x00080000 DT_SIZE_K(448)>;  // Secondary slot
        };

        scratch_area: partition@f0000 {
            label = "img-scratch";
            reg = <0x000f0000 DT_SIZE_K(64)>;  // Scratch area
        };
    };
};


After building BL, I flashed it to DK @0x08000000. I flashed application @0x08010000 (Size : 10000). (via STM32CubeProgrammer)

After these steps I issued a Development board reset, If my understanding is correct the BL will jump to address Application address 0x8010000, which isn't happening, instead I'm getting the following error messages

*** Using Zephyr OS build v4.2.0-802-g00e217da7d84 ***
I: Starting bootloader
W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
E: Image in the primary slot is not valid!
E: Unable to find bootable image

Also I took a dumpinfo of the signed firmware binary file using this command (imgtool dumpinfo C:/Users/Naveen/Documents/Project/build/zephyr/zephyr.signed.bin)

naveen_kumar_0-1755681715583.png

 

In Image header I observed that the field protected_tlv_size  = 0, does this means the firmware isn't signed properly?

What could be the root cause of the issue, why BL doesn't jump to application? I'm new to zephyr. It would be great if some one help me out here


#Zephyr

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    August 20, 2025

    Hello @naveen_kumar 

    According to the log the BOOT_MAX_IMG_SECTORS is too small for your image.

    Visitor II
    August 21, 2025

    Hello Saket, 

    I increased BOOT_MAX_IMG_SECTORS to 512, I'm still getting the same error.

    *** Booting MCUboot v2.1.0-rc1-184-ga2bc982b3379 ***
    *** Using Zephyr OS build v4.2.0-802-g00e217da7d84 ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=512 - too small?
    E: Image in the primary slot is not valid!
    E: Unable to find bootable image

    Best regards,
    Naveen

    ST Employee
    August 21, 2025

    Hello @naveen_kumar,

    This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

    Best regards,
    Maxime