cancel
Showing results for 
Search instead for 
Did you mean: 

MxCube code generator directory structure messed up

regjoe
Associate III

Hi,

I want to generate code and project files for MDK-ARM and STM32CubeIDE.

For this I created a new directory and copied the .ioc file into it and opened it it with CubeMx (latest version 6.13).

In the projectmanager/project the following directory structure is shown now:

 

initial_view.png If I now change the toolchain / IDE e.g. to STM32CubeIDE and back to MDK-ARM, CubeMx adds the project name to the Toolchain Folder Location.

modified_view.png

If I now hit the "Generate Code" button, a new directory with the project name is created containing the toolchain directory with the project configuration files.

For example if I select the STM32 IDE toolchain/IDE 

stmcubeide.png

the following directory structure is created

codegen_done.png

directory_struct.png#

I don't want that Toolchain/IDE directory is created inside the <projectname> directory.

I wonder if this is new in 6.13 because a couple of weeks before when I first generated code with 6.12 the following directory structure has been created:

old_directory_struct.png 

Additionally, after Code Gen the project is automatically imported into CubeIDE but I cannot open the project.

Am I doing something wrong? How can I avoid to create the additional <projectname> subdirectory?

1 REPLY 1
regjoe
Associate III

I can reproduce the problem. If I create and save a fresh .ioc project, the .ioc contains these defines

 

ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=

 

and the directory structure of the generated code is like this

 

16.01.2025  10:02            23.622 .mxproject
16.01.2025  09:41    <DIR>          Core
16.01.2025  09:41    <DIR>          Drivers
16.01.2025  10:02            27.525 hiplex_v11.ioc
16.01.2025  09:46    <DIR>          STM32CubeIDE

 

If I now switch to another toolchain/IDE, e.g. MDK-ARM, generate code/project files, then switch back to STM-Toolchain, the projectname is added to the toolpath. If I generate code, a strange warning "Updating under root option may corrupt your previous generated project if exists" appears

update_corrupt_warning.png

 

and the .ioc looks like this

 

ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=hiplex_v11

 

and now the generated directory structure looks like this

 

16.01.2025  10:02            23.622 .mxproject
16.01.2025  09:41    <DIR>          Core
16.01.2025  09:41    <DIR>          Drivers
16.01.2025  10:02    <DIR>          hiplex_v11
16.01.2025  10:02            27.525 hiplex_v11.ioc
16.01.2025  09:55    <DIR>          MDK-ARM
16.01.2025  09:46    <DIR>          STM32CubeIDE

 

Instead of overwriting the "STM32CubeIDE" directory content, an additional directory "hiplex_v11" has been created and an additional "STM32CubeIDE" directory with project files is created inside.

This is confusing and results in IDE/compile problems if the generated code is imported into CubeIDE..

Any idea what this warning is about and how to avoid it?

Is this a bug in CubeMx? If not, what am I doing wrong?

Thanks

 

EDIT:

The problem does not occure if the project is saved before code generation.

1. Change the toolchain from MDK-ARM to STMCubeIDE (forces "Generate Under Root")

2. Disable "Generate Under Root"

3. SAVE

4. GENERATE CODE

If step 3. is missing, an extra directory is created by mistake.