STM32F0x1 Sleep Mode Conundrum

Any time I ask a really specific question here it always seems to go by the wayside. But what the heck -- it's Friday, it's late, and my @#$% processor won't go to sleep!!!

Anyone have any mileage with the ST Arm Cortex parts and sleep mode? I've got a STM32F303 that doesn't really need it that goes to sleep beautifully, and I've got an STM32F051 in an application where low power is critical that isn't going to sleep at all!!!

I'm calling the "wfe" instruction, I've tried calling the "wfi" instruction instead, and got no difference. I've dug through the manuals for the past two hours looking for that magic "oh, by the way, you need to setorclear this magic bit", all to no avail.

So, any help is appreciated. Even wild-ass suggestions, as long as they come from the ARM Cortex world.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott
Loading thread data ...

Is the SLEEPONEXIT bit set by chance?

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de 

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt 
 Click to see the full signature
Reply to
Uwe Bonnes

I am not setting it, but I'll check its state the next time I'm in the room with the board and report back here. I assume it should be zero -- yes?

--
Tim Wescott 
Control system and signal processing consulting 
 Click to see the full signature
Reply to
Tim Wescott

I have had success with the 152 part using ST's library function:

PWR_EnterSTOPMode( PWR_Regulator_LowPower, PWR_SLEEPEntry_WFI );

The 152 is an M3 part, your 303 is an M4, so there may be differences on the 051, which is an M0. Is there an equivalent library function that you could use as a reference for the 051? Ultimately it comes down to calling the WFI instruction within the library function, but it may include some chip specific code prior to the WFI instruction itself.

If it helps the low power specific parts that use the above reference library function can be found in the source file STM32L_low_power_tick_management.c of the demo documented on the following page:

formatting link

Regards, Richard.

  • formatting link
    Designed for microcontrollers. More than 107000 downloads in 2013.

  • formatting link
    IoT, Trace, Certification, FAT FS, TCP/IP, Training, and more...

Reply to
FreeRTOS info

demo.html

I found their STM32F0xx library, and looked at the function you mention

-- all it does is to clear or set SLEEPDEEP depending on whether you want sleep or stop, then call your choice of WFI or WFE.

So, no dice. But at least I know that I'm doing what ST intends.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

How odd. It seems to be connected with having the system tick clock enabled. I had inadvertently left in some code that runs that.

My power consumption is still about two orders of magnitude above what I want, but I think that's a board problem, not the processor.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

And for some strange reason I need two in a row. And not WFE followed by a NOP -- it wants two WFE instructions in a row.

Ah, the ways of the ARM are mysterious.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

Tim Wescott wrote: ...

Any floating lines? They draw much unwanted current.

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de 

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt 
 Click to see the full signature
Reply to
Uwe Bonnes

I found some, and figured out the magic finger-ring combination to go really to sleep. I'm down to 250uA at this point, but I'd like to get lower still.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

errata says something about excess current for analog pins on certain packages

"Additional current consumption in the range of tens of ?A per pin can be observed if VDDA is higher than VDDIO"

--

John Devereux
Reply to
John Devereux

Already noted, not an issue. I am using the ADCs, but VDDA is tied do VDDIO. The application is such that the measurement process goes 1: everything stops, 2: the ADCs get sampled.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

Come on, tell us what is needed!

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de 

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt 
 Click to see the full signature
Reply to
Uwe Bonnes

It's in another post -- I had the systick clock running, which apparently preempts trying to turn off the core.

And for some bizzare reason I need to call WFE twice in a row. I don't know why -- but it's working now.

--
Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.