For the STM32G031 and STM32G030 (maybe other G0 mcu too) there is an errata:
Code: Select all
2.5.5 TIM16 and TIM17 are unduly clocked by SYSCLK
Description
The timers TIM16 and TIM17 are unduly clocked by SYSCLK instead of being clocked by the timer clock
TIMPCLK. As a consequence, they do not reflect AHB and APB prescaler settings.
The TIM16 and TIM17 are fully functional as long as the SYSCLK-to-PCLK frequency ratio remains smaller than
or equal to four.
This fact is not taken into account, so in my project the frequency of timer TIM17 is set incorrectly, when I set the STM32_PPRE bigger then 2.