cancel
Showing results for 
Search instead for 
Did you mean: 

Program does not run on STM32f407VET - CubeIDE not generating timebase IRQ handler for different timebase source.

JulioCalandrin
Visitor

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 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @JulioCalandrin 

I'm currently investigating this behaviour.i will get back to you as soon as possible.

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.