Skip to main content
Associate
October 11, 2024
Question

STM32WL54 does not wake up after 4-5 days in STOP2 mode

  • October 11, 2024
  • 2 replies
  • 1088 views

The device is designed i  a way that, it should wake up every 30 seconds via RTC wake up timer or upon button press, read sensor values (for temperature and humidity ), if there is any change in these values , send packets via radio (SUBGhz) and enter STOP 2 mode. 

This works for 3-4 days after which it does not wake up.

The radio core is held in reset before entering STOP 2 mode. 

 

 

2 replies

ST Employee
October 14, 2024

Hello @euclid

There are many potential causes, could you share with us more details (EXTI config, RTC config), the radio core is it correctly re-initialized after waking up? 

Also, consider using a watchdog timer to reset the microcontroller if it gets stuck, and add logging or debugging information to track the state of the microcontroller over time 

euclidAuthor
Associate
March 7, 2025

@Sarra.S Adding more watchdog kicks does not fully resolve it. 

When we wake up we do check if radio is initialized, if not we throw an error. 

Here is the logic for entering sleep

if (__HAL_PWR_GET_FLAG(PWR_FLAG_C2BOOTS))
{
// Hold radio core in reset
HAL_PWREx_HoldCore(PWR_CORE_CPU2);
LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_44);
LL_PWR_SetRadioBusyTrigger(LL_PWR_RADIO_BUSY_TRIGGER_NONE);
}

//we wake up every 30 seconds to monitor the temperature and RH readings

HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, wakeupSec - 1, RTC_WAKEUPCLOCK_CK_SPRE_16BITS, 0)

//enter shutdown mode

HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
sleepTick = osKernelSuspend();
HAL_SuspendTick();
HAL_PWREx_EnterSHUTDOWNMode();
/* !!! reset if either core is not shutdown fully!!! */
NVIC_SystemReset();