STM32G0 CubeMX Code Incorrect config for Timers (CubeIED V1.16.0)
I just spent several days (luckily not full time) failing to get a simple PWM output working. I could get it working using the HAL drivers, but not able to get it working with the LL drivers. After spending most of my time assuming it was user error I finally resorted to full register dumps of the Timer registers comparing the HAL code vs the LL code and found the discrepancy.
In the LL-code, somehow the MX_TIM17_Init() generated by CubeMX clears the MOE bit in the BDTR register, disabling outputs even though I have break mode disabled in the UI. Generating HAL code with exactly the same settings correctly sets the MOE bit.
This seems to be a bug. After isolating the issue, it was a simple case of adding the call
LL_TIM_EnableAllOutputs(TIM17) ;
to my code to enable outputs and all is well. Double checking all the LL examples, there are no calls to the above routine, so don't think it is expected.
Did I miss something somewhere or is this a CubeMX bug?
will
