K60DN512 FLEX NVM as EEPROM

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

K60DN512 FLEX NVM as EEPROM

767 Views
stefano_conegia
Contributor I

Hi All,

 

I am using a Freescale K60DN512 and MQX4.1 .

I need to store some data on NVM memory. I followed the example flash_demo.c and it works fine.

The problem is on the re-flash the program (for example for an update of FW) which erase also my previous data stored into NVM memory.

Is there a way to preserve my NVM data after a reload of FLASH memory or I have to find another way (extern EEPROM bye I2C bus for example)?  Thanks all,

Stefano

0 Kudos
2 Replies

392 Views
coryf
Contributor II

Stefano,

     If you are looking for a way to preserve the memory while you program a new image with a flash programmer this article on the MCU on Eclipse website is great. If you don't need to debug I think you can use the SREC format to preserve a section of memory. If you are using a boot loader then the boot loader will have to read the flash, save the data in RAM, then re-program it once the new image is programmed.

0 Kudos

392 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi stefano conegian

Unfortunately the developer does not take your requirement into account in this demo.

The example demonstrates basic operation we can do with flash memory including writing string or characters into the memory and reading it back. The memory characteristic, reading and writing statues as well as the data are displayed over output terminal.

This demo write the string to the flash with write function.

   len = write(flash_file, buffer, STRING_SIZE);

In your case you need to keep previous data,  I think you can read data from flash and store it to buffer, and add new data to buffer, and then write the whole buffer to flash. It will be ok.

I hope it helps.

Thanks

Regards

Daniel

0 Kudos