cancel
Showing results for 
Search instead for 
Did you mean: 

USBPD_ERROR in USBPD_DPM_InitCore

LOMO
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
HFISTM
ST Employee

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

View solution in original post

2 REPLIES 2
HFISTM
ST Employee

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
Associate III

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