Dynamically change PWM frequency with interrupt with STM32
The problem was related to the preload registers.
As mentioned in en.DM00236305.pdf they are needed in order to have a perfect timing between UEV and register correct loading