diff --git a/targets/TARGET_STM/hal_tick_16b.c b/targets/TARGET_STM/hal_tick_16b.c index 1decea1295..7133b35e8a 100644 --- a/targets/TARGET_STM/hal_tick_16b.c +++ b/targets/TARGET_STM/hal_tick_16b.c @@ -118,6 +118,9 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 us tick TimMasterHandle.Init.ClockDivision = 0; TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; +#ifdef TARGET_STM32F0 + TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; +#endif HAL_TIM_Base_Init(&TimMasterHandle); // Configure output compare channel 1 for mbed timeout (enabled later when used) diff --git a/targets/TARGET_STM/hal_tick_32b.c b/targets/TARGET_STM/hal_tick_32b.c index f160b3fd51..fb5229d4e0 100644 --- a/targets/TARGET_STM/hal_tick_32b.c +++ b/targets/TARGET_STM/hal_tick_32b.c @@ -99,6 +99,9 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; #if !TARGET_STM32L1 TimMasterHandle.Init.RepetitionCounter = 0; +#endif +#ifdef TARGET_STM32F0 + TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; #endif HAL_TIM_OC_Init(&TimMasterHandle);