Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Storing in RAM

Storing in RAM

2005-06-08 by Sridhar gadda

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

		
---------------------------------
Discover Yahoo!
 Stay in touch with email, IM, photo sharing & more. Check it out!

[Non-text portions of this message have been removed]

Re: Storing in RAM

2005-06-08 by soren_t_hansen

--- 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
Søren

Re: [lpc2000] Re: Storing in RAM

2005-06-08 by Bill Knight

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

Re: [lpc2000] Re: Storing in RAM

2005-06-09 by Gilles FAURIE

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 ----- 
Show quoted textHide quoted text
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
>
>
>
>
>
>
>
>

Re: [lpc2000] Re: Storing in RAM

2005-06-09 by Sridhar gadda

Hi Faurie,
                yes I am using Keil enviornment and thanks for the information. its a great help.
 
regards,
 
Sridhar

Gilles FAURIE <gilles.faurie@...> wrote:
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
Show quoted textHide quoted text
----- 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
>
>
>
>
>
>
>
> 




---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc2000/
  
   To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


		
---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.

[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.