2021-11-10 11:46 PM
CubeMX does no longer create the TIM1_UP_TIM10_IRQHandler in the stm32f4xx_it.c file after the timebase source have been changed to any timer and System tick timer 'Generate IRQ handler' and 'Call HAL handler' code generation has been disabled in NVIC.
Follow these steps to reconstruct the issue:
System in use: CubeIDE V1.7.0 with CubeMX V6.3.0
Create new project, choose STM32F429ZI (LQPF144) as processor (possible this also occurs with other MCUs, I only tried with MCU stated above)
Go to 'System Core' -> 'SYS' -> Change Timebase Source to 'TIM1' (Problem also occurs with TIM2, didn't test the other timers)
Save and generate code
In main.c, see that 'HAL_TIM_PeriodElapsedCallback' is generated
In stm32f4xx_it.c, see that 'TIM1_UP_TIM10_IRQHandler' is generated
Copy .ioc file for later inspection
Switch back to CubeMX
Go to 'System Core' -> 'NVIC' -> 'Code generation'
For 'System tick timer', diasble both chechboxes ('Generate IRQ handler' & 'Call HAL handler')
Save and generate code
In main.c, see that 'HAL_TIM_PeriodElapsedCallback' is still present
In stm32f4xx_it.c, see that 'TIM1_UP_TIM10_IRQHandler' has disappeared
View the previous copy of the .ioc file and the current .ioc file in an editor
The line 'NVIC.TIM1_UP_TIM10_IRQn=true\:15\:0\:false\:false\:true\:false\:true' has disappeared from the .ioc file. Copying the line manually in the new file has no effect, as it is erased after any new code generaton.
This might be a very unusual chain of action, but this procedure is required if you want to use a native FreeRTOS implementation (not the middleware provided by CubeMX) together with CubeMX.
You can work around this bug by generating the code with active SysTick handlers first, then copy the TIM1_UP_TIM10_IRQHandler from stm32f4xx_it.c and paste it in the user code section just below. Then disable SysTick timer interrupts and regenerate code. Timer Interrupt shoulb still exist in the user code section, while the section generated by CubeMX is lost.
Kind regards
Max
2021-11-11 12:20 AM
Hi @makas005 ,
Thanks for your feedback,
This issue is already reported to our development team to be reviewed and fixed as soon as possible.
I will keep you posted with the updates.
Regards,
Sara.