cancel
Showing results for 
Search instead for 
Did you mean: 

How to make STUSB4500 negotiate PDO2 automatically?

KPage.1
Associate

My schematic is exactly as shown on page 26 of https://www.st.com/resource/en/datasheet/stusb4500.pdf with an ESP32 connected to the I2C pins and a BQ2057WSN downstream on Vsnk. However, on connection to USB-C the chip negotiates an explicit 5V power contract (verified with a PD sniffer) instead of the 9V specified in PDO2/PDO3. If I run a trivial sketch on the microcontroller that does nothing at all other than connecting to the chip over I2C and issuing a soft reset then the STUSB4500 again starts out at 5V, but then correctly renegotiates to 9V.

I need the STUSB4500 to function autonomously so that my device can charge without power to the microcontroller. What am I missing?

If it helps, when I run the ReadParameters example from the SparkFun libraries at https://github.com/sparkfun/SparkFun_STUSB4500_Arduino_Library the output I get is:

Connected to STUSB4500!
PDO Number: 2
 
Voltage1 (V): 5.00
Current1 (A): 1.00
Lower Voltage Tolerance1 (%): 0
Upper Voltage Tolerance1 (%): 20
 
Voltage2 (V): 9.00
Current2 (A): 1.50
Lower Voltage Tolerance2 (%): 10
Upper Voltage Tolerance2 (%): 10
 
Voltage3 (V): 9.00
Current3 (A): 1.50
Lower Voltage Tolerance3 (%): 10
Upper Voltage Tolerance3 (%): 10
 
Flex Current: 5.32
External Power: 0
USB Communication Capable: 0
Configuration OK GPIO: 0
GPIO Control: 1
Enable Power Only Above 5V: 1
Request Source Current: 0

3 REPLIES 3
Winfred LU
ST Employee

Please modify NVM accordingly. Simply speaking,

  1. Use STSW-STUSB002 GUI package to configure and save
  2. Refer to STSW-STUSB004 package to write the NVM

https://www.st.com/en/embedded-software/stsw-stusb002.html

https://www.st.com/en/embedded-software/stsw-stusb004.html

Thankyou, but I'm not sure this helps me:

  • The device already has its NVM configured. It behaves perfectly after a reset, but only negotiates 5V before being reset.
  • I need to be able to configure the STUSB4500 in the field via firmware on the ESP32. If you could clarify which setting I need to change so that I can configure it via I2C from the attached microcontroller that would be far better than needing a Windows computer + Nucleo board.

Yes, in case it can negotiate to 9V after issuing a soft reset, the NVM should have been configured correctly.

The question would be what's the differences between the first attaching and the second one after resetting.

Did the STUSB4500 work as a standalone controller or

was the MCU involved in the PD protocol - controlling STUSB4500 during negotiation?

What is the clock for the I2C?