Skip to main content
RN_it
Associate III
Aug 4, 2018 5:47 AM UTC
Solved

Timer interrupt does not wake up the processor

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.
    RN_it
    RN_itBest answer
    Associate III
    Aug 11, 2018 5:20 AM UTC

    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
    Aug 10, 2018 1:23 AM UTC

    "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 Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Khouloud GARSI
    ST Employee
    Aug 10, 2018 2:43 PM UTC

    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
    Aug 11, 2018 5:20 AM UTC

    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.