Hello, You have perhaps Keil envrionment because you use ULINK. If you use KEIL you only have to add a #pragma NOINIT before declaration of your variable. with this your data will keep its value after a reset. If you have a battery you won't lose data even if you cut off the power. For example : #pragma NOINIT /* Add your data declaration wich you want to keep value after reset */ BYTE MyData; #pragma INIT ----- Original Message ----- From: "Bill Knight" <BillK@...> To: <lpc2000@yahoogroups.com> Sent: Wednesday, June 08, 2005 3:33 PM Subject: Re: [lpc2000] Re: Storing in RAM > On Wed, 08 Jun 2005 13:19:51 -0000, soren_t_hansen wrote: > >>--- In lpc2000@yahoogroups.com, Sridhar gadda <sridhargadda@y...> wrote: >>> Hello, >>> >>> I want to write a program which stores a variable in RAM >>so that when processors get reset, the stored value in RAM should not >>loose data. Again after reset the processor, I want to read the >>variable. I am using lpc2129 and ULINK for downlaoding firmware. Can >>any one suggests me how to proceed ?? does someone encounterd this >>problem before ?? >>> >>> I am looking forward to your replies >>> >>> best regards, >>> >>> Sridhar > >>The RAM looses its content in a reset. If you want your program to >>hold variables after a reset, you have to store them in Flash. > >>Best Regards >>Soren > > > Soren > Not necessarily. Static RAM loses it contents on power loss but not > on processor reset. Sridhar can accomplish what he desires by > creating a new memory segment that is not initialized by the processor > during the boot process and place the desired variables in that memory > segment. I would suggest adding a CRC or checksum to confirm the > values are correct and checking it just after coming out of reset. If > the check fails, then default values should be used. The details of > creating the memory segment and placing variables are specific to the > compiler and linker used. > > Regards > -Bill Knight > R O SoftWare & > http://www.theARMPatch.com > > > > > > Yahoo! Groups Links > > > > > > > >
Message
Re: [lpc2000] Re: Storing in RAM
2005-06-09 by Gilles FAURIE
Attachments
- No local attachments were found for this message.