Hello,
I'm working on a L2Boot on EVK-XRT1040. I'm testing the possibility to manage two application images without swapping them.
I know I have to use the three IOMUXC registers, IOMUXC_GPR30, IOMUXC_GPR31, and IOMUXC_GPR32 to create and offset to the application.
My first temptative was a jump without offset, it run properly.
The second temptative was the jump with an offset, and here I have the problem.
This is my flash design:
L2_Boot: 0x6000_0000 - 0x6001_0000
App1: 0x6002_0000 - 0x6004_0000
App2: 0x6006_0000 - 0x6008_0000
Both App1 and App2 are compiled in the range of App1 (0x6002_0000 - 0x6004_0000)
App1 and App2 are the same code, they are just a simple blinking led example.
First temptative - jump with no offset
I loaded the App at address 0x6002_0000, this is the code of my L2 boot at the jump:
It works properly, after the jump the debugger stops to follow the code (no errors appear) and the App blinking led starts to run as expected.
This is good.
Second temptative - jump with offset
Starting from a mass erase, I loaded the same App used previously (compiled at address 0x6002_0000) at address 0x6006_0000, I defined the offset and relative regions (setting IOMUX_GPRx). This is the code:
In this case the jump to App doesn't run as expected , I mean when the debugger enters the farewellBootloader() it gives me the following error and the blinking led example doesn't start.
What is wrong in my jump with offset?
Thank you for your support
已解决! 转到解答。
Can you try with the same offset as in the following example:
Look how we do it in the example:
GPR30 start address
GPR31 end address of first partition
GPR32 offset (start of second image)
the second firmware should remap to @60010000 according to the offset setting
Thanks,
Nada
From what I understand, you are looking into the possibility of using flash remapping feature to be able to switch between two applications.
My question is would that switch happen at boot time or can happen at runtime? will this be needed in case of FW update?
The flash remapping feature you are leveraging with GPIO_IOMUXC_GPR_GPR30/31/32 registers is supported by the ROM. It allows you to download two firmware to the flash, and easily switch the firmware by calling the API function.
You can refer to this AN for this topic: https://www.nxp.com/docs/en/application-note/AN12255.pdf
Using this ROM api will allow you to manage the version of the application in case of FW update and will allow you to check the authenticity of your new FW at boot time ( through secure boot process)
We also have developed an open source SBL project that you can leverage in your case:
https://github.com/nxp-mcuxpresso/sbl
I hope this helps!
Thanks,
Nada
Hello @nada_lakhal,
thank for your interest on my problem.
Yes, I'm looking into the possibility of using flash remapping feature to switch from two different applications, but the jump into the two application has to be done from my second level boot, not from ROM boot.
I read the AN12255 but it doesn't explain my issue, could you please help me on understanding what is wrong on my code?
Regards
Riccardo
Can you try with the same offset as in the following example:
Look how we do it in the example:
GPR30 start address
GPR31 end address of first partition
GPR32 offset (start of second image)
the second firmware should remap to @60010000 according to the offset setting
Thanks,
Nada