cancel
Showing results for 
Search instead for 
Did you mean: 

STUSB4500 PDO SRC not read

rd1987
Associate II

Hi,

I have a custom PCB with STUSB4500 as the UCPD controller and STM32H7 as my application processor. Without any I2C communication between stm32h7 and stusb4500 the stusb4500 is able to negotiate a higher voltage from a usbC PD source by matching its preset values. I have checked with a 20V PD source.

I am trying to read the capabilities of a USB C PD source as received by the stusb4500 chip. I am using the STSW-STUSB003 software library as a reference to develop my code which is on Zephyr RTOS. I am able to read and write to the stusb4500 over I2C. I have tested the usb_pd_init() and Send_Soft_reset_Message() and they work without any errors. But when I am trying to print the RDO I get the following log:

 

---- Usb_Port #0: CONNECTION STATUS   ----------
 - CONTRACT             : EXPLICIT
 - Requested PDO #      : 1
 - PDO SRC not properly red by the SW
 - PIN                  : CC1
 - Max Current          : 3.00A
 - Operating Current    : 1.50A
 - Capability Mismatch  : 0
 - Give back            : 0
 - USB Com Capable      : 0
 - USB suspend          : 0

 

I have tried with various usbC PD sources but every time I am getting the message "PDO SRC not properly red by the SW" even though the chip is able to negotiate a 20V from the usbC PD source.

I debugged the source code and found the below if condition is failing and hence the error:

 

Status = I2C_Read_USB_PD(STUSB45DeviceConf[Usb_Port].I2cBus,STUSB45DeviceConf[Usb_Port].I2cDeviceID_7bit ,RX_HEADER ,&DataRW[0], 2 );
Header.d16 = LE16(&DataRW[0]);
if( Header.b.NumberOfDataObjects > 0  ) // NumberOfDataObjects is 0 in my case

 

Can someone tell me what could be the issue and what else should I be trying out?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
s_
Associate III

Sorry - I can't give an actual time - just be aware that STUSB4500 overwrites each received message when it receives the next.

Also, be aware that there will be other types of message arriving (some of which ("Control messages") have NumberOfDataObjects set to zero) - maybe you're seeing one of these?

View solution in original post

4 REPLIES 4
s_
Associate III

Possibly you're not reading the source capabilities message out quickly enough before it is (partially) overwritten by the next message from the source.

rd1987
Associate II

Thanks for your message. What is the maximum time to read out the messages? Where can I find the information? 

s_
Associate III

Sorry - I can't give an actual time - just be aware that STUSB4500 overwrites each received message when it receives the next.

Also, be aware that there will be other types of message arriving (some of which ("Control messages") have NumberOfDataObjects set to zero) - maybe you're seeing one of these?

rd1987
Associate II

Thanks. It was indeed a timing issue. I modified my code to fix the issue.

Now I am able to get the source capabilities.

[00004289] <inf> stusb4500:---- Usb_Port #0: Read PDO from SOURCE ---------
[00004289] <inf> stusb4500: 2 Objects => 2 fixed PDO:
[00004289] <inf> stusb4500:  - PDO1 (fixed)     = (5.00V, 3.00A, = 15.0W)
[00004289] <inf> stusb4500:  - PDO2 (fixed)     = (9.00V, 2.00A, = 18.0W)
[00004289] <inf> stusb4500: P(max)=18.0W