We changed the processor on a board from the a K60 part to a K22, both with 512k of flash
The firmware is making use of the dual bank flash support in the chip for firmware updates using the swap functionality.
I based the bsp for the K22 board on the bsp for the FRDMK22120M board. It seems the flashx driver built for this bsp does not have support for the flash bank swapping.
Looking at the _bsp_flashx_file_blocks definition in init_flashx.c the "swap0" and "swap1" blocks are not defined.
The low level driver for the K22 bsp is also different, _flashx_ftfa_if vs. _flashx_ftfl_if.
Can you provide guidance on what I will need to do to modifying the K22 bsp for the 512k flash part to take advantage of the dual banks of flash and swapping between them.
Thanks
David
Solved! Go to Solution.
Hi David:
For devices with two or more program flash memory blocks that have the p-flash swap feature, the system programmer can configure the logical memory map of the p-flash space such that either of the two physical p-flash can exist at relative address 0x00. MK22fn512VLH12 chip does not support this feature.
If you need swap feature, I suggest you choose MK22FX512VLH12 or MK221M0VLH12, they support swap functionality.
Regards
Daniel
Does MK22FN512CAP support the swap functionality?
I made a compare between FTFA, FTFL, FTFE moduel, it could give you some idea.
1. Generally, FTFA exists in Kinetis L series. FTFL exists in Kinetis K series < 120 MHz product. FTFE exists in Kinetis K series > 100 Mhz product.
2 FTFL and FTFE are the same on function.
3 FTFA has not Flex Memory. FTFA has not flash swap function.
One example is MK22FX512VLL12, and MK22FN1M0VLL12, they support swap feature, and the flash type is FTFE. You can refer to my attached reference manual.
Regards
Daniel
For MK22FN512CAP, the flash type is FTFA, not support swap functionality.
Regards
Daniel
Hi David:
For frdmK22 board, the MCU is K22FN512, the flash module is FTFA. unfortunately, FTFA not support flash swap function.
But for K22FX512, the flash module is FTFE, it can support flash swap function.
Regards
Daniel
Re reading your response, I see the statement that the FTFA module does not support flash swap.
We are using the MK22FN512VLH12 chip.
The hardware reference (document K22P121M120SF7RM), Chapter 29 for the FTFA module seems to indicate that the device flash is divided into two banks, that you can write to the non-active bank etc.
Can you clarify this?
Thanks
Hi David:
For devices with two or more program flash memory blocks that have the p-flash swap feature, the system programmer can configure the logical memory map of the p-flash space such that either of the two physical p-flash can exist at relative address 0x00. MK22fn512VLH12 chip does not support this feature.
If you need swap feature, I suggest you choose MK22FX512VLH12 or MK221M0VLH12, they support swap functionality.
Regards
Daniel
Daniel
Thank you for the response.
Can you provide guidance as to how to include the FTFE module my project.
I am using the IAR tool set.
I included the flash_ftfe.c/h and flash_ftfe_prt.h files in the project and made changes in init_flashx.c, but the project will not build because of a number of undefined values related to the FTFE module specific to the K22.
The MK22F51212.h file I have has several blocks of definitions for FTFA support.
I assume I need these definitions for the FTFE module.
Thanks
David