Closed ajitbasarur closed 2 years ago
Hi @ALABSTM,
Thanks for looking into the issue. I have noticed that you have included the issue in stm32cube-mcu-fw-dashboard . Shouldn't the issue be included in stm32cube-mcu-hal**-dashboard?
Best Regards, Ajit B
Hi @ajitbasarur,
The PWM_Stop() is necessary to ensure a correct system behavior. Indeed, the configuration can't be updated since the channel is activated. Changes on the fly are not allowed unless the channel is stopped. The driver has been implemented in the way to respect this sequencing. Control and configuration are separately managed to avoid any system misbehavior. Hence, the correct sequence to deploy is :
PWM_Config() --> PWM_Start() --> PWM_Stop() --> PWM_Config() --> PWM_Start() ...
Unfortunately, you request can't be accepted, so please allow me to close this thread. Thank you for you comprehension.
With regards,
But what's the technical limitation to do this? I could just modify the duty register directly.
I have the same issue on F401 HAL.
Describe the set-up
Bug The function PWM_Config() does not reset the timer channel state to HAL_TIM_CHANNEL_STATE_RESET although it disables the channel.
Describe the bug
How To Reproduce
Workaround Solution In the application, one can explicitly check the state of each timer channel by using the following code TIM_CHANNEL_STATE_GET(htim, Channel). If the timer channel state is busy, then call the PWM_Stop() function before reconfiguring the timer channel. PWM_Config() --> PWM_Start() --> PWM_Stop() --> PWM_Config() --> PWM_Start(). This works. This workaround should be part of the HAL Timer library.
Proper Bug Fix if PWM_Config() is called, then check the status of PWM output. There are two possible implementations.
Best Regards, Ajit B