Kinetis Flash Swap Disabling

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

Kinetis Flash Swap Disabling

1,552 Views
pavelst
Contributor II

Hello,

We are using the Flash Swap feature in our Kinetis (K11) based products and successfully updating its firmware over-the-air (FOTA).

Now on these devices, which are already in the field, we would like to disable the Flash Swap and start using the whole flash as a single bank with different method of FOTA update.

Is it possible to disable it in such a way that it won't have any limitations on flash areas use by our application? Or at least to remove the limitation of having the swap supporting block in the middle of the flash?

If needed, we can have a control so that our code will start at original Block 0 at the time of disabling the Flash Swap.

Thank you,

Pavel

Labels (1)
0 Kudos
Reply
3 Replies

1,312 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

There is an application note AN4533 about Kinetis Flash SWAP function.

Below is the common question abstracted from AN4533:

Are systems using swap limited to applications that fit within one of the two flash blocks (half the total flash memory size)?

In most use cases, the system application will be limited to executing within one flash block (active block). However, the swap system does not restrict code from executing in the nonactive block. Therefore, code can execute from either block at any time.

It is possible to use advanced techniques to expand the size of the application over the size of half the p-flash and still use flash swap. This would sacrifice some protection against problems, but gain more room for code. This is outside the scope of this application note.

Can the sector with the flash swap indicator be used for data/program storage?

Typically, the user specifies an unused flash sector to place the flash swap indicators. However, the swap system will not disturb the other data in the flash sector containing the indicators. So, that space can be used for program or data storage.

The space should be designated in the linker file accordingly.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,312 Views
pavelst
Contributor II

Thank you Ma Hui, we are aware of this method and used it when we our system was actually using the Flash Swap mechanism.

However now we want to stop using this mechanism on existing deployed system (by updating it over the air), and we wish to use the whole flash freely without restrictions. From the documentation we are concerned that it might not be possible, and even though the Swap is disabled we are still not allowed to erase and write to these blocks freely. We are afraid that only a Mass Erase command fully disables the Flash Swap, which is not possible when we update over the air.

So is there a way to disable Flash Swap without Mass Erase in a way that will allow freely erasing and writing to all flash blocks?

0 Kudos
Reply

1,312 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Customer need to make sure the Block 0 as the active block, then the flash swap indicator filed could be erased and customer can use software to disable swap feature (not call swap control command). There with no register setting to disable Flash swap feature.

Wish it helps.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply