AnsweredAssumed Answered

How do you get flex memory(Flex NVM) to work on an MK64FX?

Question asked by Ed Ablan on Oct 20, 2017
Latest reply on Oct 23, 2017 by Hui_Ma

Quick intro, we are using the ARM mbed cli and exporting a project to IAR. We have swapped the processors on our FRDM K64F board to an MK64FX512 that has flex memory. It's pin compatible as long as you use the same pin and package in this case the 100 LQFP package. I have run some code on the board after the micro swap and verified it works through a USART echo, and loading a FAT file system onto an SD card. The one thing I can't wrap my head on is the FlexMemory. 

 

So I have looked at the application note for using flex memory, however it does a pretty poor job of actually letting you know which steps are necessary for you to set up processor to enable. I need to know which registers to set specifically in what order, and how to do read and writes from a firmware perspective. There is not applicable explanation that can be found anywhere as to how to get this to work on firmware.

 

I have gone through the fsl_flash.c and fsl_flash.h that get compiled in and see there are some macros that need to be defined for you the get the FLASH_EepromWrite() function to work as well as some other configuration steps. However, this does help me understand which registers need to be set to choose the correct memory alloaction for E-Flash and E-Ram. It also doesn't have an interface for me to define the target correctly CPU_MK64FX512VLL12 and even when I create a project wide define inside the IAR preprocessor for CPU_MK64FX512VLL12, it still won't compile in the FLASH_EepromWrite() function and other configuration steps. Could someone write a useful application note that can be used to actually write firmware? or Share a demo project from NXP that shows the FlexMemory at work with source code included? So far I've been a big fan of the K64F, but this flex memory thing is getting annoying.

Outcomes