cancel
Showing results for 
Search instead for 
Did you mean: 

exit from stop mode

ybenharim10
Associate II
Posted on March 23, 2009 at 10:52

exit from stop mode

5 REPLIES 5
ybenharim10
Associate II
Posted on May 17, 2011 at 13:06

Is it possible to exit from stop mode with RTC seconds interrupt?

bissong
Associate II
Posted on May 17, 2011 at 13:06

Yes it is. Read the reference manual (the table 10 page 52 sum everything up).

But I have a question for those who use(d) the stop mode. I'm actually trying to use it on my MCBSTM32E eval board (MCU STM32F103ZE) woken up by RTC clock. I've found examples in my µvision installation folders. It seems to work til I enable the Systick timer. Indeed, in this case the stop mode is ignored and the systick interrupt happens as usual without any effect. In the example, the Systick is disabled before entering stop mode and re-enabled after. Why do we need to do so because in the table10 (still in RM page 52) it is said that the instruction is ignored if flags are not reset, but it is not the case here. I thought that by activating stop mode it would stop clocks and so the systick timer. Does anyone have this kind of trouble ?

Thanks in advance.

[ This message was edited by: bissong on 17-03-2009 13:58 ]

gdp123a
Associate II
Posted on May 17, 2011 at 13:06

It is possible to wake up from STOP mode using the ''RTC-alarm'' interrupt, but not with the ''RTC-seconds'' interrupt - well that's what I thought, but if someone can prove otherwise I would be very glad to hear it.

bissong
Associate II
Posted on May 17, 2011 at 13:06

Sorry I didnt understand that you wanted RTC second interrupt. Why don't you use RTC alarm set to happen every second ?

Concerning my prokect, I have one more question about the stop mode. I realized my code and tested it by simulation. I now want to test it on the MCU. But my Ulink2 Jtag adapter seems not to like sleep mode. Once I launch the program the ulink ''cannot access memory'' and ''the target dll has been cancelled - Debugger aborted''. I dont know what to do. I've faced the same problem with the simple __WFI().

After that I cannot download another program into my memory without changing boot mode...

Thanks for any advice.

bissong
Associate II
Posted on May 17, 2011 at 13:06

I insist with my problem but I'm really stuck and I don't know where to look at to find the solution. The thing that bothers me most is that even the stop mode example given by ST (the one given with the keil dev. suite) does not work properly on my board.

The thing I realized is that in simulation : when the RTC_SetAlarm function is called, the counter value in RTC is reset !

But in in-circuit debug mode : the counter is not reset.

Moreover, in this last mode, even tough I configure the Alarm and then clear the counter (or set the alarm like this : RTC_SetAlarm(RTC_GetCounter()+ 3)) the counter value goes randomly when I enter stop mode. I dont know why ! And if I put a huge value to be sure that the counter will reach it, I can see that the flag is set but the interrupt does not happen. I hope someone knows what goes wrong on my board.

Thanks in advance.