Difference in flashx driver for K60 bsp vs. K22

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

Difference in flashx driver for K60 bsp vs. K22

Jump to solution
1,641 Views
dcooper
Contributor II

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

0 Kudos
1 Solution
1,169 Views
danielchen
NXP TechSupport
NXP TechSupport

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.

swap.jpg

If you need swap feature, I suggest you choose MK22FX512VLH12 or MK221M0VLH12, they support swap functionality.

Regards

Daniel

View solution in original post

7 Replies
1,169 Views
sreejithmenon
Contributor I

Does MK22FN512CAP support the swap functionality?

0 Kudos
1,169 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi sreejith menon

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

0 Kudos
1,169 Views
danielchen
NXP TechSupport
NXP TechSupport

For MK22FN512CAP, the flash type is FTFA, not support swap functionality.

Regards

Daniel

0 Kudos
1,168 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos
1,169 Views
dcooper
Contributor II

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

0 Kudos
1,170 Views
danielchen
NXP TechSupport
NXP TechSupport

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.

swap.jpg

If you need swap feature, I suggest you choose MK22FX512VLH12 or MK221M0VLH12, they support swap functionality.

Regards

Daniel

1,169 Views
dcooper
Contributor II

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

0 Kudos