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
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.
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?
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.
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
Greetings for the day,I am working on STMC5 microcontroller and with that since we need to use the STMCubeMX2 for code generation, I end up generating a code that doesn’t have all the peripherals initialised in mx_system.c and not included in mx_hal_def.h. Any idea why that is happening ? Am I missing some configuration in the tool ? It can be seen that mx_hal_def.h doesn’t contain all the peripheral headers. This is the issue.
OverviewThe STM32C542 & SENSOR is an evaluation kit based on the STM32C5 series microcontroller. Built on ST's 40 nm process technology, the STM32C5 offers faster Flash access, higher performance, and lower power consumption.The board also features a rich set of peripherals and interfaces, including dedicated connectors for the ST MEMS sensor (SENSOR) series, providing developers with a convenient and flexible platform for rapid prototyping and application development.In this tutorial, we will perform a simple LED blinking test by configuring a GPIO pin as an output.Hardware PreparationFirst, prepare an STM32C542 development board. In this tutorial, I will use a custom-designed development board. If you are interested in using the same board, feel free to contact me for samples.Main MCU: STM32C542CCT6Reference ProjectThe complete project source code is available on GitHub :GitHub: https://github.com/CoreMaker-lab/STM32C542_SENSOR Creating a Project with STM32CubeMX 2This tutorial u
OverviewIn practical project development and mass-production maintenance, in addition to using ST-LINK for programming, firmware updates are often performed through interfaces such as USART, USB DFU, SPI, or FDCAN. In these cases, the MCU must first enter the factory-programmed System Memory Bootloader before the Flash memory can be programmed through these interfaces. For the STM32C5 series, whether the external BOOT0 pin is used to enter the Bootloader is closely related to the BOOT_SEL setting in the Option Bytes.Simply put, BOOT_SEL is used to select the source of the BOOT0 signal. When BOOT_SEL enables the external BOOT0 pin, the MCU can enter the System Memory Bootloader by pulling BOOT0 high and resetting the device. When BOOT_SEL selects the internal Option Bit, the boot mode is determined by the BOOT0 configuration in the Option Bytes. Therefore, understanding the relationship between BOOT_SEL, the BOOT0 pin, and the System Memory Bootloader is important for subsequent firmwar
OverviewTimers are among the most commonly used peripherals in an MCU. They can be used for periodic timing, PWM generation, input capture, output compare, motor control, and many other applications.This tutorial is based on the STM32C542CCT6. It uses STM32CubeMX2 to configure TIM1 and demonstrates how to modify the prescaler (PSC) and auto-reload register (ARR) using the built-in HAL2 functions, thereby changing the timer output frequency. It also introduces the basic usage of multi-channel PWM output. Hardware PreparationFirst, prepare a development board. In this tutorial, I use a custom-designed development board. If you are interested in obtaining one, you can apply for a sample.The main controller is the STM32C542CCT6. Reference ProjectThe reference project is available on GitHub:https://github.com/CoreMaker-lab/STM32C542_SENSOR Creating a Project with STM32CubeMX2Use STM32CubeMX2 to generate the example project. The MCU used in this tutorial is the STM32C542CCT6. Open STM32Cub
OverviewIn the previous experiment, TIM1 was used to generate PWM output, and the PWM frequency and duty cycle were controlled by modifying the PSC, ARR, and CCR values.Building on that experiment, this article uses the TIM15 input capture function to measure the PWM signal generated by TIM1, thereby detecting its frequency and duty cycle. Hardware PreparationFirst, prepare a development board. In this tutorial, I use a custom-designed development board. If you are interested in obtaining one, you can apply for a sample.The main controller is the STM32C542CCT6. Reference ProjectThe reference project is available on GitHub:https://github.com/CoreMaker-lab/STM32C542_SENSOR UART ConfigurationRefer to the schematic and note that PA9 and PA10 are connected to the UART interface on the development board. In the Peripherals panel, navigate to Connectivity → USART1. Set Mode to Async to configure USART1 for asynchronous communication. Verify that Function used by the component is d
OverviewIn traditional STM32 development, we typically use STM32CubeMX to configure the USART peripheral and redirect printf() to the serial port for debugging output. With the STM32C5 series, ST introduces the new STM32CubeMX2 configuration tool and the HAL2 driver framework. Compared with the legacy HAL, the project structure and some API names have changed, so the UART configuration process and application code require slight modifications accordingly. Hardware PreparationFirst, prepare a development board. In this tutorial, I use a custom-designed development board. If you are interested in obtaining one, you can apply for a sample.The main controller is the STM32C542CCT6. Reference ProjectThe reference project is available on GitHub:https://github.com/CoreMaker-lab/STM32C542_SENSOR Creating a Project with STM32CubeMX2Use STM32CubeMX2 to generate the example project. The MCU used in this tutorial is the STM32C542CCT6. Open STM32CubeMX2 and go to the Home page. Click MCU to creat
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.