Relative Addresses in Compiled Image

cancel
Showing results for 
Search instead for 
Did you mean: 

Relative Addresses in Compiled Image

70 Views
chadgraham
Contributor III

Hello,

I am in the beginning stages of implementing a custom bootloader and was trying to determine if there was a way to compile an image such that it didn't require known the actual start location when compiled.

Example: We implement a traditional bootloader and place the application at 0x1000.  Then, during the development of the bootloader, we realize that the 0x0-0xFFF is too small and we need to take over from 0x0-0x1FFF.  Ideally, we could update the system's memory without having to recompile the application code by changing the installed location to 0x2000, update the IVT and we are ready to continue.

Does anyone have any ideas on if this is possible and, if so, where I could find documentation on this?

0 Kudos
3 Replies

60 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi chadgraham,

    Which NXP product you are using now? Seems MIMXRT product, please let me know the partnumber.

   About the secondary bootloader, you can refer to this application note:

https://www.nxp.com/docs/en/application-note/AN12604.pdf

  And it's code:

https://www.nxp.com/docs/en/application-note-software/AN12604SW.zip

You also can refer to the SDK code,eg:

SDK_2.9.2_EVK-MIMXRT1060\boards\evkmimxrt1060\bootloader_examples\ota_bootloader

0x1000 is the IVT, normally, you need to put your secondary bootloader code from 0X2000.

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

0 Kudos

47 Views
chadgraham
Contributor III

Hello Kerry,

Thank you for the response.  We are using the RT1062 and I plan to modify a bootloader to meet our specific needs.

My question is aimed at trying to understand if the application image needs to know the starting address at the time it is compiled since the recommended method of controlling an image location is done with the MCUXpresso Memory Details pane in MCU Settings.  Ideally, I'd like to be able to move the image around in memory without having to recompile it.

0 Kudos

33 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi chadgraham,

   I highly recommend you refer to the RT1060 SDK ota bootloader, you can consider it is the secondary bootloader.

secondar bootloader:

SDK_2.9.2_EVK-MIMXRT1060\boards\evkmimxrt1060\bootloader_examples\ota_bootloader

and app:

SDK_2.9.2_EVK-MIMXRT1060\boards\evkmimxrt1060\lwip_examples\lwip_httpssrv_ota

Normally, both the secondary bootloader and the app address is determined when it is complied, if you check the lwip_httpssrv_ota, you will find the IDE already arrange the app address for it. the secondary bootloader is put in the front external flash address.

Best Regards,

Kerry

 

0 Kudos