2025-03-30 3:41 AM - last edited on 2025-04-02 3:15 AM by Andrew Neil
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.
Solved! Go to Solution.
2025-04-07 2:56 AM
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.
2025-04-02 3:06 AM
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.
2025-04-02 9:19 AM
Missing files in cmake/stm32cubemx/CMakeFiles.txt.
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.
I am using STM32CubeMx version 6.14.0. on windows 11
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()
7. build project - fail
8. added *.c files to sources in ./CMakelists.txt
9. build project - success
2025-04-02 9:37 AM
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.
2025-04-07 2:56 AM
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.
2025-04-28 9:05 AM
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?
2025-04-28 10:00 AM
No it didn't, which CMakeLists.txt did you change, because the CMakeLists in main folder isn't overwriten
2025-04-28 11:40 PM
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.