cancel
Showing results for 
Search instead for 
Did you mean: 

I have been playing with an NUCLEO-STM32G474RE and X-NUCLEO-USBPDM1. I've managed to finish up with a project which doesn't compile anymore (with STM32CubeIDE) as a result of running STM32CubeMX several times (with different USBPD stack config settings).

Jan_the_man
Associate

After running STM32CubeMX a few times with different USBPD Stack configuration settings (while I was experimenting to see how much code was being generated for each) I found that it was exporting the following preprocessor values to my project (shown in the .cproject snippet), and thus breaking the build:

    <listOptionValue builtIn="false" value="USBPD_PORT_COUNT=1"/>

                                    <listOptionValue builtIn="false" value="USBPD_STATE_MACHINE"/>

                                    <listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>

                                    <listOptionValue builtIn="false" value="STM32G474xx"/>

                                    <listOptionValue builtIn="false" value="_RTOS"/>

                                    <listOptionValue builtIn="false" value="USBPDCORE_LIB_PD3_CONFIG_MINSNK"/>

                                    <listOptionValue builtIn="false" value="DEBUG"/>

                                    <listOptionValue builtIn="false" value="_SNK"/>

                                    <listOptionValue builtIn="false" value="USBPDCORE_LIB_NO_PD"/>

                                    <listOptionValue builtIn="false" value="USBPDCORE_LIB_PD3_FULL"/>

All of the USBPDCORE_LIB_xxxxx libraries associated with the above USCPDCORExxxx preprocessor defines were also referenced in the .cproject file.

e.g. ../Middlewares/ST/STM32_USBPD_Library/Core/lib/USBPDCORE_PD3_FULL_CM4_wc32.a

A couple of questions:

  1. Is it the case, that a project generated with STM32CubeMX should only reference one USBPD Stack configuration (as a preprocessor define), and its associated USBPDCORE_xxxx library? i.e. is what I am seeing is a bug in STM32CubeMx?
  2. Is the best way fo fix my project is to manually edit the .cproject file and remove all references to USBPDCORExxxxxx including libraries? (Re-running STM32CubeMX with a new USB PD stack configuration does not fix the problem)

Kind Regards

Jan

0 REPLIES 0