Skip to main content
Associate
June 3, 2025
Solved

Interrupt callback only work when hitting debug break point

  • June 3, 2025
  • 2 replies
  • 949 views

Hi, I was trying to implement timer interrupt on an ST32F407 Discovery board. The ST-Link on my board has been broken so I used an external ST-Link dongle and I have it connected by following this post:

https://electronics.stackexchange.com/questions/182763/how-to-use-an-external-st-link-v2-with-the-stm32f4-discovery-board 

I set up the timer so it will trigger interrupt once every 1s, but when I upload the code it does not go into interrupt. Only when I debug and put a break point in the callback function that it can execute the interrupt.

Here is a link to my code:

https://github.com/datcamap/DISCOVERYstm32.git 

Callback functionCallback function

 

This topic has been closed for replies.
Best answer by TDK

Don't check the SR value. The callback is called when the update event happens. The update flag is already cleared when the function is called.

2 replies

TDK
TDKBest answer
June 3, 2025

Don't check the SR value. The callback is called when the update event happens. The update flag is already cleared when the function is called.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DataDAuthor
Associate
June 3, 2025

Thank you so much, this solved my problem.