2006-10-11 09:14 PM
2011-05-17 12:33 AM
I have a Keil MCBSTR912 board and a REVA STR912 board and am having the same problem on both.
I hook a battery to the processor VBATT pin, and remove the power from the board. When you hook power back up, it reboots and clears the memory variables when I think it shouldn't. So it doesn't look like the VBATT SRAM thing is working. Any suggestions ?? #include ''91x_lib.h'' #include ''main.h'' GPIO_InitTypeDef GPIO_InitStructure; static unsigned char display_byte; static int delaycnt; int main() { // ////////////////////////////////////////////////////////////////////////////////////////////////////// SCU_APBPeriphClockConfig(__GPIO7, ENABLE); // GPIO7 goes to the LEDs GPIO_DeInit(GPIO7); GPIO_StructInit(&GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1; GPIO_Init(GPIO7, &GPIO_InitStructure); // ////////////////////////////////////////////////////////////////////////////////////////////////////// SCU_APBPeriphClockConfig(__RTC,ENABLE); RTC_DeInit(); RTC_SRAMBattPowerCmd(ENABLE); // ////////////////////////////////////////////////////////////////////////////////////////////////////// while (1) { for (delaycnt = 0; delaycnt < 500000; delaycnt++); // sleep GPIO_Write(GPIO7, display_byte++); } }2011-05-17 12:33 AM
Hi,
Check if the compiler initialize the ram. I'm using IAR. In the init code the allocated memory is filled with 0 if the variable is not initilized. I think that your variables are zeroed during the init sequence.