2024-09-06 04:54 AM - edited 2024-09-06 06:52 AM
Hello,
Im trying to get a USB PD 3.0 connection betwe en an ST X-Nucleo-DRP1M1() and an power bank or wall adapter.
If i ask for the source to give its capabilties, and set up an 5, 9,12, 15 or 20V Vbus voltage the nucleo says it has an capability mismatch. Also it says it can only handle an maximum operating current of 440mA. But i cant find that number anywhere. My SNK_PDO list is as following:
USBPD_PDO_SRC_FIXED_SET_VOLTAGE(5000U) | /* Voltage in mV
USBPD_PDO_SRC_FIXED_SET_MAX_CURRENT(3000U) | /* Max current in mA
USBPD_PDO_SRC_FIXED_PEAKCURRENT_EQUAL | /* Peak Current info
/* Common definitions applicable to all PDOs, defined only in PDO 1 */
USBPD_PDO_SRC_FIXED_UNCHUNK_NOT_SUPPORTED | /* Unchunked Extended Messages
USBPD_PDO_SRC_FIXED_DRD_SUPPORTED | /* Dual-Role Data
USBPD_PDO_SRC_FIXED_USBCOMM_NOT_SUPPORTED | /* USB Communications
USBPD_PDO_SRC_FIXED_EXT_POWER_NOT_AVAILABLE | /* External Power
USBPD_PDO_SRC_FIXED_USBSUSPEND_NOT_SUPPORTED | /* USB Suspend Supported
USBPD_PDO_SRC_FIXED_DRP_SUPPORTED /* Dual-Role Power */
Plz help.
I also tried different PDO list settings, but it will say its a mismatch.I used STMCubeMX according to the getting started tutorial
Solved! Go to Solution.
2024-09-09 12:18 AM
Hello,
Unfortunately no, CubeMX isn't able to configure this automatically, as this is highly applicative. I'll suggest you to add trace in the PDO request function DPM_SNK_BuildRDOfromSelectedPDO. It is the function that will create the RDO, and it should give you hints about why is there the 440mA value.
For debug, can you try also with defining only one Sink PDO (5V 3A) (in usbpd_pdo_defs.h) to see if the second one (also 5V) is disturbing the RDO building process ? Having multiple PDO of the same voltage is not allowed by the PD spec.
See spec 3.1 rev 1.8:
Chap 6.4.1.3 Sink Capabilities Message
[...] A Sink Shall Not offer multiple Power Data Objects of the same type (fixed, variable, Battery) and the same Voltage but Shall instead offer one Power Data Object with the highest available current for that Sink capability and Voltage. [...]
In your case you should only have one Sink PDO 5V 3A, and play with the operating current field of the RDO to tell that you will draw 100mA. You will anyway tell the source that your maximum draw is 3A, and it has to accept it to have a contract.
Best regards
2024-09-06 07:12 AM
Hello,
Could you check that DPM_USER_Settings[PortNum].DPM_SNKRequestedPower.MaxOperatingCurrentInmAunits in is effectively set to the value you expect ?
Best regards
2024-09-06 08:17 AM - edited 2024-09-06 09:25 AM
2024-09-09 12:18 AM
Hello,
Unfortunately no, CubeMX isn't able to configure this automatically, as this is highly applicative. I'll suggest you to add trace in the PDO request function DPM_SNK_BuildRDOfromSelectedPDO. It is the function that will create the RDO, and it should give you hints about why is there the 440mA value.
For debug, can you try also with defining only one Sink PDO (5V 3A) (in usbpd_pdo_defs.h) to see if the second one (also 5V) is disturbing the RDO building process ? Having multiple PDO of the same voltage is not allowed by the PD spec.
See spec 3.1 rev 1.8:
Chap 6.4.1.3 Sink Capabilities Message
[...] A Sink Shall Not offer multiple Power Data Objects of the same type (fixed, variable, Battery) and the same Voltage but Shall instead offer one Power Data Object with the highest available current for that Sink capability and Voltage. [...]
In your case you should only have one Sink PDO 5V 3A, and play with the operating current field of the RDO to tell that you will draw 100mA. You will anyway tell the source that your maximum draw is 3A, and it has to accept it to have a contract.
Best regards
2024-09-09 11:56 PM
Thanks, only having one 5V sink PDO helped. Also I had to erease my board memory with STCubeprog before the changes seem to be accepted.