cancel
Showing results for 
Search instead for 
Did you mean: 

STOP mode and DWT

Zek_De
Senior

Hello everyone,

stm32l series MCU going in STOP mode and dwt has been enabled before, RTC wake it up with 20 seconds. Callback is called with 20 seconds and always dw_val increments with 2 sec. What is going on the backgorund. Normally as much as I got it , MCU all clocks must be stop in stop mode and dwt can't count.

void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
	SystemClock_Config();
	HAL_SuspendTick();
	dw_val = DWT->CYCCNT / (SystemCoreClock / 1000);
 
}

0 REPLIES 0