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?
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:
And it's code:
You also can refer to the SDK code,eg:
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.
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.
I highly recommend you refer to the RT1060 SDK ota bootloader, you can consider it is the secondary bootloader.
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.