Skip to main content
Visitor II
November 10, 2024
Question

STM32G4 USB-PD board restarting after SRC cababilities are recieved

  • November 10, 2024
  • 1 reply
  • 998 views

Hi!

I am having big troubles getting USB-PD sink on the STM32G431KBT to work. I am using CubeMX and following the AN5418 Complete USB-PD application example and using FREERTOS 10.3.1 and USBPD 3.3.0.

Connected to my wall adapter the debug traces looks as follow:

BoSt_0-1731250509681.png

The source always resetting its power after the source capabilities are recieved. And the board restarts.

Any ideas how to fix this? 

 

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 11, 2024

    Hi @BoSt 

    I assume the sink cannot evaluate the received source capabilities to determine the best power profile to request.

    Did you check user code section dedicated for evaluating capabilities 

    BoStAuthor
    Visitor II
    November 11, 2024

    Thanks, for reply! 

    I have tried both the:

     

    void USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType)

    {

    /* USER CODE BEGIN USBPD_DPM_SNK_EvaluateCapabilities */

     

    USBPD_USER_SERV_EvaluateCapa(PortNum, PtrRequestData, PtrPowerObjectType);

    }

     

    and the code from the example:

     

    void USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType)

    {

    /* USER CODE BEGIN USBPD_DPM_SNK_EvaluateCapabilities */

    uint32_t *srcPDOs;

    uint32_t srcPDOCount;

    // Retrieve Source PDOs for evaluation

    USBPD_PWR_IF_GetPortPDOs(PortNum, USBPD_CORE_DATATYPE_SRC_PDO, (uint8_t*)&srcPDOs, &srcPDOCount);

    USBPD_SNKRDO_TypeDef rdo;

    /* Initialize RDO */

    rdo.d32 = 0;

    /* Prepare the requested pdo */

    rdo.FixedVariableRDO.ObjectPosition = 0;

    rdo.FixedVariableRDO.OperatingCurrentIn10mAunits = 50;

    rdo.FixedVariableRDO.MaxOperatingCurrent10mAunits = 50;

    rdo.FixedVariableRDO.CapabilityMismatch = 0;

    *PtrPowerObjectType = USBPD_CORE_PDO_TYPE_FIXED;

    *PtrRequestData = rdo.d32;

    /* USER CODE END USBPD_DPM_SNK_EvaluateCapabilities */

    }

     

    with the same results. The board are still resetting!

     

    Technical Moderator
    November 11, 2024

    Hi @BoSt 

    Is PPS Programmable power supply activated? Could it be disabled for test? Would you share minimal project to reproduce?