Skip to main content
RN_it
Associate III
August 4, 2018
Solved

Timer interrupt does not wake up the processor

  • August 4, 2018
  • 3 replies
  • 1277 views

Hello,

I am using timer 6 and generating interrupts for every 1s.

it works fine when i dont enable the sleep on exit feature.

but if i enable sleep on exit feature, after the first timer interrupt , processor goes to sleep and the next timer interrupt unable to wake up the processor. the timer isr doesnt run. Please help

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

    Hi Thank you

    Actually i found out the issue,

    before starting the timer , i made TIM6->SR = 0 ,

    so, basically whats happening was , before going to sleep , some spurious interrupts of TIM6 triggered and after exit processor went to sleep without starting the timer.

    3 replies

    Tesla DeLorean
    Guru
    August 10, 2018

    "STM32" covers hundreds of parts over dozens of families, please try to be specific. Perhaps even provide code you're actually trying so specific issues can be identified, or staff can actually compile and check.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Khouloud GARSI
    Technical Moderator
    August 10, 2018

    Hello @RN​ ,

    Please make sure to enable the Timer6's clock during Low Power (Sleep) mode:

    __HAL_RCC_TIM6_CLK_SLEEP_ENABLE();

    Khouloud.

    RN_it
    RN_itAuthorBest answer
    Associate III
    August 11, 2018

    Hi Thank you

    Actually i found out the issue,

    before starting the timer , i made TIM6->SR = 0 ,

    so, basically whats happening was , before going to sleep , some spurious interrupts of TIM6 triggered and after exit processor went to sleep without starting the timer.