2025-09-18 1:15 AM - edited 2025-09-18 3:29 AM
Issue 1:
file: hall_speed_pos_fdbk_sixstep.c
function: HALL_TIMx_CC_IRQHandler()
line: 393
The prescaler is affected when UEV is generated by the function SixStep_StepCommutation().
This function is called immediately after the prescaler is set,
so the prescaler value is applied in the current loop, not in the next loop.
Therefore, the prescaler does not need to be incremented by +2;
incrementing by +1 is enough.
Issue 2:
file: stm32g0xx_mc_it.c
function: TIM2_IRQHandler()
line: 148
When the prescaler is changed, it is affected by the update event, which is generated in software during commutation.
If a phase shift is set, the update event is generated with a delay.
As a result, the counter may run with two different prescaler values.