Skip to main content
Visitor II
March 27, 2023
Solved

USBPD_ERROR in USBPD_DPM_InitCore

  • March 27, 2023
  • 1 reply
  • 1269 views

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.
    Best answer by HFISTM

    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

    1 reply

    HFISTMAnswer
    ST Employee
    March 27, 2023

    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

    LOMOAuthor
    Visitor II
    March 28, 2023

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