cancel
Showing results for 
Search instead for 
Did you mean: 

USB PD Stack Library with EPR

janik
Associate II

Hi,

I use the USBPD Middleware to implement a PD Port with a G474RB. This is functional. Now I would like to implement USB-PD EPR. I cant find any settings that would make cubeMX use the EPR version of the stack, the cubeMX inputs are further limited to SPR ranges. 

Is it possible to use USB-PD EPR in cubeMX ? Information that i have found on this topic suggest that X-CUBE TCPP supports EPR, however the TCPP hardware itself does not support EPR anyway. So far I have not enabled the X-CUBE TCPP package since I dont use that hardware. I use a different port protection IC which is rated for EPR operation.

The USBPD stack in the up-to-date G4 firmware V1.6.3 seems to be Version 4.1, which is from 15-Dec-2021. That is before EPR was introduced with Version 5.0

So to summarise : Is there a way to force cubeMX to load the newer library ? Do I have to manually download the new library and link it?

Thank you,

Janik

4 REPLIES 4
janik
Associate II

This seems to be a possible git submodule issue, where the submodule never got updated for the newer releases of the G4 firmware package.

FBL
ST Employee

Hi @janik 

I suggest checking whether the latest stm32-mw-usbpd-core at v5.4.0  version with EPR support can be integrated manually into  CubeG4.

 

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
janik
Associate II

Hi @FBL 

I have done exactly that and updated the usbpd core in the G4 firmware, now cubeMX copies the updated library.

This works, however I cannot use cubeMX with the new library features - updating the library does not magically create a checkbox for something like "EPR Mode support" or EPR PDO.

These have to be added in code manually (Claude):

The PD 3.1 Is_EPR_Supported_SRC bit (visible in the v5.x USBPD library's USBPD_PD3SupportTypeDef union) has no CubeMX UI control, and the DPM_Settings initializer in the CubeMX-generated usbpd_dpm_conf.h sits outside every USER CODE block, so any direct edit is wiped on regen. USBPD_DPM_InitCore in the generated usbpd_dpm_core.c also has no USER CODE block inside its body. The only clean workaround is to runtime-patch DPM_Settings[port].PE_PD3_Support.d.Is_EPR_Supported_src=USBPD_TRUE from main.c's USER CODE BEGIN 2 before MX_USBPD_Init runs. 

It would be great if cubeMX with G4 could receive proper support for EPR.

FBL
ST Employee

Hi @janik 

Thank you for your feedback. This would be a great enhancement once we provide a hardware setup supporting EPR mode.

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