Skip to main content
LOMO
Associate III
Mar 27, 2023 8:26 AM UTC
Solved

USBPD_ERROR in USBPD_DPM_InitCore

I generated my code by stm32cubemx,version6.1.2, and use ucpd2 as sink&dead battery,. But got USBPD_ERROR in USBPD_DPM_InitCore after execute " CHECK_PE_FUNCTION_CALL(USBPD_PE_Init(USBPD_PORT_0, (USBPD_SettingsTypeDef *)&DPM_Settings[USBPD_PORT_0], &DPM_Params[USBPD_PORT_0], &dpmCallbacks));

"

Changing stack size is useless;any other solution?

thanks.

This topic has been closed for replies.
HFISTM
HFISTMBest answer
ST Employee
Mar 27, 2023 2:03 PM UTC

Hello @LOMO​ 

Are you sure it's not the line above that is generating the error ? I mean the line calling USBPD_CAD_Init.

Can you try to look at the return code of USBPD_CAD_Init ?

I suspect that it could be a memory allocation error, as your Heap in the linker settings seems too low.

You should try to change the heap to 0xC00 and see if that resolves the issue.

Regards

2 replies

HFISTM
HFISTMBest answer
ST Employee
Mar 27, 2023 2:03 PM UTC

Hello @LOMO​ 

Are you sure it's not the line above that is generating the error ? I mean the line calling USBPD_CAD_Init.

Can you try to look at the return code of USBPD_CAD_Init ?

I suspect that it could be a memory allocation error, as your Heap in the linker settings seems too low.

You should try to change the heap to 0xC00 and see if that resolves the issue.

Regards

LOMO
LOMOAuthor
Associate III
Mar 28, 2023 1:58 AM UTC

Changing the size of the heap instead of the stack is effective,my problem.thanks