PWM TIM update IRQ Crashing after upgrading to 6.4.1 ADC fails to synchronize ? Race condition ?
- February 11, 2026
- 1 reply
- 403 views
During Startup,
after
MX_NVIC_Init();
when it jumps into
/* USER CODE BEGIN 2 */
The code is interrupted by
TIMx_UP_M1_IRQHandler()
in its routine,
(void)R3_2_TIMx_UP_IRQHandler(&PWM_Handle_M1);
the code gets stuck at
/* We can not change OPAMP source if ADC acquisition is ongoing (Dual motor with internal opamp use case) */
while (0x0u != pHandle->pParams_str->ADCDataReg1[pHandle->_Super.Sector]->JSQR)
{
/* Nothing to do */
}I'm not able to understand why this is happening. I have not initialized any custom ADC (RCM) yet.
Everything that has run, until that point is generated code only.
With some research I have understood that the TIM1 update routine is infinitely waiting for the ADC(Injected Conversion) to finish.
Is this some kind of race condition ?
This doesn't happen always on every boot/startup. Only randomly, some times.
If it does not crash at this point, I have not observed it to crash at a later point of time.
Am I supposed to something differently in this version of sdk ?
At least, how can I work around this temporarily ?
I upgraded to 6.4.1 from 6.2.1 , and I started facing this.
ST 'SPIN' package G4 - custom board
Single Motor Drive , 3 shunt config.
