diff options
Diffstat (limited to 'chip/stm32/hwtimer.c')
-rw-r--r-- | chip/stm32/hwtimer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chip/stm32/hwtimer.c b/chip/stm32/hwtimer.c index 14a9bc7f2b..9e8f959553 100644 --- a/chip/stm32/hwtimer.c +++ b/chip/stm32/hwtimer.c @@ -320,6 +320,9 @@ int __hw_clock_source_init(uint32_t start_t) __hw_timer_enable_clock(TIM_CLOCK_MSB, 1); __hw_timer_enable_clock(TIM_CLOCK_LSB, 1); + /* Delay 1 APB clock cycle after the clock is enabled */ + clock_wait_bus_cycles(BUS_APB, 1); + /* * Timer configuration : Upcounter, counter disabled, update event only * on overflow. @@ -405,6 +408,9 @@ void hwtimer_setup_watchdog(void) /* Enable clock */ __hw_timer_enable_clock(TIM_WATCHDOG, 1); + /* Delay 1 APB clock cycle after the clock is enabled */ + clock_wait_bus_cycles(BUS_APB, 1); + /* * Timer configuration : Down counter, counter disabled, update * event only on overflow. |