Ask questions about STM32CubeMX2. Discuss code generation and configuration challenges, as well as other relevant topics.
Most recent activity
Dear ST Community members, At the moment, STM32CubeMX2 uses the latest packs available on the public server.A script is available for a specific use case if you prefer not to start a project with the most recently published pack version.This script can be used when a project needs to be created or maintained with the STM32C5 v2.0.0 packs, instead of the most recent version available.If this matches your situation, feel free to use the script as an alternative.Where to get the script: check How to start with previous versions of HAL2 For more details on how to use it, please check the README. If you have any feedback, please don’t hesitate to share it with us in the: STM32CubeMX2 (MCUs) - STMicroelectronics Community The STM32CubeMX2 Team
We’re happy to announce that STM32CubeMX2 v1.1.0 has been released and is now available. This release includes updates and improvements aimed at enhancing the user experience and supporting your development workflow with STM32. What’s new Enhanced installation support for multiple STM32CubeMX2 versions, including linked IOC2 files and a pinned icon on the Windows taskbar Added Expand All and Collapse All functions in software configuration panels Added confirmation dialog boxes for selected actions Added options to export the pinout as CSV from a menu: without alternate functions or with alternate functions Added pin labels that can be used from configuration panels Improved command-line interface (CLI) capabilities for software configuration Added a pack version compatibility check Added end-user guidance to run Pack update steps in the correct order, with a focus on device family pack (DFP) and hardware abstraction layer (HAL) packs Increased pin name visibility in the pinout view to
In STM32CubeMX2 1.1.1, for the STM32C542RC MCU, enable the IWDG.In “Applicative services”, enable “Start function generation”. In the subfolder “Calculator”, you have the possibility to change the “Time unit”. Set it to “Seconds”. The only change is the unit used in comments, e.g.: /* Start the Independent Watchdog (IWDG) with the following parameters: - Maximum time before watchdog reset : 132 seconds - Minimum time before refresh (window) : 0 seconds - Early Wakeup Interrupt (EWI) time : 0 seconds*/hal_status_t mx_iwdg_start(void){ return HAL_IWDG_Start(&hIWDG, 0UL, 132UL, 0UL);}The arguments given to HAL_IWDG_Start() are not updated by this unit change. So the configuration of the time unit in this window is useless and does not touch any part of actual code. This is a problem and should be fixed.For the unit change to effectively take effect, it is currently done in “Project settings” → “HAL common definitions” → “HAL IWDG” → “Use HAL IWDG time unit”. We can now sel
This is a feature request.In HAL2, we can configure an STM32CubeMX2 project to use User Data pointers (pointers managed only by the application, not the HAL2 library). E.g. setting USE_HAL_UART_USER_DATA to 1 will add the field `const void *p_user_data;` to hal_uart_handle_t.This pointer can be added to other handles: timers, SPI, I2C, FLASH, …I would the pointer to be a pointer-to-mutable, or in other words to remove the “const” from p_user_data. If this is not possible/wanted by ST, please let me know why it was designed like this. I am personally using this pointer to keep track of the amount of successful read/write and errors for UART communication, so it points to a custom-defined structure that is non-const.
On cubemx I could use the scroll wheel to pan and zoom, a brilliant feature which has been removed in mx2, can we have it reinstated as the app is very frustrating to use without it
Cubemx2 only allots enough buffer descriptor table space for 4 endpoints. When a 5th endpoint is added, the table will overlap with the data buffer. In the following generated code, address should be starting at 0x28 and not 0x20. HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x0, HAL_PCD_SNG_BUF, 0x20); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x80, HAL_PCD_SNG_BUF, 0x60); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x81, HAL_PCD_SNG_BUF, 0xA0); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x82, HAL_PCD_SNG_BUF, 0xE0); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x3, HAL_PCD_SNG_BUF, 0x120); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x83, HAL_PCD_SNG_BUF, 0x160); HAL_PCD_PMAConfig(&hUSB_DRD_FS_PCD, 0x4, HAL_PCD_SNG_BUF, 0x1A0);
Hello,I have generated a project with STM32CubeMX2 for NUCLEO-C5A3ZG. Now I made changes to the MX project and try to generate the project again. But during the generation a list pops up, that asks for overwrite approval. I can not interact with the list properly. (I can’t scroll and pressing ENTER does nothing)Is this a known error or is there a workaround?
According to the reference manual, enabling USB requires APB2 to operate at a minimum clock of 12MHz. Cubemx2, however, does not validate this constraint and will proceed even if an invalid clock is configured
Hello,We're integrating STM32CubeMX2 1.1.1 into a Linux-based development workflow (a VS Code DevContainer running Ubuntu 24.04) for STM32C5xx projects, and have run into two separate blocking issues: the installer has no silent/unattended mode, and once installed, the GUI crashes on startup and never shows a window. Details and everything we've already tried below, in case it saves time on your end.======================================================================ISSUE 1 — No silent/unattended install path on LinuxWe need to provision STM32CubeMX2 as part of an automated container image build (no interactive session available at build time). We could not find any way to do this:- Your own docs (STM32CubeMX2 1.0.0 install page) only document the interactive GUI wizard for Linux: chmod +x the installer, run it, click through Welcome -> Configuration -> License -> Installation.- We tried every CLI flag we could think of or find, including patterns used by OTHER ST installers
Hi Team,I am using the STM32C542RC on the STM32C5 Nucleo-64 board (MB2213),What is the max. supported baud rate for the USART baud rate?We have checked that, with STM32CubeMX, the DIV1 prescaler, and oversampling by 16, the maximum supported USART baud rate is 9 Mbit/s, assuming the peripheral clock is configured appropriately.However, in our setup, we are receiving garbage/corrupted data at 1.5 Mbit/s. Communication works correctly at 1 Mbit/s (TX and RX both working at this baud rate), but increasing the baud rate to 1.5 Mbit/s or higher in that case results in receiving garbage/invalid data. The STM32 receiver and the sender are configured with the same UART settings:Baud rate: 1.5 Mbit/sStop bits: 1 (also tested with 2)Parity: NoneWord length: 8 bitsHardware flow control: None Please check the above configuration and let us know how to achieve reliable data on the receiving end at a 1.5 Mbps or higher baud rate. If any additional configuration is required, then please let us know.
I'm trying to use USB SOF for CRS, but CubeMX2 throws an error asking me to enable USB Host. USB SOF for CRS is meant to be used with USB device.
Hi, We are planning to configure PWM generation on the NUCLEO-C542RC board using STM32CubeMX2. Could you please share the steps for configuring the PWM signal? An example project or configuration details would be very helpful.
After generating a CMAKE project using STM32CubeMX2 v1.1.1 followed by setting compiler options to “treat warnings as errors” (-Werror) and enable strict standards-conformance (-Wpedantic) in the root CMakeLists.txt file, I am errors in, mx_def.h. Though this post shows the workaround:What is the recommended C Standard that STM32C5 project should follow? If the generated code stated “gnu11” but yet uses “gnu23”, shouldn’t the generator use the latter instead (see solution)? And, what are the dangers of doing so? Error Message:error: ISO C restricts enumerator values to range of 'int' before C23 Full Error message:[build] C:/PathTo/ProjectName/source/App/generated/hal/mx_def.h:32:38: error: ISO C restricts enumerator values to range of 'int' before C23 [-Werror=pedantic][build] 32 | SYSTEM_OK = 0xEAEAEAEAU, /* System initialization successfully */[build] | ^~~~~~~~~~~[build] C:/PathTo/ProjectName/source
OverviewThis chapter introduces how to use the on-chip DAC of the STM32C5 to generate a fixed analog voltage output. The STM32C5 DAC supports 12-bit/8-bit resolution, external pin output, output buffering, and DMA. In 12-bit mode, the digital input range is 0 to 4095.In this experiment, DAC1 Channel 1 is used, with the analog voltage output through PA4 (DAC1_OUT1). The program calculates the DAC digital value according to the reference voltage and the target output voltage, sets the conversion data using HAL_DAC_SetChannelData(), and then starts the DAC output using HAL_DAC_StartChannel(). Hardware PreparationFirst, prepare a development board. In this example, I use a self-designed development board. Samples can be requested if needed.The main MCU is STM32C542CCT6. Reference CodeGitHub:https://github.com/CoreMaker-lab/STM32C542_SENSOR Creating a Project with STM32CubeMX2In this example, STM32CubeMX2 is used to generate the project, with STM32C542CCT6 selected as the target MCU.
This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.Hello, I am currently facing a strange error when trying to create a project with any MCU/Board on Linux.As shown on the screenshots, an error appears on dependencies download : Unable to find a random port on any host GetPortError: Unable to find a random port on any ... And it spin indefinitly. This error seems to be related to Electron rather than the soft itself, but I can hardly follow the execution path of stm32CubeMX2 to know where I could maybe enforce another port. Did anyone already encountered this bug ? Thanks.
Trying to build a NUCLEO-C562RE project under IAR 9.60.4. Included with the output is an folder, IDEs_patches/EWARM and a readme,md outlining how to add support for the new MPU. But the patch file referenced in it is no where to be found. Searched my local drives, ST’s site, ST’s Community, ST’s github but can’t find “STMicroelectronics.stm32c5xx.2.1.0.iar.zip”I’m glad ST has decide to distribute a patch so I don’t have to upgrade to the latest IAR every time a new CPU comes out (my company tries to use a consistent version across projects) but without the patch file, IAR does not recognize the C564 as a target.
@lbthomsen of STM32World has published a review of the new STM32CubeMX2, what is good (not so much), indifferent and BAD (a lot). He tries to get it working, browse through the features, and has a lot of opinion on this matter. https://www.youtube.com/watch?v=61r83TTzDfk End of the day, IF you plan to use future STM32 families (starting with STM32C5) you have no choice than to use CubeMX2 AND the very painful migration from HAL to HAL2 (not compatible, maybe some future tool can assist in such migration). Even if migration is possible, then you will have the pleasure to support multiple versions of YOUR code on old vs new MCU families. Have FUN. For the people without perfect vision (like myself), embrace yourself for 4 pixels font sizes, and contrast-free dark-white-on-white-backgrounds text. Lovely! At least there is plenty of white space around the text that can sooth your soul. Now is the best time for experienced STM32 shops to leave HAL, CubeMX and go Bare
If i type in 1 as endpoint number, enable double buffering and then later switch to endpoint 0, double buffering is still enabled. Code generator will also generate code with double buffering on endpoint 0.
Despite the peripherals are callable, the code preview from STM32CubeMX2 does not call the init functions of the peripherals.What is the trick to get this done ?We also see in the HAL common settings, the option to toggle generated vs callable is not selectable.Is this something to do with the older version of STM32CubeMX2 v1.1.1 and STM32CubeMX2 v1.0.0 ?Please suggest
Missing Makefile export capability. Missing option to export only minimum necessary files. Unfortunately this leads to bloated projects. The previous version of STM32CubeMX have these features. Clean and self-contain and not bloated project was the main reason to use STM32 in our company.
Hi,I am an electrical engineer designing a circuit for an STM32C532KCU6 microcontroller, and I am using CubeMX2 version 1.1.1 to validate the clock tree.The datasheet offers a 32.768kHz crystal resonator as a source for the LSE.However, in MX2, the configuration screen for the RCC does not allow the LSE to use crystal/ceramic resonator as a source. In addition, the RTC configuration screen shows an error regarding its LSE source.Could you confirm that 32.768KHz crystal resonator is supported by the LSE for this microcontroller, or do we have to use an external oscillator or RC? Thanks,Benny
The new tooling is nice and the UI is much cleaner to navigate with.Positive Feedback @MorkBeck:We love the VS Code direction YES, it would be helpful to get H5 on here as well as it would keep our code bases aligned. AI? No thank you, “focus to stay on reliability, documentation quality, and API maturity”. As anyone savvy knows, AI scrapes those docs anyways. Good docs and samples help a lot.A few of issues we’re running into that are major speed bumps. I don’t know where your bug list is at to report or to see if it’s tracked:Code Generation overwrites our `main.c` EVERY TIME. Yes it’s documented above, yet this is painful. The `*.c.base@x.y.z” files are just absolute clutter! “YAGNI” - You Ain’t Gonna Need It And i can’t disable it either, that option is always grayed out. Upgrading from CubeMX2 v1.01 to 1.1.1 Broke the EXTI configuration screen, and the page NEVER renders. Causes other lack of functionality issues Feel free to reach out to me. Inability to pull Packs dynamica
So I have installed STMCubeMX2 but when creating a project, I cannot choose any MCU other than STM32C I am using MacOS
I have an older v1.0.0 installation that works fine, but the newer v1.1.1 freezes up on launch and does not respond to mouse or keyboard input. 2026-08-14T09:04:40.380Z [Error] Could not initialize contribution TypeError: Cannot read properties of undefined (reading 'onChanged') at g.initializeEventWatchers (file:///home/user/.local/share/STMicroelectronics/STM32CubeMX2_1.1.1/resources/stm32cubemx-application/1.1.1/dist/resources/app/lib/frontend/bundle.js:92134:94886) at g.initialize (file:///home/user/.local/share/STMicroelectronics/STM32CubeMX2_1.1.1/resources/stm32cubemx-application/1.1.1/dist/resources/app/lib/frontend/bundle.js:92134:94735) at file:///home/user/.local/share/STMicroelectronics/STM32CubeMX2_1.1.1/resources/stm32cubemx-application/1.1.1/dist/resources/app/lib/frontend/bundle.js:92524:49789 at r.startAsync (file:///home/user/.local/share/STMicroelectronics/STM32CubeMX2_1.1.1/resources/stm32cubemx-application/1.1.1/dist/resources/app/lib/frontend/bundle.js
Hey,I have some questions. First, why does the installer install the app below ~/Library/Application Support?This location is for the support files of an app, not the app itself. The installer, however, puts everything there, including the .app BundleImprovement: Please move the .app Bundle install location to /Applications or ~/Applications. Supporting files then belong in the aforementioned path. Second, why can the .app Bundle not be started on it’s own? When I open it, it loads a splash screen with a progress bar, but when the app windows comes up all it shows is a loading circle. To really start CubeMX2 you HAVE TO use the startup binary which the installer also provides, but there is currently no way to just start the app from the launcher.This is very bad as it goes completely against the way 99% of how Mac users launch apps. CubeMX1 does this correctly, why is that such a step backwards with CubeMX2 ? Because currently, after installing the app there is no way to start it from
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.