2022-01-06 02:48 PM
I am trying to use stop mode with the STM32L073 chip. I am able to get my code working while I am not using FreeRTOS on the STM32L073. I am also able to get this working on the STM32G0 Nucleo board with FreeRTOS.
When I start using FreeRTOS on the STM32L073, I am getting timer interrupts on the systick Timebase source I am using. TIM7 in this case.
I believe after reading up on this that HAL_SuspendTick() should be stopping all TIM7 interrupts on my system until I call HAL_ResumeTick();
//Last community.st.com solution to deal with this problem was to only include the 2 interrupts of RTC and button interrupt. That is what this tempEXTIIMR value is.
volatile uint32_t tempEXTIIMR = 0;
tempEXTIIMR = EXTI->IMR;
//Disable all but RTC wake up source and ON_OFF_BUTTON
//EXTI_IMR_IM3 is the bitfield for the ON_OFF_BUTTON's interrupt
EXTI->IMR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT | EXTI_IMR_IM3;
HAL_SuspendTick();
osThreadSuspendAll();
HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);
SystemClock_Config();
HAL_ResumeTick();
EXTI->IMR = tempEXTIIMR;
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
osThreadResumeAll();
Solved! Go to Solution.
2022-01-13 10:25 AM
So I tried to recreate the issue. Now it works fine if I am debugging or not. I didn't change anything so that is a bit concerning...
2022-01-13 06:28 AM
Hello @VWied.1
Was this behavior observed during an active debugging session?
BeST Regards,
Walid
2022-01-13 10:25 AM
So I tried to recreate the issue. Now it works fine if I am debugging or not. I didn't change anything so that is a bit concerning...