cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 STOP mode power consumption

gw
Associate II
Posted on September 11, 2014 at 20:16

Hi.

I've been trying to enter STOP mode in an STM32F401with:

PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);

When doing so, power consumption drops to 1.5mA so it's doing something. However, when I use the simple STOP example, I get something in the region of 0.05mA, which is obviously much better. So... Any ideas what's causing the increased power draw? I turn off the ADCs, but I am using USB. On STM32F1 I setCNTR_PDWN for USB, and I can see gccfg.b.pwdn - but there is no function available to reset it. Is that the problem?
6 REPLIES 6
gw
Associate II
Posted on September 11, 2014 at 20:27

Sorry for bothering you - I hacked up some code to change the registers myself, and it seems that got the power consumption down.

gw
Associate II
Posted on September 12, 2014 at 10:45

Is there actually a suggested way to power down USB for STOP mode (such that USB can wake the device from STOP), and also to re-enable it?

Just setting GCCFG.PWRDN to 0 and then flipping it back to 1 when the device wakes doesn't seem to work - you get low power when it sleeps, but then it hangs when it wakes back up.
chen
Associate II
Posted on September 12, 2014 at 13:03

Hi

''Is there actually a suggested way to power down USB for STOP mode (such that USB can wake the device from STOP), and also to re-enable it?''

Yes there is but I have not got it to work with the USB CDC device driver from ST.

I am waiting for help from ST. with their old STM periph Lib V2.1

You can either read the Reference manual for your device or read the manual for the old USB driver for info on getting the low power support.

Also, I think from memory - it works for sleep mode (which is what I was trying to get working) but I do not know if it works for Stop or Standby modes.

chen
Associate II
Posted on September 12, 2014 at 13:12

Just refreshed my memory from the STM32F4 ref manual :

''34.8 Power options

The power consumption of the OTG PHY is controlled by three bits in the general core

configuration register:

• PHY power down (GCCFG/PWRDWN)

It switches on/off the full-speed transceiver module of the PHY. It must be preliminarily

set to allow any USB operation.

• A-VBUS sensing enable (GCCFG/VBUSASEN)

It switches on/off the VBUS comparators associated with A-device operations. It must

be set when in A-device (USB host) mode and during HNP.

• B-VBUS sensing enable (GCCFG/VBUSASEN)

It switches on/off the VBUS comparators associated with B-device operations. It must

be set when in B-device (USB peripheral) mode and during HNP.''

All woefully unhelpful in my case because all this stuff should be handled by their driver but it did not work.

gw
Associate II
Posted on August 18, 2015 at 19:18

Just to add to this (as I still have the issue), you can get power consumption down much lower (260uA to 20uA in my case) by disabling just VBUSBSEN:

USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN;

However even after re-setting the bit, USB will no longer work.
gw
Associate II
Posted on August 18, 2015 at 19:40

Just to add to this, I was being stupid.

It now works - I just had to get the board to stay out of STOP mode long enough for a USB connection to be established!