AnsweredAssumed Answered

HAL_RTCex_SetWakeUpTimer_IT() Not working properly

Question asked by eclipsePhage on Nov 17, 2015
Latest reply on Feb 29, 2016 by FTITI.Walid
Greetings, 

So I decided to play with the RTCex library, specifically the much abbreviated new timer_IT function.  My system is designed to shutdown after every code iteration and be awakened via the alarm(wakeup timer).

The issue is, the timer only works up to 30seconds.  I can input any counter up to that point and the system wakes near the specified time.  Not sure why, other than maybe I'm catching a edge at that point somehow.  Thoughts?   I've tried changing the RTC config parameters as well (WAKEUP, PUSHPULL, etc), to no avail.

Here is my code so far:

#define ALARM_TIMER ox1E046  //60s (considering 16MHz clock, using LSI) 

__HAL_RCC_PWR_CLK_ENABLE();
 HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF);
  
  /*## Setting the Wake up time ##############################################*/
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, ALARM_TIMER,
RTC_WAKEUPCLOCK_RTCCLK_DIV16);
  
  /* Request to enter STANDBY mode  */
HAL_Delay(3000);
HAL_PWR_EnterSTANDBYMode(); //***ENTER STANDBY***

//Configuration is thus (as recommended by another RTCex thread and CubeMX):
void MX_RTC_Init(void)
{
    /**Initialize RTC
    */
  hrtc.Instance = RTC;
  hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
  hrtc.Init.AsynchPrediv = 127;
  hrtc.Init.SynchPrediv = 255;
  hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
  hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
  hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
  HAL_RTC_Init(&hrtc);
}


void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
{
  if(hrtc->Instance==RTC)
  {
  /* USER CODE BEGIN RTC_MspInit 0 */


  /* USER CODE END RTC_MspInit 0 */
    /* Peripheral clock enable */
    __HAL_RCC_RTC_ENABLE();
          /* Peripheral interrupt init*/
    HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn);
  /* USER CODE BEGIN RTC_MspInit 1 */


  /* USER CODE END RTC_MspInit 1 */
  }


}

Outcomes