cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX not generating timebase IRQ handler for different timebase source.

JulioCalandrin
Associate

Hello!

I attempted running a basic FreeRTOS example on a STM32F407VET6 board using CMSIS v2 following some tutorials, replacing systick for either TIM 6 or 7 as HAL Timebase as many tutorials suggest. The code only blinks and LED on the pre-generated task.

I could never get the program to work and by pausing execution I noticed it went straight to the default handler infinite loop. After reading a few posts it seems that the CubeIDE still does not generate the appropriate timer IRQ Handler within the stm32xxxx_it.c file and has to be added manually, as suggested by @Curtis B. on the posts attached bellow.

 

void TIM7_IRQHandler(void)
{
/* USER CODE BEGIN TIM7_IRQn 0 */
 
/* USER CODE END TIM7_IRQn 0 */
HAL_TIM_IRQHandler(&htim7);
/* USER CODE BEGIN TIM7_IRQn 1 */
 
/* USER CODE END TIM7_IRQn 1 */
}

 

Adding the IRQHandler fixes the issue but it is a bit frustrating that many tutorials follow the same steps and rarely mention this, since it usually works fine with other MCUs. I actually tested the same workflow for a STM32H773IIT6 board and for that MCU it worked perfectly, the IRQ handlers for the timer are generated and updated automatically by CubeIDE.

I have come accross two other posts that had simillar issues to what I'm facing:
https://community.st.com/t5/stm32cubemx-mcus/stm32h755-haltick-timer-and-freertos-problem-with-code/td-p/247812/page/2

https://community.st.com/t5/stm32cubeide-mcus/freertos-doesn-t-working-when-generated-from-cube/td-p/311618and 

The original posts are from 2020, but the problem persists on some microcontrollers. I tested on both CubeIDE v.1.18 and v.1.19. Has this been reviewed in the newest versions of CubeMX?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

Hello @JulioCalandrin 

I have performed a test with the latest version of STM32CubeMX 6.17.0, and it is working as expected.

GhofraneGSOURI_0-1778229618451.png

I highly recommend updating to the latest versions: STM32CubeMX 6.17.0 and STM32CubeIDE 2.1.1.

PS : STM32CubeMX 6.17.0 is no longer integrated into STM32CubeIDE 2.1.1. Instead, the two tools are now interoperable.

For more details , please check the following LINKs:

STM32CubeMX download Link:STM32CubeMX | Software - STMicroelectronics

STM32CubeIDE 2.0.0 workflow tutorial - STMicroelectronics Community

STM32CubeIDE 2.0 release - early heads-up! - STMicroelectronics Community

THX

Ghofrane 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @JulioCalandrin 

I have performed a test with the latest version of STM32CubeMX 6.17.0, and it is working as expected.

GhofraneGSOURI_0-1778229618451.png

I highly recommend updating to the latest versions: STM32CubeMX 6.17.0 and STM32CubeIDE 2.1.1.

PS : STM32CubeMX 6.17.0 is no longer integrated into STM32CubeIDE 2.1.1. Instead, the two tools are now interoperable.

For more details , please check the following LINKs:

STM32CubeMX download Link:STM32CubeMX | Software - STMicroelectronics

STM32CubeIDE 2.0.0 workflow tutorial - STMicroelectronics Community

STM32CubeIDE 2.0 release - early heads-up! - STMicroelectronics Community

THX

Ghofrane 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.