EEPROM Emulation

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

EEPROM Emulation

1,787 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lezconcept on Tue Apr 16 00:53:34 MST 2013

Hello,


I want to switch to the LPC812 for my project but I need some bytes of non-volatile memory.


Is it possible to emulate an EEPROM memory with the embedded flash memory? If so, is there any sample code for doing this?


Thanks

Labels (1)
0 Kudos
8 Replies

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by qqqyounng on Wed Jun 03 22:15:20 MST 2015
Hi,

This is my Emulation Program.
It will introduce.
By using a source program second part, you can be incorporated EEPROM emulation.


Best regards,
DAN
0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdesbonnet on Wed Feb 18 09:29:30 MST 2015
I wrote a demo app for the LPC812 (which should work for all LPC8xx series devices) to illustrate allocating space in flash and reading/writing to that space. Details from my blog post:  http://jdesbonnet.blogspot.ie/2015/02/nxp-lpc8xx-eeprom-emulation.html
0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdesbonnet on Tue Feb 10 11:52:58 MST 2015
Thanks for the reply. Actually had some good suggestions from stackexchange:

http://electronics.stackexchange.com/questions/153424/how-to-automatically-allocate-a-page-of-flash-...

My favorite suggestion so far is this one:

const char eeprom_flashpage[64] __attribute__ ((aligned (64))) = {0};

0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Tue Feb 10 10:39:56 MST 2015
you probably want to allocate the last available page.  that gives you some room to grow for bug fixes ...
0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdesbonnet on Mon Feb 09 20:11:27 MST 2015
Thanks, that's very useful. After a little difficulty I got this working (my test program attempted to write a test string embedded in the program (ie from flash memory) and not SRAM.

I have one question: what's the best way of safely allocating a 64 byte page for storing settings etc. The example hard-codes a fixed location 0x1000.  But this seems dangerous. Can I automatically allocate the next 64 byte page after the end of program?
0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sweetalk on Tue Apr 30 08:53:07 MST 2013

Is it possible to replace some variables with the IAP?. I want to uptdate some variables after the program is executed and the user changes some parameters, those variables have to be updated the next time the program executes.

0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lezconcept on Thu Apr 18 02:00:59 MST 2013

Thanks a lot, I'll check that

0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Tue Apr 16 14:36:22 MST 2013

Hello
The attached zip file contains a presentation and example code for EEPROM emulation, using IAP (In Application Programming) for the LPC81x.
Regards
Paul

0 Kudos