cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 project created by CubeMX does not work

Yqiwu.1
Associate

The hardware I have is the STM32G0 Discovery Kit. The sample code using this hardware works normally. I tried to rebuild a project using CubeMX. I found that it would be in CHECK_PE_FUNCTION_CALL (USBPD_PE_Init (USBPD_PORT_0, (USBPD_SettingsTypeDef *) & DPM_Settings [USBPD_PORT_0] , & DPM_Params [USBPD_PORT_0], & dpmCallbacks)) An error code USBPD_PDFU_NODATA appears. I cannot tell what went wrong with this error code. I increased the heap size and stack size according to similar suggestions, but it doesn't work. Maybe where is the problem?

1 ACCEPTED SOLUTION

Accepted Solutions
Dominique
ST Employee

​Hi Bruce,

I tested your ioc file and to make it working i only updated the HEAP to 0x600. Please could you check if your project works with this update ? (on my side, I used IAR)

FYI, the project generated by cubeMX is only an application skeleton so this means that you will have to fill many functions to make it functionnal

please check this link https://www.youtube.com/watch?v=Z_Sn6CBbz-k which explain how to build an USB-PD application with cube MX

For your information the GO discovery board is little bit complex because the VBUS measurement is done with an external component connected by I2C.

So I recommend you to use the SW delivered inside the G0 package (this is the full source of G0 discovery demo)

   \STM32Cube_FW_G0_V1.3.0\Projects\STM32G071B-DISCO\Demonstrations\USBPD_Analyzer

BR

Dominique.

View solution in original post

2 REPLIES 2
Dominique
ST Employee

​Hi Bruce,

I tested your ioc file and to make it working i only updated the HEAP to 0x600. Please could you check if your project works with this update ? (on my side, I used IAR)

FYI, the project generated by cubeMX is only an application skeleton so this means that you will have to fill many functions to make it functionnal

please check this link https://www.youtube.com/watch?v=Z_Sn6CBbz-k which explain how to build an USB-PD application with cube MX

For your information the GO discovery board is little bit complex because the VBUS measurement is done with an external component connected by I2C.

So I recommend you to use the SW delivered inside the G0 package (this is the full source of G0 discovery demo)

   \STM32Cube_FW_G0_V1.3.0\Projects\STM32G071B-DISCO\Demonstrations\USBPD_Analyzer

BR

Dominique.

Yqiwu.1
Associate

Hi Dominique,

Thank you. According to your suggestions, the project can now work in the MDK environment, and thank you for the youtube link provided. This video is very useful for people who are new to this series of MCUs.