Hello,
I'm using the i-MXRT1060 and need to implement fail-safe firmware upgrade. I'm studying the possibility to use the flash remapping function for that purpose but I have a question regarding how to write the new firmware when remapping is active.
The table below represents the partitioning of the NOR flash attached to the FlexSPI 1 controller.
Start address | Size | Program |
---|---|---|
0x6000 0000 | 0x4 0000 | Bootloader |
0x6004 0000 | 0x50 0000 | Application A |
0x6054 0000 | 0x50 0000 | Application B |
Here is the scenario that I envision: the bootloader checks which application must be run (either A or B), if A must be run no remapping is configured but if B must be run the bootloader configures flash remapping (start addr = 0x60040000, end addr = 0x60540000, offset = 0x500000) before jumping to application.
If application A is active, it is not a problem to program application B. But how does that work when application B is active with the remapping since writing to address 0x60040000 would actually put the data at address 0x60540000 (application B instead of A).
How do I write to physical address 0x60040000 when remapping is active?
Thanks for your help.
PS: This is similar to this question https://community.nxp.com/message/1182807
Solved! Go to Solution.
Hi Armand,
I checked this internally with Jay. I apologize for the misunderstanding on my side, Jay is correct, you can just call SDK flash driver or ROM API to program the flash without worrying about the remap setting.
Regards,
Victor
You can just call SDK flash driver or ROM API to program flash no matter what remap setting is, because dest address info is passed by IPG command in flash driver, it is offset address, so remap setting has no effect on it
Hi Jay,
Thanks for your answer, but it is different from the one given by Victor. I'm now confused since I do not know who I should believe.
Could you please check together and give a definitive answer to my question which I could trust.
Regards,
Armand
Hi Armand,
I checked this internally with Jay. I apologize for the misunderstanding on my side, Jay is correct, you can just call SDK flash driver or ROM API to program the flash without worrying about the remap setting.
Regards,
Victor
Hi Armand,
Regarding your first question. For example, block1 starts from 0x60000000 and block2 starts from 0x60010000.
Now, the application is running on block2 and wants to program new firmware into block1.
First, you need a kind of firmware update-loader which executes on SRAM for flash operations as the following.
1. Modify IOMUXC_GPR_GPR30/31/32 = 0
2. Erase block1 and write the new image into block1
3. Power-on reset, MCU will boot from block1.
Now, regarding the AHB commands, could you please clarify where did you read this or what made you think that only AHB commands are supported when using the Flash remapping?
Regards,
Victor
Hello Victor,
Thanks for your clear answer.
Regarding AHB v.s. IP commands the idea came to me when reading https://community.nxp.com/thread/508753 , but since I was not sure at all and didn't find anything in the user manual I asked the question here.
Regards,
Armand
Reading this https://community.nxp.com/message/1182807 I'm wondering if the remapping only applies to AHB command and not to IP commands. Unfortunately I didn't find anything explicit in the reference manual. Can someone confirm that remappping only applies to AHB commands?