2026-03-01 11:51 AM - last edited on 2026-03-02 4:41 AM by Andrew Neil
CubeMX does not generate .project and .cproject files for cubeIDE, when in CubeMX project it is selected to not use default firmware location, and path set to folder with STM32Cube FW from github.
To reproduce:
1 Open CubeMX
2 Select File->New Project
3 Select chip, in my case stm32g491ceu6
4 Open Project manager tab, enter name and location for the project, toolchain - stcubeide
5 Uncheck "Use Default Firmware Location", Click Browse and navigate to a folder with github repository with cude FW package
6 Go to "Code Generator" sub tab, select radio button "Add nevessary library files as reference in the toolchainproject configuration file"
7 Click generate
8 Observe folder content in the file explorer - .cproject and .project are missing.
CubeMX version 6.16.1
Solved! Go to Solution.
2026-03-02 5:51 PM
jamessmite,
"When you uncheck “Use Default Firmware Location,” the IDE references the libraries as external links instead of copying them," - This is not correct, there is another thing for this function. The options you are referring to are the ones here in the screenshot:
“Use Default Firmware Location” will allow you to get the library from another CubeMX FW installation. But this, unfortunately does not work with github repository of the library.
2026-03-02 5:56 PM
TDK,
So I guess, when there is a release of CubeMX it will support latest up to date FW version and older, but not newer? Everything after a CubeMX Release date is not supported?
2026-03-03 9:47 AM
> The GUI says Relative path, which is I suppose automatically resolved into a relative path, as there is no way to paste any text into the text box. The only way to set the path is to click Browse button
Yes. Even if the path in the .ioc file is absolute, you can edit it manually to relative form and CubeMX will preserve it.
@trs Do you have two Cube libraries: one in your git repo and another (the 'default' one) installed by the CubeMX or CubeIDE? If so, is the non-default library in your repo broken in some way?
2026-03-03 10:33 AM
@trs wrote:a github repo (https://github.com/STMicroelectronics/STM32CubeG4) cloned on my machine,
ST's GitHub repos rely on submodules - so you have to follow the instructions to clone correctly:
Did you do that?
2026-03-03 12:12 PM
> So I guess, when there is a release of CubeMX it will support latest up to date FW version and older, but not newer? Everything after a CubeMX Release date is not supported?
It's certainly not going to be compatible with future repo versions, in general.
You could do a diff on the directory that CubeMX installs vs your downloaded repo to see the extent of the differences. I saw the files were different but didn't do a deep dive.
2026-03-03 8:34 PM
Good point Andrew, I did not clone the repo as a one with submodules. I see now that STM32G4xx_HAL_Driver is a submodule. And now I did that, and code generation worked, partially.
When in Code generation subtab, I had selected "Copy only necessary library files" it copied files from my "libs" folder. I tested that by adding some text in comments and after project generation I saw that file copied into my project was updated with that change.
When in Code generation subtab, I had selected "Add necessary library files as reference in the toolchain project configuration file" then .project file for the CubeIDE is not generated correctly still. Files are all gone and not copied - which is expected, but .project file does not have file references to files from "libs" folder.
Thank you for support, again very good point you brought up!
2026-03-03 8:36 PM
Yes I have library that CubeMX downloaded in c:\Users\username\STM32Cube\Repository\STM32Cube_FW_G4_V1.6.2\ and one I cloned. I compared them, and difference was only in line endings.
As Andrew mentioned - I did not clone github repo with submodules parameter and as a result my repo was screwed up.
2026-03-04 9:01 AM
Then I'm out of ideas. I use basically the same setup: customized Cube package in non-default directory, which is also a git repo. Works well with several versions of CubeMX and CubeIDE.
2026-03-04 6:14 PM
I just did the same thing I did yesterday, selected to "Copy all necessary library files", Generated the project, then selected "Add necessary files as a reference in the toolchain project configuration file" and it actually worked correctly! The project is attached. Thank you everybody for the help! Seems like my mistake was only on not copying submodules. Why it generated project files today and did not yesterday escapes me. Anyway I am happy it works now!
2026-03-04 8:00 PM