cancel
Showing results for 
Search instead for 
Did you mean: 

USB over current (OTG_FS_OC) - how should application respond?

BMcDo.3
Associate III

I have an application with STM32F4 OTG configured as USB Host, MSC, using ST's USB Host middleware and FatFS. How should it respond to rising and falling edges on the OverCurrent signal, such as pictured below (from the STM32F429I-DISC1 schematic)?

 

BMcDo3_0-1740579195752.png

 

CubeMX config:

BMcDo3_1-1740580311315.png

 

4 REPLIES 4
TDK
Guru

The USB spec requires that power is cut in response to an overcurrent condition.

If you feel a post has answered your question, please click "Accept as Solution".
BMcDo.3
Associate III

Which USB spec and what section? If you know.

How would I cut the power? Release the EN' pin on the STMPS2141STR (set OTG_FS_PSO high)? Does the STMPS2141STR not protect itself and recover sufficiently without this? If I disable the STMPS2141STR, how do I know when it's safe to re-enable? Would I have to just periodically try enabling it again, and check its FAULT' pin (OTG_FS_OC) status?

What about handling the failure in the application, and disabling and potentially resuming USB & MSC operation, without rebooting?

How would I cut the power?

Check the datasheet of your USB power switch: it can cut the output power automatically while providing the over-current signal. Toggle the OTG_FS_PSO signal to not active state, check if the overcurrent signal goes off. If it does, delay for few seconds and retry. If overcurrent signal stays active, there's a problem ((

 

 

Depends how you're powering it. If you're using STMPS2141STR, pulling the EN line low will work.

> Does the STMPS2141STR not protect itself and recover sufficiently without this?

Most LDOs and drivers have overcurrent protection, but the spec says you have to cut power, so you have to cut power.

> what section?

Download the largest USB spec PDF and search for "OVER_CURRENT".

 

> What about handling the failure in the application, and disabling and potentially resuming USB & MSC operation, without rebooting?

Pretty sure the spec calls out the recovery steps. Waiting 1 second and retying seems fine. If overcurrent still exists, maybe cut power until a power cycle.

If you feel a post has answered your question, please click "Accept as Solution".