2025-08-14 4:57 AM
Hi Community:
I'm working with an STM32F411C to control a stepper motor that requires 3 PWM signals with a 120° phase shift, using Master-Slave timer synchronization between TIM1, TIM3, and TIM4. The second channel is used to trigger the next timer. When the motor stops, I need to maintain a 20kHz PWM signal with a 75% duty cycle on one winding. Everything functions fine until I need to restart the timers in synchronized mode. I've tried using the HAL_TIM_PWM_Stop and Start pair without success. I also attempted to use DeInit functions and reconfigure the timers, but it's still not working. Any ideas on how to solve this would be greatly appreciated. Thank you!
2025-08-14 10:27 AM
You can use the force/release reset bits for the peripherals to get them to the initial hardware state. If you reinitialize the handles and restart the whole setup after that, it'll work.