cancel
Showing results for 
Search instead for 
Did you mean: 

USB PD change voltage during active contract

abtq
Associate

Dear ST Community,

 

I have a working application for USB PD SPR and EPR and now I want to change the voltage (power profile) during an active contract.
So e.g. I have 5V currently and want to request 9V from the source, or I have 20V currently and want to switch to 28V (EPR).
How to do that? According to the USB Specification you would send a "Get Source Capability" Request so I used USBPD_DPM_RequestGetSourceCapability() [or USBPD_PE_Send_ExtendeControlMessage(m_uPort, USBPD_EXTENDED_CONTROL_EPR_GETSRCCAPA) in EPR]. Then the source responds with it's capabilities. USBPD_DPM_SetDataInfo gets called with the PDOs but USBPD_DPM_SNK_EvaluateCapabilities is never called afterwards....
In SPR Mode nothing happens, voltage stays the same. In EPR Mode 30ms later a hard reset is triggered.

 

Why does the ST Stack not Evaluate Capabilities after successfull reception of PDOs? According to USB Spec as a Sink we always need to respond to a capabilities message with our "wish".....

 

How to fix that?

I am using Core Stack version V5.3.0 (latest version as of writing this post). Microcontroller used is STM32H523.

 

Regards,

Adrian

3 REPLIES 3
FBL
ST Employee

Hi @abtq 

Would you share minimum firmware to reproduce the issue on a reference board? 

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.


abtq
Associate

Hi @FBL ,

I now have added a workaround: In USBPD_DPM_SetDataInfo() for USBPD_CORE_DATATYPE_RCV_SRC_PDO and USBPD_CORE_DATATYPE_RCV_SRC_PDO_EPR I added

if(usb.m_bChangingProfile && DPM_Params[PortNum].PowerRange == USBPD_EPR_MODE) {
    evaluateAndRequest(); // if an contract is active we need to evaluate our selves
}

(or check for SPR mode in similar fashion).

With:

bool CUSBPowerDelivery::evaluateAndRequest() {
	USBPD_SNKRDO_TypeDef uRequestData;
	USBPD_CORE_PDO_Type_TypeDef type;
	USBPD_DPM_SNK_EvaluateCapabilities(m_uPort, &uRequestData.d32, &type);
	USBPD_StatusTypeDef status = USBPD_PE_Send_Request(m_uPort, uRequestData.d32, type);
	if(status != USBPD_OK) {
        return false;
	}
	return true;
}

 

But in fact the ST stack should do that on its own? If so I will have to look into that and compose a minimal example to see whether this is a problem in my environment or whether the behaviour is the same in the minimal example.

 

FBL
ST Employee

Hi @abtq 

That would be great to share minimal project to reproduce on ! An internal ticket 215626 is submitted to USB PD stack team to answer all related questions!

Thank you

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.