cancel
Showing results for 
Search instead for 
Did you mean: 

USB PD Extended Source Capabilities

Mulleteer
Associate II

Hi,

How do I serve request Get Source Capabilities Extended? I'm using STM32G0B1 with a port configured as SRC.
When a SINK sends the Get Source Capabilities Extended the STM PD library responds with 'Not Supported' and my code is not aware that this even did happen.

Mulleteer_0-1776944660689.png

 

Is there way to intercept and serve this request? At least the callback structure does not appear to have direct support for this. USBPD_DPM_ExtendedMessageReceived is never called.

  /* CAD callback definition */
  static const USBPD_PE_Callbacks dpmCallbacks =
  {
    USBPD_DPM_SetupNewPower,
    USBPD_DPM_HardReset,
    USBPD_DPM_EvaluatePowerRoleSwap,
    USBPD_DPM_Notification,
    USBPD_DPM_ExtendedMessageReceived,
    USBPD_DPM_GetDataInfo,
    USBPD_DPM_SetDataInfo,
    USBPD_DPM_EvaluateRequest,
    USBPD_DPM_SNK_EvaluateCapabilities,
    USBPD_DPM_PowerRoleSwap,
    USBPD_PE_TaskWakeUp,
#if defined(_VCONN_SUPPORT)
    USBPD_DPM_EvaluateVconnSwap,
    USBPD_DPM_PE_VconnPwr,
#else
    NULL,
    NULL,
#endif /* _VCONN_SUPPORT */
    USBPD_DPM_EnterErrorRecovery,
    USBPD_DPM_EvaluateDataRoleSwap,
    USBPD_DPM_IsPowerReady
  };





6 REPLIES 6
FBL
ST Employee

Hello @Mulleteer 

Are you using latest version of stm32-mw-usbpd-core v5.4?

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.




Best regards,
FBL

I don't think so. I use what STMCube generated. The firmware package based on ioc file is ProjectManager.FirmwarePackage=STM32Cube FW_G0 V1.6.2

I did try to update to latest STM32Cube FW_G0 V1.6.3 but it uses the same library binary USBPDCORE_PD3_FULL_CM0PLUS_wc32.a and in generated code there are mostly cosmetic and seemingly non-relevant changes.

Should I manually upgrade the code to use the github version of the library code and binary?

FBL
ST Employee

Yess @Mulleteer, just to make sure you reproduce the issue as well on your end.

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.




Best regards,
FBL

Hi,

I updated my project code to the master branch of https://github.com/STMicroelectronics/stm32-mw-usbpd-core (both header and .a library) and it seems nothing changed. I tried two type of messages, a control message Get_Source_Cap_Extended and a true extended message Get_Battery_Status. Both are served with Not Supported reply and it appears that PD library does not call any of the application callbacks. USBPD_DPM_RequestWhatToDo is not called.

Here is capture of two messages I tried.

Screenshot 2026-04-27 125745.png

Screenshot 2026-04-27 125708.png

Thank you, Teemu

FBL
ST Employee

Hi @Mulleteer 

Could you confirm implementing tthis request in your dpm_user.c 

/**
  * @brief  Request the PE to get a source capability extended
  * @param  PortNum The current port number
  * @retval USBPD Status
  */
USBPD_StatusTypeDef USBPD_DPM_RequestGetSourceCapabilityExt(uint8_t PortNum)
{
  USBPD_StatusTypeDef _status = USBPD_PE_Request_CtrlMessage(PortNum, USBPD_CONTROLMSG_GET_SRC_CAPEXT, USBPD_SOPTYPE_SOP);
  DPM_USER_ERROR_TRACE(PortNum, _status, "GET_SRC_CAPA_EXT not accepted by the stack");
  return _status;
}

 Otherwise, can you provide minimum firmware?

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.




Best regards,
FBL

Hi,

Aren't these api calls used only by a Sink? I need to handle and respond to the extended requests in Source role.