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
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
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
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
Product: STM32CubeMX2 (.ioc2)Version: generic Linux 1.1.0Appeared with MCU: STM32C542CCU6HAL package: stm32c5xx_hal_drivers 2.1.0Project type: CMSIS-Toolbox / CMake generationSummary:On STM32C5, four ADC1 external channels (IN2, IN5, IN6, IN7) have an alternate GPIO pad selectable via the SBS_PMCR pin-remap bits (ADC1_IN2_REMAP -> PC4, IN5_REMAP -> PC5, IN6_REMAP -> PB0, IN7_REMAP -> PB1 on STM32C542). CubeMX2's pin configurator lets you assign the remapped pad in the graphical pinout, accepts it, and generates both the GPIO analog-mode config for that pad and the ADC channel/sequencer configuration for the channel. However, it never emits the corresponding SBS_PMCR remap-enable write. The generated firmware therefore samples the default (non-remapped) pad, while the pin the schematic actually uses is left unread.There is no generation warning, no build error, and no runtime fault. The ADC returns a stable, plausible, but wrong 12-bit code. Reproduction:1. Assign ADC1_IN7 t
Split from this post: Dear ST Technical Moderator,(mEALLEm)many thanks for your prompt answer !You actually solved my problem by using CubeMX2 tool,where one can assign selected peripheral pins (in my case COMP2 two inputs and one output)to actual package IO pins.As far as I see, CubeMX2 tool “offered” to make assignment of Comparator Plus input with one of four IO pinsCOMP2_INP:IO1: PA3IO2: PB15IO3: PC0(I want to use PA3) !and Comparator Minus input with one of four IO pinsCOMP2_INM:IO1: PC1IO2: PC5IO3: PA2(I want to use PA2) !it is stated in my text, in the very beginning !... quoteIn new design, where planned MCU is STM32C542CCT6 device, (LQFP48 package),I plan to use internal Comparator COMP2....PA7 pin as Comparator2 Outputand pin PA2 as Comparator2 -INPut, and pin PA3 as Comparator2 +INPut.... unquoteWell, the only problem is that I did not install SW development environment yet,so, I did not use CubeMX2 tool, I was just reading the documentation, RefManual and device DS,and I d
Hello everyone,I’m trying to develop a new project using an STM32C552RET6 with a TFT display.I’d like to use TouchGFX for this, but I can’t find any instructions in CubeMX2 on how to configure a project as a graphical application.I saw some examples in TouchGFX Designer using the STM32C5, but I got the impression that the integration was done manually.So, does anyone know if CubeMX2 has this functionality?Thanks,Matheus
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
Hello,I came across the above guide on ADC interleave mode and attempted to use it on MX2 for the STM32C552VET6, but many of the parameters here listed seem to be invisible to MX2 although it does seem to recognise that I am attempting interleave between the two ADCs. Can an equivalent guide be created for the C5 series?Thanks in advance.
when generating cmake file from CubeMX2, CMakeLists.txt states: cmake_minimum_required(VERSION 3.20) but in fact you need a minimum version of 3.3:
I have loaded the pack for CMSIS and CMSIS-DSP using the Pack Manager in STM32CUBEMX2. However, when generating code in the Project Settings, the CMSIS appears in the Packs Section and is generated in my project directory but the CMSIS-DSP does not appear in the Packs Section and is not generated. I want to use the DSP features but not able to. Any advice?
I see the USBX/FileX/LevelX middlewares are supported in STM32CubeMX2, but ThreadX (formerly AzureRTOS, formerly ThreadX) itself is not? Is ThreadX support on the roadmap for the STM32C5 series? I really don’t want to have to go back to using FreeRTOS.
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.
Hello everyone, I’ve been working for a few weeks on a TouchGFX project using a MCU that is working with CubeMX2, so I used the documentation (Using TouchGFX with STM32CubeMX2 | TouchGFX Documentation) to setup my project, which is working.However I tried to add an SVG Image and then I got the “undefined reference to ‘touchgfx::VectorRenderer::getInstance()’” issue. Normally this issue can be resolved by enabling vector rendering in CubeMX, but because I’m on CubeMX2 it’s not possible in my case.Is there any way to enable vector rendering manually ? Also just to be sure it wasn’t already activated I tried to put a SVG image with the example project that I started with (the NUCLEO-C5A3ZG + RVA15MD project), and I got the same error.MCU used is STM32C552RET6.
Finally was able to test STM32CubeMX2 with a NUCLEO-C562RE board.Simple LED blinking project, and here's what I found out. Project bloat:STM32CubeMX2: 26.2 MB of generated data and when compiled 41.1 MB (NUCLEO-C562RE)STM32CubeMX: 4.6 MB generated and compiled 15.7 MB (NUCLEO-C031C6, same functionality) The old STM32CubeMX included only the HAL libraries actually used.The new one dumps everything in.That's a 5.7x increase for a blink LED. Missing Release configuration:Generated CMake project contains only Debug configuration - No Release.Interesting, because the official "MOOC STM32CubeMX2" video at 4:53 clearly shows both configurations.Either something changed or the video is misleading. Creating Release configuration manually requires editing multiple CMake files, including inside the cmake folder — supposedly overwritten on regeneration (in practice, changed only at project creation).Not trivial if you're not a CMake expert.I did it once manually, but then ended up using Claud
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 previously got CDC via USBX and FreeRTOS working on a custom C542 design, using the examples since CubeMX2 did not support the USBX middleware at that time.I am now trying to port that code to the C562 since I need more memory. This does not work at the moment since I used CubeMX2 for the USBX configuration and setup.So I thought, lets have a look into the examples and see what I am doing wrong.Unfortunately that did not work, or rather the USBX-CDC-FreeRTOS example for the Nucleo-C562RE board using the CMake toolchain does not work.I got "example_usbx_device_cdc_acm_uart_freertos" from "https://dev.st.com/stm32-example-library" for the CMake toolchain.I extracted the ZIP and imported the project in the latest CubeIDE (version 2.2.0; Silicon MAC) and build the project in "release" and "debug" config without errors.However, both version do not setup the USB stack correctly. The user-LED stays on, so everything should run without errors.If I look at the USB communication with a Total P
@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
Even when running stm32cubemx2-1.0.1-X64-Windows-installer.exe as Admin: Failed to add cube-wrapper to PATH: Could not create / read registry 'HKEY_LOCAL_MACHINE\Environment': The parameter is incorrect. (0x80070057) On Windows 11 Pro Installing to C:\Program Files\STMicroelectronics\STM32Cube\MX2\1.0.1
Hi,I am working on a new Project for the STM32C562MET6 with STM32CubeMX2 and VS Code.On the first run of toolchain generation, CubeMX generates all expected folders like arch, generated, stm32c5xx_dfp and stm32c5xx_drivers.But I dont want to version all files if they can be generated so i added the folders above to the .gitignore file.After running it a second time but with those folders missing, CubeMx2 doesnt generate it. I already tried to set the “conflict handling rules” to override. Any suggestions?
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.