We are writing a bootloader for the RT1021, and need to have a primary and secondary image, with the bootloader choosing the correct one at runtime. We are booting and running from QSPI NOR Flash (one bank, but we have a lot of available space).
At compile time, we don't know which slot the image is going to be flashed into. Currently we are looking at compiling each release twice, once for the first image and once for the second image so that the flash addresses get set correctly.
Is this the only way of doing this, or is there any way of having a flash base address set so we can use the same flash image but in different locations?
Thank you for any help.
If your application could run from RAM only (no XiP), your Bootloader could copy the application to RAM and start it. This way you could work with a single image which is linked to RAM.
Thank you for the information, I had totally missed that! (It's not mentioned in the RT1010 to RT1020 upgrade manual).
Obviously not the result I wanted, but now I know we can work around it.
Hi @PeteA ,
RT1010 and RT1060 have flexspi address remap function. But RT1020 and RT1050 haven't. You have to use different physical address for each image.
Regards,
Jing
@jingpan - Could you tell me if the new RT1040 supports remap?
Thanks!
Gavin
Looks like yes: IOMUXC_GPR_GPR[30:32] from the reference manual.