Skip to content

Commit dc225f3

Browse files
wdfk-progRbb666
authored andcommitted
[stm32] Fix Assertion Failure in HAL Library Due to Period=0 During PWM Initialization
Co-authored-by: wdfk-prog <[email protected]>
1 parent 3d72290 commit dc225f3

File tree

1 file changed

+1
-1
lines changed
  • bsp/stm32/libraries/HAL_Drivers/drivers

1 file changed

+1
-1
lines changed

bsp/stm32/libraries/HAL_Drivers/drivers/drv_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
374374
/* configure the timer to pwm mode */
375375
tim->Init.Prescaler = 0;
376376
tim->Init.CounterMode = TIM_COUNTERMODE_UP;
377-
tim->Init.Period = 0;
377+
tim->Init.Period = 1;
378378
tim->Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
379379
#if defined(SOC_SERIES_STM32F1) || defined(SOC_SERIES_STM32L4)
380380
tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;

0 commit comments

Comments
 (0)