Anuj Tanksali

Program Flash Memory Swap in MK22FN1M0VLL12

Discussion created by Anuj Tanksali on Dec 12, 2018
Latest reply on Dec 13, 2018 by Anuj Tanksali



I will be using MK22FN1M0VLL12 device with OTA. I believe this device supports the program flash memory swap feature where lower half of flash is active and upper half is inactive area where OTA will download the new image. Please correct me if am wrong.


Eg. MK22FN1M0VLL12 has 1MB of flash then 0x0000 to 0x80000  is active area and 0x80000 to 0x100000 is inactive area where OTA will download the new image. 

on reboot the memory swap feature will take affect and below image at 0x80000 to 0x100000 will be mapped to 0x00 


Currently am using a serial bootloader which downloads the application from PC at address 0x6000 to end of flash memory and i plan to use swap memory feature for OTA.


Is there any sample code specific to MK22FN1M0VLL12 for program flash memory swap feature. I have a code which is specific to K64 series of microcontroller. 


also another question is currently i have a serial bootloader which downloads the image to location 0x6000 from PC.

But when i will be using the OTA code with memory swap feature will i be able to use the serial bootloader as it is from 0x000 to 5fff memory and memory swap feature will directly swap 0x0000 to 0x80000 area and 0x80000 to 0x100000 area.