Skip to main content
Visitor II
April 14, 2024
Question

TIM updated callback

  • April 14, 2024
  • 2 replies
  • 962 views

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

 

    This topic has been closed for replies.

    2 replies

    ST Employee
    April 15, 2024

    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!

     

    ST Employee
    May 7, 2024

    Hello again @HAL_GET_ANSWER, any updates on this issue?