2014-09-11 11:16 AM
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?
2014-09-11 11:27 AM
Sorry for bothering you - I hacked up some code to change the registers myself, and it seems that got the power consumption down.
2014-09-12 01:45 AM
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.2014-09-12 04:03 AM
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.2014-09-12 04:12 AM
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.2015-08-18 10:18 AM
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.2015-08-18 10:40 AM
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!