Hi NXP Community,
I am working on an i.MX RT1050 project with a single bootloader currently located at 0x60000000 in flash. I want the ability to choose at runtime which start address the bootloader runs from, essentially executing the same bootloader from two different locations (e.g., factory and working boot modes).
Constraints and setup:
Only one bootloader image exists in flash.
I want to run it from RAM at runtime to select different start addresses.
The bootloader is not currently position-independent (PIC).
I have enough RAM allocated (0x80000000, size 2 MB) to hold the bootloader.
I am aware of the approach where:
Copy the bootloader from flash to RAM.
Set SCB->VTOR to the new RAM location.
Set MSP to the new bootloader’s stack pointer.
Jump to the reset handler in RAM.
My questions are:
Can the i.MX RT1050 safely execute a bootloader from RAM if it is not compiled as PIC?
What modifications are needed to make the bootloader position-independent?
Are there best practices to implement a runtime-selectable bootloader start address for firmware slots?
Any guidance, examples, or references would be very helpful.