cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt callback only work when hitting debug break point

DataD
Associate

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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".

View solution in original post

2 REPLIES 2
TDK
Super User

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".

Thank you so much, this solved my problem.