Storing variable in internal flash/ EEPROM and utilizing that value after power on reset

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

Storing variable in internal flash/ EEPROM and utilizing that value after power on reset

2,380 Views
Amit_Kumar1
Senior Contributor II

Hello all

I am using FRDM-K20D50M board in that I want to store a value into the flash or EEPROM and use the value after the controller is reset. But when I tried doing it, I came across that for this we need to do the partition in the flash. I don't know how to do that. in other uc we had separate EEPROM (internal) so I used to update the value in that EEPROM and after POR it used to extract the value from there and used to continue from there itself, without resetting the variable. I am using Codewarrior  with processor expert. I am struck at this problem as at all place I found that this partition needs to be handled carefully. So please look into the matter.

Thanks and Regards

Amit Kumar

0 Kudos
4 Replies

582 Views
DavidS
NXP Employee
NXP Employee

Hi Amit,

Please look at the Freescale AN4282 application note...  Using the Kinetis Family Enhanced EEPROM Functionality
.

http://cache.freescale.com/files/32bit/doc/app_note/AN4282.pdf

Regards,

David

582 Views
Amit_Kumar1
Senior Contributor II

Thanks David

I went through the pdf. but still was unable to configure the EEPROM memory. I am using FRDM-K20D50M board I looked into the datasheet also but I didn't find the memory address. I was trying with processor expert with code warrior in that I was using flash memory only for storing value, but there also I needed to specify address which i don't know from which document I will get. I tried using FLASH_LDD component of processor expert by modifying the code for MK20DX256 uc present in the example code of code warrior but it showed the following error

pastedImage_0.png

SO what to do next any idea will be grateful.

Thanks and regards

Amit Kumar

0 Kudos

582 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Amit Kumar,

    Actually, about the question of using the PE to configure the EEPROM portation, there is a similar question about it, and it is already solved.

    The link is :https://community.freescale.com/message/307170#307170

    I hope it helps you!

    If you still have question, please contact with me!

Best regards!

Jingjing

0 Kudos

582 Views
DavidS
NXP Employee
NXP Employee

Hi Amit,

As far as I know PE does not have a component specifically for the FlexNVM/eeprom operation but if I'm wrong hopefully someone else will speak up and help.

The Kinetis512_V2_SC.zip baremetal code examples has a good FlexNVM/eeprom demo.

You can get it here and port it to your K20.

K60_100: Kinetis K60 Ethernet Crypto 100 MHz MCUs

Once you have software look for: ~KINETIS512_SC\build\cw\flexmem_demo .

The Kinetis Peripheral Module Quick Reference Users Guide is very good reading too.  Specifically Chapters 8&9 relate to Flash and FlexNVM/eeprom operation.

http://cache.freescale.com/files/32bit/doc/quick_ref_guide/KQRUG.pdf?&Parent_nodeId=&Parent_pageType...

Lastly the Reference Manual for your Kinetis device has a very important chapter #3 that describes the specific MCU capabilities for every on-chip module.  Please look at the Flash Memory Configuration section that will detail how much program flash and FlexNVM you have and what the address of the FlexRAM memory is to access the FlexNVM.

Regards,

David

0 Kudos