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
Message
Re: [lpc2000] ram initialization at reset
2006-03-07 by David Hawkins
Attachments
- No local attachments were found for this message.