Skip to main content
Associate II
November 21, 2025
Solved

TIM2 Interrupt deleted when setting EXTI[9:5] interrupt

  • November 21, 2025
  • 1 reply
  • 231 views

Hi all,

I am using a nucleo board F412ZG with the Middelware FreeRTOS. I use only one task for now, but I will use others in future.

By the way, I set TIM2 as the timer system for FreeTOS:

Fin95_0-1763709845906.png

Now I am trying to enable pin PC8 as an external interrupt in order to detect a falling edge:

Fin95_1-1763709938606.png

Fin95_2-1763709987678.png

Fin95_3-1763710041206.png

 

When I generate the code I notice that the TIM2 interrupts is deleted, but I do not understand why. Anyone can help me?

Below I leave the screens of the generated code modifies from git:

 

Fin95_5-1763710352417.pngFin95_6-1763710373818.png

Fin95_7-1763710386237.png

 

 

 

 

 

Best answer by Ghofrane GSOURI

Hello @Fin95 

You are using STM32CubeMX 6.14.1 , I recommend you to migrate to the latest version of CubeMX 6.16.0 .

GhofraneGSOURI_0-1763712723077.png

When you configure FreeRTOS to use TIM2 as the tick timer (instead of the default SysTick), CubeMX takes control of the TIM2 interrupt for the RTOS kernel. This means: CubeMX will generate the TIM2 interrupt handler (TIM2_IRQHandler) in stm32f4xx_it.c as shown below

GhofraneGSOURI_1-1763713630277.png

THX

Ghofrane

 

1 reply

Ghofrane GSOURI
Technical Moderator
November 21, 2025

Hello @Fin95 

I'm currently checking this behavior . I will get back to you asap.

Could you please provide your IOC?

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.
Fin95Author
Associate II
November 21, 2025

Hi @Ghofrane GSOURI,

of course! I will attach it to this message.

Thanks a lot!

 

Alberto

Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
November 21, 2025

Hello @Fin95 

You are using STM32CubeMX 6.14.1 , I recommend you to migrate to the latest version of CubeMX 6.16.0 .

GhofraneGSOURI_0-1763712723077.png

When you configure FreeRTOS to use TIM2 as the tick timer (instead of the default SysTick), CubeMX takes control of the TIM2 interrupt for the RTOS kernel. This means: CubeMX will generate the TIM2 interrupt handler (TIM2_IRQHandler) in stm32f4xx_it.c as shown below

GhofraneGSOURI_1-1763713630277.png

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.