AnsweredAssumed Answered

STM32F4 extra power consumption in STOP mode due to USB

Question asked by VDM on Aug 17, 2017
Latest reply on Aug 18, 2017 by Ben K

Hi,

 

I'm using USB with SPL on an STM32F4 system.

 

If I do this :
while(1)

{

   PWR_EnterUnderDriveSTOPMode(PWR_LowPowerRegulator_UnderDrive_ON, PWR_STOPEntry_WFI);

}

 

Then my system power consumption is 1.6mA.

 

But if I do this :

USBD_Init(&USB_OTG_dev,USB_OTG_FS_CORE_ID,&USR_desc, &USBD_CUSTOMHID_cb, &USR_cb);

while(1)

{

   PWR_EnterUnderDriveSTOPMode(PWR_LowPowerRegulator_UnderDrive_ON, PWR_STOPEntry_WFI);

}

 

Then my system power consumption is 2.4mA.

 

It clearly appears that the USB initialisation increases power consumption in STOP mode.

I've noticed that this extra power consumption is due to "GCCFG->PWDRWN" bit and USBCFG->FDMOD and SRPCAP bits.

 

After a USB initialisation, if I reset these bits to 0 thanks to the debugger, then I got back my 1.6mA in STOP mode.

But I'm not able to reset these bits programmatically.

 

USB_OTG_WRITE_REG32 (USB_OTG_dev.regs.GREGS->GUSBCFG, 0x00001440); <= does nothing (the value 0x00001440 is the same value as when I reset the SRPCAP and FDMOD bits manually with the debugger).

 

Any clue how to properly reset the USB to its default reset state ?

Any reason of this extra power consumption in STOP mode ?

 

Thanks.
Best regards,

Vincent.

Outcomes