Skip to main content
Explorer II
June 10, 2022
Solved

HAL_TIM_PeriodElapsedCallback freezes when adding some content

  • June 10, 2022
  • 4 replies
  • 898 views

I am getting desperate trying to solve this issue.

When I add some content to HAL_TIM_PeriodElapsedCallback the main loop gets frozen but still continue receiving call on HAL_TIM_PeriodElapsedCallback.

Could somebody help me out with this? I have been dealing with this issue for almost 3 days and don't know what could be the problem I have tried changing the priorities of the timers, prescales, moving functionality out of the timers IRQ handlers...

Thanks in advance.

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

    Never mind! Solved! It was a library imported from another project which was modifying the registers of one of the timers used on my project! It was driving me crazy... Thanks for the help anyway :)

    4 replies

    Super User
    June 10, 2022

    Try decreasing the interrupt rate, i.e. increase (significantly - 10x or even more) TIMx_ARR or TIMx_PSC.

    JW

    RPGAuthor
    Explorer II
    June 10, 2022

    I tried by x10, x100 and x1000 and same thing. :(

    RPGAuthor
    Explorer II
    June 10, 2022

    Have also tried with several combinations changing the priority but nothing.

    RPGAuthorAnswer
    Explorer II
    June 10, 2022

    Never mind! Solved! It was a library imported from another project which was modifying the registers of one of the timers used on my project! It was driving me crazy... Thanks for the help anyway :)