2007-07-30 03:32 AM
2011-05-17 12:43 AM
Hi all,
Can anybody tell me how to give battery backup to SRAM? Though I configured the PWR bit in the RTC control register, the SRAM contents are not retained after power reset. Plz help me. Its very urgent. Send an example code if possible. Regards Neelima.2011-05-17 12:43 AM
Hi all,
For retaining the values of the variable even after powerup, I've tried all the following : 1. Configured the pwr bit in RTC control register to provide battery backup for SRAM 2. Configured the SRAM as NoInit in the project-options-target menu. 3. Declared the variables as a. __attribute((__zero_init)) u8 dummy1; b. #pragma NOINIT u8 dummy2; But both the variables are not retaining their previous values after reset. Plz help me. Its vary urgent. Regards, Neelima. [ This message was edited by: anuradha on 21-05-2007 11:31 ]2011-05-17 12:43 AM
Hi all,
while trying to write variables in the NoInit section of RAM, I found one strange thing. Any value written directly to the SRAM memory location like ''*(u8*)0x04007000 = 1'' is retaind even after power reset but the global variables declared are not. They are getting initialized to zero after power reset. Is it because they are declared as global? If so, what is the alternative way to declare global variables so that they can retain their values? And what area of SRAM will be allocated for stack? Regards, Neelima.2011-05-17 12:43 AM
Quote:
Any value written directly to the SRAM memory location like ''*(u8*)0x04007000 = 1'' is retaind even after power reset but the global variables declared are not. They are getting initialized to zero after power reset. Hi Neelima. RTFM! In the current version of RVCT, the compiler might place small global ZI data items in RW data sections as an optimization. In RVCT 2.0.1 and earlier, small global ZI data items were placed in ZI data sections by default. Selecting the option --bss_threshold=0 instructs the compiler to place all small global ZI data items in the current compilation module in a ZI data section. ((c) ARM Development Tools) [ This message was edited by: Andy_ry on 30-07-2007 16:54 ]