Skip to main content
Associate II
Oct 26, 2026 3:19 AM UTC
Solved

Feature Request: Support for Customizable Generated Code Directory Structure in STM32CubeMX

Dear STM32 Team,

In large-scale embedded projects that span multiple hardware platforms and coexist with multiple application firmware instances, the current STM32CubeMX workflow creates a full independent copy of HAL/LL libraries for every single project workspace. This redundant duplication makes it extremely difficult to maintain a unified, shared library baseline across the entire codebase.

At present, I have to manually copy the auto-generated src/ and inc/ files from CubeMX output into our standardized fixed project directory structure. This manual workaround completely breaks the native iterative maintenance flow: every subsequent re-generation of code via CubeMX requires tedious manual file migration, which introduces high risk of configuration mismatch and human error.

It would be a highly valuable feature if STM32CubeMX could add a dedicated configuration panel to let users fully define the custom directory hierarchy for all generated source files, header files, and library components, rather than enforcing the fixed default output structure. This will drastically improve the development experience for complex multi-project, multi-platform embedded systems.

Thank you for considering this practical optimization for professional development scenarios.

Pavel A.
Pavel A.Best answer
Oct 29, 2026 12:05 AM UTC

>  the current STM32CubeMX workflow creates a full independent copy of HAL/LL libraries for every single project workspace.

On the Project manager tab → Code Generator. Check “Add necessary library files as references ...”

This avoids copying all the files into the project and lets you have a shared library.

The version and path of the Cube library can be set on the Project manager → Project page. You can have a custom library fork per project or set of projects.

CubeMX will still create the directory structure for these library files, but these will be “virtual” Eclipse (or other IDE) folders that do not need to be in the version control.

> if STM32CubeMX could add a dedicated configuration panel to let users fully define the custom directory hierarchy

Unfortunately this does not meet the modern “convention over configuration” way.

 

 

2 replies

Ghofrane GSOURI
ST Technical Moderator
Oct 26, 2026 8:26 AM UTC

Hello ​@daniaoday 

Your change request has been escalated to dev team for further investigation and feasibility check under internal ticket ID #0066867

I will keep you posted with updates.

THX

Ghofrane

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.
Pavel A.
Pavel A.Best answer
Oct 29, 2026 12:05 AM UTC

>  the current STM32CubeMX workflow creates a full independent copy of HAL/LL libraries for every single project workspace.

On the Project manager tab → Code Generator. Check “Add necessary library files as references ...”

This avoids copying all the files into the project and lets you have a shared library.

The version and path of the Cube library can be set on the Project manager → Project page. You can have a custom library fork per project or set of projects.

CubeMX will still create the directory structure for these library files, but these will be “virtual” Eclipse (or other IDE) folders that do not need to be in the version control.

> if STM32CubeMX could add a dedicated configuration panel to let users fully define the custom directory hierarchy

Unfortunately this does not meet the modern “convention over configuration” way.