/* This function configures the system to enter Standby mode with RTC clocked by LSI and with Backup SRAM ON for current consumption measurement purpose.  */
void StandbyRTCBKPSRAMMode_Measure(void)
/* This function configures the system to enter Standby mode with RTC clocked by LSI and with Backup SRAM ON for current consumption measurement purpose.  */
void StandbyRTCBKPSRAMMode_Measure(void)
{
  PWR_BackupAccessCmd(ENABLE); 
  RCC_LSICmd(ENABLE);  
  while(RCC_GetFlagStatus(RCC_FLAG_LSIRDY) == RESET)
  {
  }
  RCC_RTCCLKConfig(RCC_RTCCLKSource_LSI);
  RCC_RTCCLKCmd(ENABLE);
  RTC_WaitForSynchro();
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_BKPSRAM, ENABLE);
  PWR_BackupRegulatorCmd(ENABLE);
  while(PWR_GetFlagStatus(PWR_FLAG_BRR) == RESET)
  {
  }
  RTC_WakeUpClockConfig(RTC_WakeUpClock_RTCCLK_Div16);
  RTC_SetWakeUpCounter(0xA000-1);
  RTC_ITConfig(RTC_IT_WUT, ENABLE);
  RTC_WakeUpCmd(ENABLE);
  RTC_ClearFlag(RTC_FLAG_WUTF);
  PWR_EnterSTANDBYMode();
  while (1)
  {
  }
}