cancel
Showing results for 
Search instead for 
Did you mean: 

The difference between demo project and the project from stm32cubemx in B-G474E-DPOW1?

Gbang
Associate III

I used the project in B-G474E-DPOW1, named "USB-PD_Consumer_1port" as usb pd sink, everthing is ok. However, I create the project with the params from "USB-PD_Consumer_1port" just without the usart trace, the new project can't run normal, got error in “pe set�? in " CHECK_PE_FUNCTION_CALL(USBPD_PE_Init(USBPD_PORT_0, (USBPD_SettingsTypeDef *)&DPM_Settings[USBPD_PORT_0], &DPM_Settings[USBPD_PORT_0], &dpmCallbacks));

". var DPM_Settings and DPM_Settings are the same as the demo project.

btw, I diff the user code in src folder between two project, almost same except the trace code.

Anyone can give more information or clue for this error? thanks.

3 REPLIES 3
Yohann M.
ST Employee

Hello

Possible errors behind PE_Init are mainly linked to malloc erros (USBPD_MALLOCERROR). It can be linked to heap size allocated in the project is too small. You may increase this size (0x500 for instance).

Yohann

hello, I debuged it, and this is USBPD_ERROR.​

What is the size of your heap? Please try to increase the heap size and let me know it it works or not!