Skip to main content
Associate II
Aug 12, 2025 8:47 PM UTC
Solved

Interrupt (with highest priority) sometimes takes longer

Dear all,

could need some advice how to continue debugging, IO am using an STM32F4

- TIM1 capture compare IR enabled with highest priority (even above Time Base)

BastelBaus_0-1755030863088.png

 

- c&c callback just toggles a PIN two times

inline void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim) {
 HAL_GPIO_TogglePin(DEBUG_PIN_GPIO_Port,DEBUG_PIN_Pin);
 HAL_GPIO_TogglePin(DEBUG_PIN_GPIO_Port,DEBUG_PIN_Pin);
 return;
}

- IR is called every 13us. However, sometimes the pin seams stuck for ~10us and then recovers.

BastelBaus_1-1755031290706.png

checking carefully, the next double toggle is also a bit late but the overall timing for the over next is fine.

So looks to me that something interrupts my interrupt and delays it. But what should this be if it has already highest priority ?

Any suggestions ?

 

BR,

BastelBaus

This topic has been closed for replies.
TDK
TDKBest answer
Aug 12, 2025 8:50 PM UTC

The highest priority is preemption priority 0.  7 is the lowest priority interrupt out of the ones you show.

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Aug 12, 2025 8:50 PM UTC

The highest priority is preemption priority 0.  7 is the lowest priority interrupt out of the ones you show.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
Aug 13, 2025 4:45 AM UTC

Oh man, sorry, I miss understood priorities .... Thanks a lot, I will try!