mcuboot_opensource + lwip_httpsrv_ota_enet on the evkmimxrt1064

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

mcuboot_opensource + lwip_httpsrv_ota_enet on the evkmimxrt1064

Jump to solution
721 Views
sugarsplash
Contributor I

I have been attempting to follow previous suggestions and posts such as https://community.nxp.com/t5/i-MX-RT/Update-image-of-signed-application-Fails-for-lwip-httpsrv-ota/t...

But I am having trouble getting through the lwip_httpsrv_ota_enet example. Would like to demonstrate the following on my dev board before moving to a custom pcba:

  1. A flash resident second bootloader
  2. ability to flash applications to flash over Ethernet

Firstly, building and flashing the mcuboot_opensource example seems to work find and as expected. 

J-Link>loadfile MCUXpressoIDE_11.6.1_8255\workspace\evkmimxrt1064_mcuboot_opensource\Release\evkmimxrt1064_mcuboot_opensource.bin 0x70000000
'loadfile': Performing implicit reset & halt of MCU.
ResetTarget() start
ResetTarget() end
AfterResetTarget() start
AfterResetTarget() end
Downloading file [MCUXpressoIDE_11.6.1_8255\workspace\evkmimxrt1064_mcuboot_opensource\Release\evkmimxrt1064_mcuboot_opensource.bin]...
J-Link: Flash download: Bank 0 @ 0x70000000: 1 range affected (65536 bytes)
J-Link: Flash download: Total: 0.760s (Prepare: 0.222s, Compare: 0.113s, Erase: 0.235s, Program & Verify: 0.169s, Restore: 0.019s)
J-Link: Flash download: Program & Verify speed: 378 KB/s
O.K.

When attempting to subsequently flash the lwip_httpsrv_ota_enet application, I am interested in using the "direct method"

a) programing signed application image to the primary application partition using an external tool (direct method)
b) jump-starting the application by debugger, performing OTA update with the signed image, resetting the board and letting the bootloader to perform update (indirect method)

When attempting the direct method, I first sign the image:

(venve) nxp_sdk\middleware\mcuboot_opensource\scripts>python imgtool.py sign 
    --key nxp_sdk\boards\evkmimxrt1064\mcuboot_opensource\keys\sign-rsa2048-priv.pem 
    --align 4 --header-size 0x400 --pad-header --slot-size 0x200000 
    --max-sectors 800 --version "1.0" MCUXpressoIDE_11.6.1_8255\workspace\evkmimxrt1064_mcuboot_opensource\Release\evkmimxrt1064_mcuboot_opensource.bin http_ota_signed.bin

 

I then flash this signed image: 

J-Link>loadfile http_ota_signed.bin 0x70040000
'loadfile': Performing implicit reset & halt of MCU.
ResetTarget() start
ResetTarget() end
AfterResetTarget() start
AfterResetTarget() end
Downloading file [http_ota_signed.bin]...
J-Link: Flash download: Bank 0 @ 0x70000000: 1 range affected (65536 bytes)
J-Link: Flash download: Total: 0.503s (Prepare: 0.045s, Compare: 0.022s, Erase: 0.228s, Program & Verify: 0.188s, Restore: 0.018s)
J-Link: Flash download: Program & Verify speed: 340 KB/s
O.K.

 

It looks like sbl accepts this as a bootable image but the image crashes when loaded. 

hello sbl.
Bootloader Version 1.9.0
Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: none
Bootloader chainload address offset: 0x40000
Reset_Handler address offset: 0x40400
Jumping to the image


hello sbl.
Bootloader Version 1.9.0
Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: none
Bootloader chainload address offset: 0x40000
Reset_Handler address offset: 0x40400
Jumping to the image


hello sbl.
Bootloader Version 1.9.0
Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: none
Bootloader chainload address offset: 0x40000
Reset_Handler address offset: 0x40400
Jumping to the image

 

I am hoping someone may be able to help point me in the right direction. Could this be an issue with my built lwip_httpsrv_ota application or perhaps how I am signing and flashing?  Attaching my signed and unsigned bin files if that helps. 

Labels (1)
0 Kudos
Reply
1 Solution
716 Views
sugarsplash
Contributor I

Omg, I signed the wrong file. I have been accidentally flashing the mcuboot_opensource binary to slot 1. I am ashame. 

View solution in original post

0 Kudos
Reply
1 Reply
717 Views
sugarsplash
Contributor I

Omg, I signed the wrong file. I have been accidentally flashing the mcuboot_opensource binary to slot 1. I am ashame. 

0 Kudos
Reply