cancel
Showing results for 
Search instead for 
Did you mean: 

B-U585I-IOT02A USB Host problem

milorad
Associate II

I'm using BSP driver for USB PD (TCPP03-M20) on the B-U585I-IOT02A, for initialization of the USB PD as USB Host I use the following code:

BSP_USBPD_PWR_Init (USBPD_PWR_TYPE_C_PORT_1);
BSP_USBPD_PWR_SetRole (USBPD_PWR_TYPE_C_PORT_1, POWER_ROLE_SOURCE);
BSP_USBPD_PWR_SetPowerMode(USBPD_PWR_TYPE_C_PORT_1, USBPD_PWR_MODE_NORMAL);
BSP_USBPD_PWR_VBUSInit (USBPD_PWR_TYPE_C_PORT_1);
BSP_USBPD_PWR_VBUSOn (USBPD_PWR_TYPE_C_PORT_1);

what I don't understand is, why when I connect an USB stick to the USB Type-C connector an over-current event (OCP VBUS) is detected by the TCPP03-M20 chip, and then after sending a recovery word the voltage on the Vbus line is provided again by the TCPP03-M20 chip and operation continues as normal?

Why is the OCP event happening?

Is there a way to avoid it?

3 REPLIES 3
FBL
ST Employee

Hi @milorad 

You may need to provide better details about your project configuration. It seems like you didn't activate _VCONN_SUPPORT.

By integrating the BSP_USBPD_PWR_VCONNDischargeOn and BSP_USBPD_PWR_VCONNIsOn functions, you can effectively manage VCONN discharge and status checks based on the current hardware conditions and events. 

//Activate VCONN discharge on detachment 
if (BSP_USBPD_PWR_VCONNDischargeOn(PortNum) != BSP_ERROR_NONE)

// Check VCONN status on attachment 
if (BSP_USBPD_PWR_VCONNIsOn(PortNum, USBPD_PWR_TYPE_C_CC1, &vconnState) == BSP_ERROR_NONE)

 This helps ensure proper operation and power management for USB Type-C devices and avoid OCP.

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.

Hi @FBL ,

thanks for answering.

In my situation I have B-U585I-IOT02A board, and I'm trying to use it as an USB Host via the USB Type-C connector.

I configure it as mentioned in my first post and when I connect an USB memory stick to the USB Type-C connector, the OCP event is detected by the TCPP03 chip.

That causes VBUS to be disabled by the TCPP03 chip and after calling :

BSP_USBPD_PWR_EventCallback(USBPD_PWR_TYPE_C_PORT_1);

which sends the recovery word to the TCPP03 the VBUS is again provided and everything works normally.

What I would like to avoid is to get this OCP event when the stick is connected as that should not in general trigger an OCP event.

What you are describing is actually for handling a disconnection of the USB device, I actually did not see any problems at disconnection, no event is triggered.

It might be some setting of the TCPP03 that is missing or hardware for fault detection on this board results in OCP on connection?

 

FBL
ST Employee

Hi @milorad 

The Vbus capacitance of USB stick may not be compliant with USB standard (too high). Here are some workarounds:

  1. Accept the first OCP and restart. The USB stick Vbus capacitor is charged and there is no more OCP.
  2. Or, try to increase VBUS OCP threshold by reducing shunt resistor. 7mOhm is the default value --> 6A

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.