cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 USB low power stop

kobus
Associate II
Posted on May 20, 2016 at 16:47

I am porting an existing design from an F107 to a L4 micro in the hopes that I can push sleep current below 50uA.

Currently I have only one barrier to achieving this low power: the USB device peripheral. No matter What I do, once the USB has been initialised, I can't get stop1 current below ~200uA.  

I have tried calling USBD_DeInit and USBD_Stop before stopping, but this only got me down to the 200uA. I have seen some forum posts (

/c8dfa70e

) related to the F4 saying that VBus sensing can account for this, but I have checked and the GCCFG register is completely reset after DeInit.

Does anyone have any ideas? I an using the latest Cube L4 HAL libraries, V1.4.    

#pull-up #stm32l4 #stm32l4 #usb #usb #power #stm32cube #pull-down
16 REPLIES 16
Amel NASRI
ST Employee
Posted on May 23, 2016 at 18:24

Hi goosen.kobus.001,

Are you using a dedicated power supply for USB as recommended in

http://www.st.com/content/ccc/resource/technical/document/application_note/9e/9b/ca/a3/92/5d/44/ff/DM00148033.pdf/files/DM00148033.pdf/jcr:content/translations/en.DM00148033.pdf

?:

Several independent supplies (VDDA, VDDIO2, VDDUSB), can be provided for specific peripherals, thus removing the constraint to supply all product at high voltage when analog or USB functions are used.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

kobus
Associate II
Posted on May 24, 2016 at 09:00

Thanks for replying. on my board the VDDUSB is directly connected to 3.3V. I don't think this is necessarily a big deal, because before the USB is configured I can get down into single uA's even though its connected, so the fact that its connected to power surely couldn't be the problem... 

What I can say is that the VDDUSB seems to be enabled and disabled by the L4 USB HAL libraries: in the HAL_PCD_MspInit/DeInit functions int he USBD_conf file, it calls HAL_PWREx_EnableVddUSB() / HAL_PWREx_DisableVddUSB(), so I would think this is not the issue...

In any case if the power draw can be low before the USB is initialised, surely the problem was caused by code, and could hopefully be undone in code (unless thePWR_CR2:USV bit, or something else, cannot be cleared once set??).      

I have read through the errata sheet, but nothing there stands out.

I appreciate the help. Any other ideas?  

kobus
Associate II
Posted on May 26, 2016 at 09:25

Anyone have any ideas? For the sake of sanity I have tested this with another device and can confirm that its the same.  

kobus
Associate II
Posted on May 31, 2016 at 08:27

Anyone?

gafsos
Associate II
Posted on June 01, 2016 at 17:05

Beacuse L4 Has an internal pull up (1.5K) and  Host pull down (15K)

16.5 K draws ~200uA

kobus
Associate II
Posted on June 02, 2016 at 16:29

Thanks Abdul, this makes sense. Ilight of your comment I searched through the reference guide a bit more. From what I can tell the pull ups/downs are controlled automatically based on the core state.

There is a bit (OTG_DCTL.SDIS) which handles the soft disconnect which removes the DP pull-up, however this is ultimately set in the 'USBD_Stop' function, which still does not fix the issue. This indicates that if a resistor is the issue, its the host pulldowns. This makes sense as 3.3V/15k is definitely closer to the 220uA I'm seeing.

Do you know of a way to forcibly turn off all the pull resistors?

Interestingly, I have found when the USB is DeInitialised (or any time the PWR_CR2_USV bit is cleared), the current does go down, but within about 2 seconds the current rises again to about 350uA (worse than when the USB is suspended). this tells me that there is probably something like an internal pull resistor bleeding current into the USB hardware blocks.

I thought this might be due to the pins still being connected to the USB, but changing them does nothing, and indeed DeInit also DeInits the pins, which does nothing.

Seeing as the OTG core is controlling the pull resistors, I'm going to reconfigure my USB device to use bus sensing, and fiddle with the voltage on the Vbus pin and see what happens.    

   

I'll let you know the results.   
kobus
Associate II
Posted on June 15, 2016 at 09:22

Just to give a bit of feedback, for the time being I've rigged a check up in my code that prevents the USB subsystem from being initialised until the system voltage is >4.3V. 

In my design the system voltage will either come from a lithium battery (3~4.2V) or from the bus voltage, so this hack has worked reasonably well.

In general I reset my micro after a few minutes of inactivity, os if it were to be plugged into a USB, it would only draw 240uA for a short period. Not perfect, but quite acceptable. 

While this system works, I would still like to know if anyone has managed to return the USB system into a low power state.

Also, if anyone has used USB in a low power application, i'd like to know how they went about it.

My hardware is mostly fixed, but I suppose the correct thing to have done would have been to make sure the VDDUSB pin was only powered when the USB bus was connected? 

Posted on March 16, 2017 at 10:08

Good morning,

Now I'm facing similar current consumption with same device: around 220uA in Stop1 mode when current consumption should be around 7uA (with RTC). How did you solve that? (maybe disconnecting VDD-USB)...

Regards.

Posted on August 28, 2017 at 12:24

Hi,

I have the same problem but with STM32L432 device that has not VDDUSB pin, so I can't disconnecting this voltage that is wire connected (inside the component) to VDD. If you or anyone have a suggestion is very appreciated.

Regards.