2026-01-30 11:47 PM - last edited on 2026-02-02 1:43 AM by FBL
Hi, I'm trying to implement USBPD EPR Source with DisplayPort Alt Mode on a STM32G071.
I use the latest https://github.com/STMicroelectronics/stm32-mw-usbpd-core, which seems to support EPR, but I couldn't find any complete examples with a working EPR source.
Now I successfully enter EPR mode, and Sink receives EPR PDOs, but can't negotiate any PDO except the 1st. Even SPR PDOs
The stack sends REJECT after PE_SRC_NEGOTIATE_CAPABILITY.
It works perfectly in SPR mode and can switch between PDOs, but fails the same PDO in EPR mode
1st PDO in EPR mode ACCEPT:
2nd PDO REJECT:
How can I debug these things inside the stack? What am I missing?
uint32_t PORT0_PDO_ListSRC[USBPD_MAX_NB_PDO] =
{
/* PDO 1 */
(
USBPD_PDO_TYPE_FIXED | /* Fixed supply PDO */
USBPD_PDO_SRC_FIXED_SET_VOLTAGE(5000U) | /* Voltage in mV */
USBPD_PDO_SRC_FIXED_SET_MAX_CURRENT(1000U) | /* 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_EPR_SUPPORTED | /* EPR Mode Capable */
USBPD_PDO_SRC_FIXED_UNCHUNK_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 */
),
/* PDO 2 */
(
USBPD_PDO_TYPE_FIXED | /* Fixed supply */
USBPD_PDO_SRC_FIXED_SET_VOLTAGE(9000U) | /* Voltage in mV */
USBPD_PDO_SRC_FIXED_SET_MAX_CURRENT(3000U) | /* Max current in mA */
USBPD_PDO_SRC_FIXED_PEAKCURRENT_EQUAL /* Peak Current info */
),
Solved! Go to Solution.
2026-01-31 12:28 AM
After creating a topic, I found my bad in USBPD_PWR_IF_SearchRequestedPDO while in EPR mode.
Would be nice to have an EPR Source example from ST.
2026-01-31 12:28 AM
After creating a topic, I found my bad in USBPD_PWR_IF_SearchRequestedPDO while in EPR mode.
Would be nice to have an EPR Source example from ST.
2026-01-31 8:33 AM
ERROR with Trace_Notif :78Also, sometimes got this message from the stack. Where can I find what 78 means?
2026-02-02 7:12 AM
Hi @xGloooM
To create EPR request STM32 as source:
Initialize EPR PDOs properly by creating your EPR Source PDO PORT0_PDO_ListEPRSRC following the USB PD3.1 (or 3.2 depending on your stack, as of now I guess we support only 3.1) AVS PDO format (voltage in 25 mV units, current in 50 mA units).
Assign this PORT0_PDO_ListEPRSRC and its count to the EPR PDO storage in USBPD_PWR_IF_Init.
Enable EPR Source support in DPM_Settings for the port to inform the PE and stack .Is_EPR_Supported_src=USBPD_TRUE,
Ensure USBPD_PWR_IF_GetPortPDOs supports USBPD_CORE_DATATYPE_SRC_PDO_EPR to handle PDO retrieval for EPR.
In USBPD_PWR_IF_SearchRequestedPDO, check if the requested RDO position corresponds to an EPR PDO.
In USBPD_PWR_IF_SetProfile, set voltage/current to process the selected PDO type when the device receives a power contract request RDO to handle EPR voltages and currents properly (up to ~48 V).
About the error message from trace, it means nothing, you have just received the status.
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.