2024-10-11 8:00 AM
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.
2024-10-14 3:16 AM
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
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.
2025-03-07 1:16 AM
@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();