cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H573I-Dk not jumping to application from Bootloader - reg

naveen_kumar
Associate II

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

1 REPLY 1
Saket_Om
ST Employee

Hello @naveen_kumar 

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

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om