cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get first two source PDO capabilities accurately for STUSB4500

WGao.1
Associate II

Hi,

I have issues to get the source PDO capabilities by STUSB4500. My power source has 4 source PDOs as below:

  1. 5V, 3A
  2. 9V, 3A
  3. 15, 3A
  4. 20, 3A

But I most time got below:

  1. 5V, 4.19A
  2. 9V, 2.88A
  3. 15, 3A
  4. 20, 3A

Verifying the PD message registers, I got:

0x30 1  2  3  4  5  6  7     8  9  a  b  c  d  e  f

00 66 07 7D 4B 1A EC 20   D1 02 00 2C B1 04 00 2C

41 06 00 ED F1 E2 0C 00   00 00 00 00 00 18 E3 00

I picked up the message register data as below

0x33 7D 4B 1A EC <---  PDO0 data is stored here temporary

0x37 20 D1 02 00 <---  PDO1 data is stored here temporary

0x3B 2C B1 04 00 <---  This is 15V, 3A for PDO2

0x3F 2C 41 06 00 <---  This is 20V, 3A for PDO3

I think my register reading may not be fast enough, but from USB-C PD sniffer, I cannot find any PD message that can overwrite the register 0x33 to 0x3A. All of the PD message ObjCounts is 0, except the source cap message, which has ObjCounts 4(4 source PDOs).

My questions are:

  • Is there a way to reliably read the source capabilities?
  • How/Why are the register 0x33-0x3A overwritten?
  • If there are PD messages that overwrite the registers 0x33-0x3A, what are the messages?
  • If the ObjCounts is 0, it should not write anything to RX_DATA_OBJ1_0(0x33) registers, right?

It would be ideal that STUSB4500 can store source capabilities to some fixed registers forever, until new source cap PD message comes.

Thanks,

Winston

1 ACCEPTED SOLUTION

Accepted Solutions
Gregory Go.
Senior II

Hello,

The PDO Capabilities sent by the USB-PD Source are not stored by STUSB4500. 

They are only available in the STUSB4500 receive Buffer for a short time (~3 ms timing), until the USB-PD Source will send the next USB-PD message (which will overwrite the buffer).

To know if the data have not been overwritten, you need to check if the data content is consistent or not. 

For example, the first PDO should be 5V@1.5A or 5V@3A.

All USB-PD messages are received in the RX_DATA_OBJx buffer:

If ObjCounts > 0, then the PD Message is a Data Message

If ObjCounts = 0, then the PD Message is a Control-Message. And it still overwrite the receive buffer.

To get properly the PDO Source Capabilities, it is needed to have the firmware to store the PDO data by I2C in interrupt mode.

An example is available in the STUSB4500 Library :

https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-stusb003.html

switch ( Header.b.MessageType )
{
case USBPD_DATAMSG_Source_Capabilities :
	{
		...
	}
	break;
	
	...
}

View solution in original post

1 REPLY 1
Gregory Go.
Senior II

Hello,

The PDO Capabilities sent by the USB-PD Source are not stored by STUSB4500. 

They are only available in the STUSB4500 receive Buffer for a short time (~3 ms timing), until the USB-PD Source will send the next USB-PD message (which will overwrite the buffer).

To know if the data have not been overwritten, you need to check if the data content is consistent or not. 

For example, the first PDO should be 5V@1.5A or 5V@3A.

All USB-PD messages are received in the RX_DATA_OBJx buffer:

If ObjCounts > 0, then the PD Message is a Data Message

If ObjCounts = 0, then the PD Message is a Control-Message. And it still overwrite the receive buffer.

To get properly the PDO Source Capabilities, it is needed to have the firmware to store the PDO data by I2C in interrupt mode.

An example is available in the STUSB4500 Library :

https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-stusb003.html

switch ( Header.b.MessageType )
{
case USBPD_DATAMSG_Source_Capabilities :
	{
		...
	}
	break;
	
	...
}