cancel
Showing results for 
Search instead for 
Did you mean: 

rebooting in standby mode.

SYun.2
Associate III

Hello, I am developing STM32L072.

The library is using ""I CUBE LRWAN".

Inside the library, I have created the part that enters the OFF mode (STANDBY mode.

But the MCU doesn't consider the RTC and just keeps rebooting.

What else should I consider?

void PWR_EnterOffMode(void)

{

 /* USER CODE BEGIN EnterOffMode_1 */

UTILS_ENTER_CRITICAL_SECTION();

 if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)

 {

  /* Clear Standby flag */

  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); 

 }

DBGMCU->CR = 0;

/*SX1276 DEINIT*/

 Sx_Board_IoDeInit();

Gpio_PreInit();

Gpio_STOP_PowerHold_Init();

 HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);

 HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x2616, RTC_WAKEUPCLOCK_RTCCLK_DIV16);

/* Clear all related wakeup flags */

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

 /* Enter the Standby mode */

 HAL_PWR_EnterSTANDBYMode();

UTILS_EXIT_CRITICAL_SECTION();

 /* USER CODE END EnterOffMode_1 */

}

3 REPLIES 3
Peter BENSCH
ST Employee

Please check SYSTICK whether it is deactivated, otherwise it fires continuously with an interrupt every 1 ms.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for the reply.

But I don't think this is enough.

HAL_DeInit();

__HAL_RCC_PWR_CLK_ENABLE();

After adding two more lines, the problem of Jebooting disappeared.

There is an additional problem that the power consumption is fixed at 10 mA.