We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi
I am using a ARM GCC tool chain 4.7
My platform is a Cortex M3 based platform and we use a low power state
In this low power state
voltage of CM3 is reduced to 1.08 and all peripherals except RTC is put in self retaintion.
RTC and a GPIO pin are only 2 sources of wakeup.
When I compile the code with ARM GCC 4.7.4 and run low power case
wakeup does not occur
Any idea what has changed in the compiler chain.
When optimization level si set to Os it does not work
But when O0 optimization is used code works and low power wakeup occurs.
Hi neo11
I'm sorry for the late answer; I haven't come across your question before now, so you probably have found the answer.
It's a bit difficult to say what's going on in the code, but if you could provide disassembly of the code parts that has to do with the wake-up (for instance setting up the wake-up at initialization, it might be possible to find out.
It could also be helpful to know which microcontroller model you're using.
The problem is very likely in the code, not the compiler. If the code is written correctly, the compiler should not cause it to malfunction.
Make sure that you've used volatile wherever necessary; be careful when using loops for short delays (if you do so, you must also use volatile, and the timing of such loops in C cannot be guaranteed).