drivers: timer: stm32u5 lptimer waits for DIER complete

On the stm32U5, when modifying the DIER register of the LPTIM peripheral,
a new write operation to can only be performed when the previous write
operation is completed and before going-on.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2023-02-06 15:48:11 +01:00 committed by Marti Bolivar
commit 23f03c8030

View file

@ -435,6 +435,11 @@ static int sys_clock_driver_init(void)
/* ARROK bit validates the write operation to ARR register */
LL_LPTIM_EnableIT_ARROK(LPTIM);
stm32_lptim_wait_ready();
#ifdef CONFIG_SOC_SERIES_STM32U5X
while (LL_LPTIM_IsActiveFlag_DIEROK(LPTIM) == 0) {
}
LL_LPTIM_ClearFlag_DIEROK(LPTIM);
#endif
LL_LPTIM_ClearFlag_ARROK(LPTIM);
accumulated_lptim_cnt = 0;