cancel
Showing results for 
Search instead for 
Did you mean: 

usbx_stm32_device_controllers files not included in cmake build

Quazar
Associate II

CubeMx v6.14, cmake project, stm32h573ritx.

 

Hi, I am developing a project using threadx and usbx on a h573ritx mcu in cmake using cubemx generator, I have encountered where all but usbx_stm32_device_controllers folder files are included in the CMakeLists.txt. Adding them does seem to fix the issue.

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @Quazar 

After checking with CubeMX team, they recommend cleaning your environment by deleting .stm32cubemx , this may solve the issue.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


View solution in original post

7 REPLIES 7
FBL
ST Employee

Hi @Quazar 

Would you attach IOC file to replicate.

As far as I can see, 

${CMAKE_SOURCE_DIR}/Middlewares/ST/usbx/common/usbx_stm32_device_controllers

usbx_stm32_device_controllers is already included.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Quazar
Associate II

Missing files in cmake/stm32cubemx/CMakeFiles.txt.

Quazar_0-1743609424067.png

In project.zip i added a cleanly generated project using the exact same ioc i have in my project. No .c files under this folder are included in the project.

Quazar_1-1743609743183.png

I am using STM32CubeMx version 6.14.0. on windows 11

Quazar_2-1743609923698.png

 

Steps:

1. coppied ioc to new folder

2. opened ioc with cubemx

3. generated clean cmake project

4. imported project to vscode

5. build project - success

6. added `ux_dcd_stm32_initialize(0, 0);` in USBX/App/app_usbx_device.c:MX_USBX_Device_Init()

Quazar_1-1743610470510.png

7. build project - fail

Quazar_2-1743610506483.png

8. added *.c files to sources in ./CMakelists.txt

Quazar_3-1743610566062.png

9. build project - success

Thank you for the detailed steps @Quazar. An internal ticket 206676 is submitted to dedicated team.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


FBL
ST Employee

Hi @Quazar 

After checking with CubeMX team, they recommend cleaning your environment by deleting .stm32cubemx , this may solve the issue.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


MR5
Associate

I ran into the exact same problem but deleting ~/.stm32cubemx didn't fix it for me. I'm also on CubeMX 6.14.0, running Linux.

For what it's worth, here's a sample project illustrating the problem:
https://github.com/mrubli/stm32u5-usbx-cmake-test

Obviously, re-generating the code in CubeMX overwrites the manual addition of the missing source files in CMakeLists.txt (the last commit), so it's not a proper solution.

@FBL What was the outcome of your internal ticket? Is this a confirmed bug and your earlier suggestion is merely a workaround? Or was the team unable to reproduce the issue? Anything else I can try?

@Quazar Did cleaning the environment actually solve the problem for you?

Quazar
Associate II

No it didn't, which CMakeLists.txt did you change, because the CMakeLists in main folder isn't overwriten

MR5
Associate

Thanks, then we're still waiting for a solution from ST. I would have been very surprised if just clearing .stm32cubemx fixed it because the problem is reproducible across machines.

Right, I had to change cmake/stm32cubemx/CMakeLists.txt in the example. For my actual project I'm likely going to just post-process the generated file because this isn't the only problem I'm having with generated CMake files.