cancel
Showing results for 
Search instead for 
Did you mean: 

TIM updated callback

HAL_GET_ANSWER
Associate

I am using 4 TIMs for updated interrupts functions. in the main while loop, I will call start the timer. and if the timer reaches its full-period and call the callback function. A Flag will be setted in the callback function and print a timeout meassage. The problem I found is the timeout will be triggerred in every powered on. Everytime I click reset MCU, it will first enter the callback function and print the "timeout message". Why this will happen and how to avoid this?

Thanks all in advance!

HAL_GET_ANSWER_4-1713101863062.png

HAL_GET_ANSWER_0-1713101653047.png  

HAL_GET_ANSWER_3-1713101830921.png

 

HAL_GET_ANSWER_1-1713101715552.png

 

2 REPLIES 2
Sarra.S
ST Employee

Hello @HAL_GET_ANSWER, welcome to ST Community, 

The callback is being fired automatically, as a test, you can reset the UIF flag in the SR register before calling the HAL_TIM_Base_Start_IT. 

Also, check this gotcha

I hope that helps!

 

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.

Sarra.S
ST Employee

Hello again @HAL_GET_ANSWER, any updates on this issue? 

 

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.