cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup from timer interrupt

genadyk
Associate II
Posted on January 24, 2013 at 17:54

Hi all

I  am using STM32  and trying to make the  periodic  wake up  of the CPU from low power sleep mode , by interrupt from TIMER 9 , and I see the following strange behavior:

I    succeeded to wake up the CPU from low power sleep mode  by  timer interrupt , only once . After that the CPU remains in sleep mode

When I am working without entering to sleep  mode , the timer works ok .

#tim #stm32
5 REPLIES 5
Posted on January 24, 2013 at 18:50

Which STM32 part?

Post a concise code fragment that illustrates the problem.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
genadyk
Associate II
Posted on January 27, 2013 at 12:46

Posted on January 27, 2013 at 15:05

I think I understand where is a problem . I call to PWR_EnterSleepMode from ReconfigTimer function . First time I call from main function body. But after that , I always call it from TIM3_IRQHandler . When I move the PWR_EnterSleepMode from interrupt to main, everything is working.

 

 

Probably , its not allowed to call the PWR_EnterSleepMode from interrupt context

Yes, I would definately not try to do a WFI before the core had exited the interrupt. The NVIC doesn't permit re-entrant behaviour in this fashion.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pnk003
Associate
Posted on March 22, 2013 at 08:03

Dear kagan.genady.

I am developing RFID reader/tag using STM32L152VBT6 and CC1101 using SPI interface.

The RFID tag has the following wakeup/sleep functions (''sleep state'' or ''low power run state'').

Wakeup #1)

The tag wakes up for every 2.45 second, and checks the wakeup packet from reader.

If the tag does not receive any packet from reader for some time, tag enters sleep mode for 2.45 second.

Wakeup #2)

If tag receives a read packet from reader, tag responds a response packet,

After receiving a sleep packet from reader, tag enters sleep mode for 2.45 second.

I am novice at firmware programming.

If it is possible, May I get example source code and materials to implement the above functions?

Thank you very much in advance.

Sincerely Yours,

Ick-Sung Choi.

E-mail :

mailto:ischoi@dau.ac.kr

,

mailto:pnk003@daum.net

.