Unable to find bootable image with mcuboot_opensource RT1064 SDK example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to find bootable image with mcuboot_opensource RT1064 SDK example

1,666 Views
JasonT
Contributor I

I'm trying to verify that the mcuboot_opsource application will start and application and then swap to a secondary application. I'm using a MIMXRT1064EVK.  This is my first MCUXpresso project so there may be something basic I'm missing. I'm using IDE 11.8.1 and I've downloaded the SDK examples: mcuboot_opensource under ota_examples and ied_blinky and hello_world_virtual_com under demo_apps. Both demo apps work fine when I use them with their default memory address 0x70000000 size:0x400000. I then downloaded new instances of each of these examples and set the flash location to start:0x70040000 size:0x180000 and start:0x701c0000 size 0x180000 respectively. I then used MCUXpresso Secure Provisioning Tool to write the two demo programs to Flash. The tool read the start location successfully from the axf file and generated a bin file. I then set the board to Serial mode (DIPSW07 to 0x01) and used the FlexSPI Nor - simplified memory configuration to write the binary files to Flash. I did this sequentially so I'm assuming that the tool does not erase the entire flash. I then switched the board to Internal memory boot mode (DIPSW07 to 0x10)

After the above steps I used the Debug tools in MCUXpresso with the mcuboot_opensource address:0x70000000: size:0x40000 I get the following:


hello sbl.
Disabling flash remapping function

Image 0 Primary slot: Image not found
Image 0 Secondary slot: Image not found
No slot to load for image 0
Unable to find bootable image

The flash partitioning in the mcuboot_opensource partitioning.h file is unchanged at:

#define BOOT_FLASH_BASE 0x70000000
#define BOOT_FLASH_ACT_APP 0x70040000
#define BOOT_FLASH_CAND_APP 0x701C0000

The debugger successfully writes to flash and each hardware reset (SW3) will restart the mcuboot application and I will again get the Unable to find bootable image error. It looks like either the application is looking in the wrong location in flash or the debugger erased the demo_apps. I'm not sure how to control this as I've restricted the size of the mcuboot program to 0x40000. I will note that I'm currently using signed applications using imgtool for both the applications. My command line statement for that is: ../mcuboot\scripts>imgtool sign --key root-rsa-2048.pem --align 4 --header-size 0x400 --pad-header --pad --confirm --slot-size 0x200000 --max-sectors 800 --version "1.0.0+0" evkmimxrt1064_hello_world.bin evkmimxrt1064_hello_world_SIGNED.bin

Any tips would be appreciated. 

0 Kudos
Reply
4 Replies

1,605 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JasonT ,

I have successfully run this demo before with RT1060, but for some reason RT1064 didn't work. Waiting for an internal reply now.

I can start by sharing my previous experience of successfully running examples on RT1060EVK.

0. It is recommended to use mcuboot_opensource + ota_mcuboot_server_enet example in conjunction first.

1. flash the mcuboot_opensource demo to the board;
2. build the ota_mcuboot_server_enet with MCUXpressoIDE, and generate the bin file;
3. sign and pad the bin file with imgtool.py, and generate the signed.bin file;
4. flash the signed.bin image to the address 0x7004_0000 with JLink Plus;
5. type command qc in JLink commander;
6. The signed.bin image was not recognized correctly. "Erasing faulty image in the primary slot."

C:\nxp\SDKPackages\SDK_2_15_100_EVK-MIMXRT1064\middleware\mcuboot_opensource\scripts>python imgtool.py sign --key sign-rsa2048-priv.pem --align 4 --header-size 0x400 --pad-header --slot-size 0x200000 --max-sectors 800 --version "1.0.0" server_v1_original.bin server_v1_signed_pad.bin --pad --confirm
image.py: sign the payload

 

This procedure should be fine, I'm waiting for an internal analysis of the exact reason for the failure and will sync with you as soon as I get it. I have tested this on both RT1060EVK and RT1170EVK.

Best regards,
Gavin

0 Kudos
Reply

1,574 Views
JasonT
Contributor I

Hi,

Would you mind sending me some detailed instructions on how to pad and sign the bin file. I have the gist of it but I'm not clear on the details. 

Cheers

0 Kudos
Reply

1,571 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JasonT ,

Sure. Signing an image requires the files sign-rsa2048-priv.pem, sign-rsa2048-pub.pem, original image bin ,as well as the imgtool tool.

1. pem file: Find in this folder and copy it to the imgtool folder:

Gavin_Jia_0-1718094371568.png

2. bin image file: create the bin file and rename it to server_v1_original.bin , then copy&paste it to the imgtool folder:

 

Gavin_Jia_1-1718094547596.png

 

3. Run the imgtool commands with python in this folder: SDK_2_15_100_EVK-MIMXRT1064\middleware\mcuboot_opensource\scripts

Gavin_Jia_2-1718094695458.png

python imgtool.py sign --key sign-rsa2048-priv.pem --align 4 --header-size 0x400 --pad-header --slot-size 0x180000 --max-sectors 800 --version "1.0.0" server_v1_original.bin server_v1_signed_pad.bin --pad --confirm

 

4. Finally, download this server_v1_signed_pad.bin file to address 0x7004_0000 via the jlink command line.

 

Best regards,
Gavin

0 Kudos
Reply

1,570 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

BTW: Previously it failed to run on my side because the internal flash size of RT1064 is not enough, changing the slot size to 0x180000 will work.

0 Kudos
Reply