Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] ram initialization at reset

2006-03-07 by David Hawkins

ebarker123 wrote:
> Here is the scenario.
> 
> I have an MCB2138 eval board. I have a menu talking on a serial port.
> 
> Using the menu, I can set and print a variable called 'mytemp'.
> 
> I set the value to say, 456, and print that out.
> 
> I press reset and the value is changed to 0. 
> Where/How is this variable getting changed. My application requires
> that we be able to press reset, and the SRAM contents not change.
> 
> Any clues ?

The startup code zeros variables in the .data section.

If you want the startup code to leave your variable alone,
create a new section for it, and place it in that section.

This question has been asked before, so take a look in the
archives.

Another option is both reset and power-down preservation,
by writing the variable to flash when it changes.

Look in the archives for threads on using the flash as EEPROM,
there are a few discussions, and I believe there are examples
in the files area.

Dave

Attachments

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.