FAQ ¶
Frequently asked questions ¶
1 - Why are there no user sections in STM32CubeMX2 generated code ? ¶
Separation of concerns ensures that user application logic and hardware-specific configuration are kept in distinct files.
This approach makes it easier to port an application to a new STM32 microcontroller or board, as only the hardware-specific files must be adapted. You can generate the updated content of these files for a new device by using STM32CubeMX2.
The hardware configuration code generated by STM32CubeMX2 leverages modularity and encapsulation .
Each software unit, such as peripheral configuration, is implemented in its own module (mx_[pppi].c and mx_[pppi].h).
Encapsulation allows you to update or replace hardware configuration without affecting application logic.
The benefits of this approach include:
Maintainability and reusability:
Generated code can be safely regenerated by STM32CubeMX2 without overwriting user logic.
User code remains untouched, making updates and maintenance straightforward by leveraging HAL2.
Middleware, utilities, and part drivers are series-agnostic and reusable across projects.
Clear porting path
When porting to a new microcontroller or board, only update the /generated/ folder and related configuration files.
There is no need to modify application logic or infrastructure code.
By keeping user code and generated code separate, the application remains modular, maintainable, and easy to port to new hardware. Only the hardware-specific configuration must be adapted, which is simplified by STM32CubeMX2 code generation. The core logic remains reusable and protected from accidental overwrites.
STMicroelectronics uses this layered, modular approach in STM32Cube software examples to simplify porting and maintenance, as described in the STM32Cube Software Examples - Porting Example Architecture.
On top of this, STM32CubeMX2 proposes a mechanism of diff/skip/overwrite into the project export settings to be able to handle potential changes done by end-user in some exported files. Refer to the User manual — IDE Project Generation for detailed information.
2 - How do I solve DMA conflicts in STM32CubeMX2 ? ¶
For detailed information about solving DMA conflicts refer to How to configure DMA - View and Resolve Allocation Conflicts.
3 - How do I solve pinout conflicts in STM32CubeMX2? ¶
For detailed information about solving pinout conflicts refer to User manual - Pinout - Pinout Conflicts.
4 - Why do I receive a warning when activating FreeRTOS™ ? ¶
For detailed information about FREERTOS™ refer to the FREERTOS™ User Guide.
5 - Can I use CMSIS-Packs? ¶
STM32CubeMX2 only works with packs that contain STM32Cube-specific metadata.
While other CMSIS-Packs can be installed, they are not visible in the configuration views and are not used for code generation.
Installing such packs has no effect inside STM32CubeMX2 .
6 - How do I solve issues that may occur during installation ? ¶
Here you will find issues that may occur during the installation of STM32CubeMX2 and how to resolve them.
|
Installation issue |
Recommended action |
|---|---|
|
Installer fails immediately at startup with “Installation failed” |
. Check antivirus or endpoint security software. . Re-download the installer to exclude file corruption. . Contact IT support if execution is restricted by company policy. |
|
Installation stops while extracting bundles or packs |
. Verify sufficient disk space is available. . Check antivirus or EDR software blocking file extraction. . Retry installation after resolving the issue. |
|
Packs are not available after installation |
. Enable automatic pack synchronization from STM32CubeMX2 after first launch. |
|
Required packs are missing when creating or opening a project |
. Install packs manually using the STM32CubeMX2 Pack Manager . . Allow automatic pack installation when opening a project. |
|
STM32CubeMX2 CLI is not installed or CLI commands are not recognized |
. Verify available disk space. . Check antivirus or security restrictions. . Re-run the installer after resolving the issue. |
|
No desktop or Start menu shortcut is created |
. Manually create a shortcut to stm32cubemx2.exe . |
|
Pack repository is not reachable or packs cannot be downloaded |
. Download and install packs manually if needed. . Contact STMicroelectronics support if the issue persists. |
|
STM32CubeMX2 does not appear in system uninstall tools |
. Contact IT support. . This is usually caused by missing registry write permissions. |
|
CLI commands are not available in a terminal after installation |
. Add the following path to the user PATH environment variable: C:Users<Username>.localstm32cubebin . Contact IT support if permissions are restricted. |
|
Double clicking .ioc2 files does not open STM32CubeMX2 |
. Right-click an .ioc2 file → Open with → Choose another app → Select stm32cubemx2.exe |