cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 USB-PD board restarting after SRC cababilities are recieved

BoSt
Associate

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? 

 

3 REPLIES 3
FBL
ST Employee

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 

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.

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!

 

FBL
ST Employee

Hi @BoSt 

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

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.