cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX doesn't generate .project and .cproject files with non-default firmware location

trs
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

@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:

Image1.png

Did you do that?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

19 REPLIES 19
TDK
Super User

Just tried this and both .project and .cproject showed up as expected. Maybe you missed a dialog box, or maybe you have some other project setting which is incorrect, or maybe you have "dot" files hidden.

Screenshot 2026-03-01 162608.png

It is easier to debug STM32CubeMX issues when you attach the IOC file that produces the incorrect behavior.

If you feel a post has answered your question, please click "Accept as Solution".
trs
Associate III

Thank you for support. Attaching my STM32CubeMX project with the IOC file.

 

Screenshot 2026-03-01 205814.png

 These are all files that I get after pressing Generate button.

TDK
Super User

I do not see an attached IOC file.

If you feel a post has answered your question, please click "Accept as Solution".
trs
Associate III

Apologies, here it is

TDK
Super User

> ProjectManager.CustomerFirmwarePackage=..\\..\\libs\\STM32CubeG4

Maybe a relative path is supported in the "Firmware Relative Path" box.

I can't test out your IOC exactly because our library paths are not the same. With a non-default absolute path, everything works for me.

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Super User

Cannot reproduce this problem. Tested with relative path:

ProjectManager.CustomerFirmwarePackage=..\\CUBELIBS\\STM32Cube_FW_C0_V1.1.0

Though in the CubeMX GUI the path is displayed as absolute (and it does not let user edit in place), in the ioc file it is relative.

 
 

Screenshot 2026-03-02 215027.png

trs
Associate III

If you open IOC file I shared before, can you get to generate STM32CubeIDE project?

As soon as I check the box "Use Default Firmware Location" the project generates normally. Then if I uncheck the checkbox, click Browse and navigate to a github repo (https://github.com/STMicroelectronics/STM32CubeG4) cloned on my machine, all files in the project's Drivers folder are gone, and there is no path in .project file to any source file anymore, including main.c.

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. Is it not the case on your side?

The path it resolved, after I navigated to the repo through Browse button click - is correct:

ProjectManager.CustomerFirmwarePackage=..\\..\\libs\\STM32CubeG4

Here is my folder structure, where STM32CubeG4 is a submodule in main Git repo:

Screenshot 2026-03-02 173346.png

 

 

TDK
Super User

> a github repo (https://github.com/STMicroelectronics/STM32CubeG4) cloned on my machine

Maybe this is the issue. What if you use the standard way of installing the package? (Help -> Manage embedded...)

You can't just mix and match any repo version with any CubeMX version.

If you feel a post has answered your question, please click "Accept as Solution".
trs
Associate III

You are probably correct. I don't want to try installing firmware package as the STM32CubeMX already installed it's own package and I know that is working.

So the issue is that github repo != installed package. Which is unfortunate, as it would blend very nicely with having a github repository within your project repository, where FW package is a submodule in it. This is attractive because:

A) it is easy to get updates - no installation is required;

B) modifications to the FW library are easy to keep track of because I would create a separate branch, and would always see what I changed in the library and why;

C) integration of my changes and updates is a breather as I would merge/rebase my branch of the FW library.

Anyway, thank you for the help! Hopefully this will be possible in near future.