Program flash while remapping is active

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Program flash while remapping is active

Jump to solution
2,697 Views
armandc_
Contributor III

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 addressSizeProgram
0x6000 00000x4 0000Bootloader
0x6004 00000x50 0000Application A
0x6054 00000x50 0000Application 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 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
2,488 Views
victorjimenez
NXP TechSupport
NXP TechSupport

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 

View solution in original post

0 Kudos
Reply
6 Replies
2,487 Views
jay_heng
NXP Employee
NXP Employee

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

0 Kudos
Reply
2,487 Views
armandc_
Contributor III

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

0 Kudos
Reply
2,489 Views
victorjimenez
NXP TechSupport
NXP TechSupport

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 

0 Kudos
Reply
2,488 Views
victorjimenez
NXP TechSupport
NXP TechSupport

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 

0 Kudos
Reply
2,488 Views
armandc_
Contributor III

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

0 Kudos
Reply
2,487 Views
armandc_
Contributor III

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?

0 Kudos
Reply