Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello STM32CubeMX Support Team,I am writing to request a quality-of-life feature for STM32CubeMX: the ability to choose the line ending format (LF vs. CRLF) for generated project files.Currently, STM32CubeMX aggressively generates files using Windows-style CRLF line endings, regardless of the host operating system. As a developer using Git in a cross-platform environment (specifically Linux), this creates constant and unnecessary friction in version control.Whenever I regenerate code via CubeMX, Git immediately flags dozens of files as modified purely because the line endings were forced back to CRLF. While this can be partially mitigated using .gitattributes or core.autocrlf settings, these workarounds are prone to breaking across different team members' machines, resulting in messy diffs, ruined commit histories, and broken CI/CD pipelines.Proposed Solution: Could you please add a simple toggle or dropdown in the Project Manager > Code Generator settings tab allowing users to sel
Hello ST Community,I am working on a custom STM32-based board and would like to know whether STM32CubeMX provides any official feature to add our own custom board to the Board Selector, similar to ST Discovery, Nucleo, or Evaluation boards.My requirement is that when creating a new project, I should be able to select my custom board and automatically load the default settings such as MCU, pin configuration, clock settings, peripherals, and middleware from a predefined .ioc file.Is this feature officially supported by STM32CubeMX, or is the recommended method to manually create and reuse a base .ioc file for each custom board?Thank you. Vijaya
I'm using STM32N6570-DK board and developing an image processing application.When I tried to use STM32CubeMX to generate the project, I was able to set DCMIPP Pipe1 just like the attached screen capture.I would like to downsize the source image data to 800x480, but I could not find the option field in the DCMIPP Configuration view in STM32CubeMX.Is there something that I missed?My STM32CubeMX is Version 6.16.1 for Windows 11.
Hello,I am using STM32CubeMX with an STM32WBA63 project in TrustZone enabled mode, and I have a question about interrupt security attribution.My use case:PA11 is configured as USART2_RX (non-secure application). In low power mode, I need wakeup on UART RX activity. This relies on EXTI11, so I need EXTI11_IRQn to be targeted to the Non-Secure world (ITNS0 bit 22 = 1).Issue:In CubeMX, I cannot find a way to set EXTI11_IRQn as Non-Secure while PA11 is kept as USART2_RX. EXTI11 appears configurable only if I change the pin function to GPIO EXTI, but then USART2 configuration becomes incomplete.Questions:Is it supported in STM32CubeMX to configure EXTI11_IRQn as Non-Secure when PA11 is assigned to USART2_RX? If yes, where is this setting in the CubeMX UI? If not currently supported, what is the recommended ST approach? Manual USER CODE override in partition configuration? Post-generation patch/script? Any other official best practice? Current workaround:I manually set EXTI11 to Non-Secure
Posted on October 29, 2017 at 01:12Hi all,I would like to report a bug of CubeMX.I did generated simple project for STM32F103VEx. Project if fairly simple just uses USB in CDC mode.I did generate similar project for same processor but only SPI3 using shared pins PB3 and PB4 with JTAG.Each time while I did generated those projects CubeMX forces to distable whole debug communication JTAG +SWDby adding line /**DISABLE: JTAG-DP Disabled and SW-DP Disabled */ __HAL_AFIO_REMAP_SWJ_DISABLE();While SWD could be turned on since it does not conflicts with any of those peripherals. STM32 have options to disable only JTAG or either distable only NRJST pin in JTAG. Why CubeMX forces to kill all of the debug communication ?Simple project attached. Example file located in testCDC/stm32f1xx_hal_msp.c function void HAL_MspInit(void)https://community.st.com/tags♯/?tags=stm32%20cube%20mx https://community.st.com/tags♯/?tags=stm32f103%20usb https://
I’m using CubeMX to generate the code for the STM32H7S7, more preciously the LTDC code that should be the same for Boot and the AppliFor some reason the HAL_LTDC_MspInit is generating different pins configurations for the Appli and the BootFor instance it generates the code for the PIN PF0 ------> LTDC_R2 in the boot meanwhile in the Appli there’s no PF0I would like to attach my .ico but it seems there’s no attach option in the new community UI
I tried for several days to download the STM32CubeMX but the download just breaks.Most of the time the download panel just circles around for even or if it comes up it just breaks mid download.I also tried with different users and different browser and also in incognito mode but with the same result.I even made ticket on it but it doesn’t seem that anybody cares and I ask the robot to report it to a human but it just guides in the support side. So it seems that nobody care in this company to fix the problem. Best regardsCasten
I’m in the process of moving a project from Standalone STM32CubeIDE to the STM32Cude for VSCode extension. I fully expected project and configuration changes, but not changes to the source code.However, if I just change the Toolchain / IDE setting from STMCubeIDE to CMake and regenerate the code I see changes to the Core/Src/syscalls.c and Core/Src/sysmem.c. files.For example, the CMake versions of syscall.c and symem.c seems to be an older version based on Copyright being 2025, while STM32CubeIDE version is 2026 (see below).I also notice I get a very different linker files; different names and content (and again the CMake Copyright date is older).Why is this? Is this a bug, or an indication that the two generators have diverged and the Cmake version is not being kept up-to-date?This potentially negates some of my testing, as it goes against my assumption that moving to VSCode will not change the build ‘because it uses the same code and same toolchain’. This is the diff for syscall
Code generated by CubeMX use Windows line-endings, which generate huge problems under other operating systems (repository, editors, etc.). You have to strip CR-LFs after every code generation.Somebody should use standard method of platform-independent text file generation (StringBuffer and System.lineSeparator()).
I have an stm cube project that usesSTM32H755ZIQ CMAKE ST-CLANG as compiler VS code with st pluging as IDEI want to add CMSIS DSP libraries, but it look like complete nightmare since there are bunch of topics for older versions and stm cube ide and some open, but not finished version for cmake/vs code.Is there an official instruction how to do it?I tried to add it as .pack from CMSIS and as X-CUBE-ALGOBUILD DSP library, but both did not compile
Is there any way to correctly specify the baud rate for different UARTs in STM32CubeMX?I am currently using: STM32CubeMX V6.17.0 with STM32Cube_FW_H5_V1.6.0I wanted to set the baud rate to 9600 for LPUART1, UART4, and USART2.However, this isn't working; all three UARTs are outputting the same incorrect baud rate based on the calculated divider.Instead of 9600 baud, transmission occurs at 3075 baud (a factor of 3.12195121951219512195:1 too slow).The external 25 MHz HSE oscillator is used as the clock source (original from the Nucleo Board).PLL2Q is used as the clock source for each of the UARTs.I have already tried the following:Updating STM32CubeMX, Updating STM32Cube_FW_H5, Changing the UART clock from 250 MHz to 25 MHz and 5 MHz, Changing the baud rate from 9600 to 19200.When I initialize the UARTs at 19200, they all transmit at 6150 baud.The project was previously built using MX V6.16 and STM32Cube_FW_H5_V1.5.0/V1.5.1, but the problem persisted.Does anyone know how to correctly set
Hi,there has been some interest in using STM32CubeMX code generation and also the Cube build tools (CMake, GCC, Ninja) in a headless mode, particularly for CI and typically via a Docker image, e.g. 1, 2, 3, 4. There are several benefits of being able to build STM32 projects automatically via CI, including specifically the code generation by STM32CubeMX, and to achieve this by using a Docker image:The CI setup acts as a "single source of truth" for the build process that defines the exact setup of tools needed, in contrast to some "random" collection of tools that happens to be installed on an individual developer's PCTherefore the CI also defines if a project's state or e.g. merge request is compilable; if it doesn't build on the CI, don't accept the change. No more "works on my machine" (at least regarding the build process)If the CI-based build is performed through Docker, the Docker image (and its Dockerfile) act as a documentation of the exact tools and versions
There are 3 bugs reported here:Bug 1:In the FileX parameters GUI, under SRAM Disk Driver: The range for the "SRAM Disk Size" is wrong. The Address space allows for 256MBytes, not 256KBytes.Workaround - After CubeMX regenerates the code, I have to change the #define manually in the code.Seems to work on my board with 64Mb, (in the example below I have the base address set to C0200000 and using the upper 32MB)Bug-2Under "Software Packs", when we select "LevelX NOR custom inferface", CubeMX doesn't seem to do anything. We are unable to select the "File System Interface" in the parameters table:If you unselect the LevelX QuadSPI memory interface,The majority of the configuration parameters in LevelX disappear, but is left with an unselectable option (MT25TL01GBug-3Since the Custom driver option does not work in CubeMX, we tried to modify the QSPI driver with the MT25TL01G component. The problem is there are no " USER COMMENT" sections in the entire file, so w
When configuring multiple FDCAN instances in CubeMx, the clock divider settings are not synchronised and are generated twice. For me, FDCAN1 clock divider has the drop down box with multiple options.FDCAN2 only has the "Divide kernel clock by 1" option. This should match FDCAN1 as one common clock divider value. "The clock is common to all FDCAN instances. This parameter is applied only at initialisation of first FDCAN instance." from UM2570.The first issue is within CubeMx, this clock divider value is then used for the indicator calculations:- Nominal Time Quantum- Nominal Time for One Bit- Nominal Baud RateIf the clock values are wrong, these values will be wrong.Second issue is the Init.ClockDivider code is generated twice, one per instance instead of just once.If these values are the same, there'll be no issue. If different then the latter will overwrite the former. In main.c MX_FDCAN1_Init(); MX_FDCAN2_Init(); in fdcan.c void MX_FDCAN1_Init(void) { /* USER CODE END FDCAN1_Init 1
Hello,the STM32G474RBTx CubeMX Clock Configuration ADC1_2 and ADC3_4_5 are swapped - the ADC1_2 Mux is actually referring to the ADC3_4_5 Mux, at least when it comes to the subsequent divider options in the respective ADC configurations.Setting ADC12 Mux to PLLP with e.g. 48.57 MHz allows me to put ADC3_4_5 into ASYNC_DIV_1, whereas the ADC3_4_5 Clock Mux is set to SYSCLK with 170MHz. ADC12 cannot use ASYNC_DIV_1 or 2, even though they should be able to.It also happens the other way around.I am using CubeMX 6.17.0 with the G4 package version 1.6.3
I'm using STM32CubeMX 6.17.0 with NUCLEO-U575ZI-Q, it generated the following code:/* Initialize COM1 port (115200, 8 bits (7-bit data + 1 stop bit), no parity */ BspCOMInit.BaudRate = 115200; BspCOMInit.WordLength = COM_WORDLENGTH_8B; BspCOMInit.StopBits = COM_STOPBITS_1; BspCOMInit.Parity = COM_PARITY_NONE; BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;The comment is wrong, the UART has 8 bits of data instead of 7 bits.
i am installed cube-MX for linux laptop version (6.17.0) and cube-IDE is (Version: 2.1.1) .For MX it shows option only generlic linux so it is correct for linux laptop ? and for IDE is debian is fine . I refer you tube sessions for Example import in that STM32IDE option availbale as toolchain but in my system sometimes not shows . Can you please give me exact steps how can i use Mx with IDE in detail steps for import examples given by stm32 also how can i create and import new example also . Also i have board STM32-NUCLEO-F746ZG when i import example in MX sometimes board is not visible .For toolchain selection below options are availble in that STM32IDE is invisible .
When generating a CMake-based STM32 project, STM32CubeMX currently lists every single .c source file manually in CMakeLists.txt. This brings major inconvenience for users:When adding user drivers (e.g., sensor, flash, display, or custom modules), users must manually edit CMakeLists.txt and add each new .c file path.If the user adds many source files, this process is error-prone and inefficient.It does not match modern CMake project practices and reduces project maintainability. Suggestion:Please use file(GLOB_RECURSE ...) to automatically include source files from standard directories such as:Core/Inc/*.hCore/Src/*.c
Hi all,I'm running standalone STM32CubeMX on Debian and I'm having trouble generating a complete project. No matter what I do, code generation only produces three items:- led_test.ioc- Inc/ folder- Src/ folder I'm expecting a full project structure including Core/, Drivers/, startup files, and a .launch file for STM32CubeIDE.Steps I've already tried:1. Selected the NUCLEO-F334R8 from the Board Selector (not the MCU).2. Clicked Yes to initialize all peripherals with default settings.3. In the Project Manager tab, set the Toolchain / IDE to STM32CubeIDE before generating.4. Clicked Generate Code — same incomplete output every time.Has anyone run into this on Debian? Is this a known bug with the standalone CubeMX on Linux, or am I missing a step? Any advice appreciated.ThanksI've attached screenshots of my CubeMX configurations settings below:
Hi there, im using Nucleo-F446RE , ST HAL and CubeMX, and im learning to configure the clockI use HSE Bypass mode (MCO from the st-link in the nucleo), everything perfect hereIn the RM i found out that, when using HSE BYPASS mode, PH1 (OSC_OU) should be left in HI-Z state What does HI-Z means in STM32 MCUs? does it mean configuring the pin as digital input? or it means configuring the pin as analog input?Or it depends? When selecting HSE BYPASS MODE the chip image in the .ioc file gets set like this: But if i try to set PH1 (OSC_OUT) as GPIO a conflict is generated, so, how can i set the state of PH1 as HI-Z? Also, why does PH1 gets reserved and configured in the chip as OSC_OUT? is this to avoid configuring it as another thing?And finally, what it seems very weird to me, why the clock por GPIOH is enabled when CubeMX generates the code if i cant use PH1 as a normal GPIO? (im not using any other PHx PIN) Thanks in advance and sorry for the english, not a n
With the recent split of STM32CubeIDE and STM32CubeMX, I'd like to propose a dark mode option be added to STM32CubeMX.In consideration of the competing priorities for STM's software development team, I have two suggestions for how this proposal could be implemented:The first suggestion is the typical route: STM's in-house software development team add the UI theming and inputs to switch between dark and light mode.The second suggestion is less typical: make STM32CubeMX open source and let the larger software community assist with adding dark mode. Perhaps the source could be placed alongside other repositories in STM's current GitHub account....The benefits of adding such an option would be as follows:Consistency with STM32CubeIDE, from which STM32CubeMX was split from (STM32CubeIDE already has a dark mode)Consistency with the vast majority of other software in the industryConsistency with what has become a common user experience across operating systems, browsers, and setups in g
Hello, I'm trying to configure my SAI to receive TDM packets from my external ADC. For some reason, no matter what sample rate I choose, the real audio and error between selected is always 0. I've tried changing the clocks to the SAI1 module to 50 and 100 MHz, but it didn't change anything. Is this a visual bug with CubeMX or is it something with how I'm configuring the peripheral? Thanks.
Hello,I would like to request an enhancement to the search functionality in STM32CubeMX's pinout view.Currently, the search works well for exact or partial matches — for example, typing "usart1_rx" highlights the relevant pins. However, it would be very useful to support wildcard characters, allowing searches such as:- usart?_rx — match RX pins across all USART peripherals (USART1, USART2, etc.)- usart1_?x — match both RX and TX on USART1- *art*_?x — match all RX and TX signals on LPUART, UART, USARTThis would be especially helpful on larger packages with many peripherals, where you want to quickly visualize all pins serving a particular role across multiple instances of the same peripheral.The implementation complexity should be low — this is essentially replacing the existing string match with a simple wildcard pattern matcher against the same search index.Thank you for considering this improvement!
Hi communityI found a missconfiguration in CubeMX while using a MCU TFT with FMC.Description:Device: STM32N6 (STM32N645B0HxQ) / Cortex-M55CubeMX Version: v6.17.0Peripheral: FMC, LCD Interface, 16-bit data width, A16 as RS/DC (Register Select)Symptom: A single WriteCommand() call (one STRH instruction to 0x60000000) produces 3 WR pulses on the oscilloscope instead of 1. The LCD display remains gray despite a correct initialization sequence. All FMC timing parameters and Write FIFO settings were verified and are not the cause.Root Cause: The Cortex-M55 (ARMv8-M) treats 0x60000000 as Normal Memory by default. This allows the CPU to merge and reorder 16-bit write accesses into 64-bit bursts, resulting in multiple spurious WR pulses on the FMC bus. The LCD controller receives garbage data and cannot render anything.Solution: Manually configuring an MPU region for 0x60000000–0x63FFFFFF as Device nGnRnE memory resolves the issue immediately. After applying the MPU config, exactly 1 WR pu
Hello Community,I'm working on a storage module using SDcard for my project. In my application I would like to read and write to the SDcard using the MDMA as indicated in the reference manual of my micro-controller. For now I have the SDcard working in 4-bit mode but using the CPU.I use the STM32H757II on a PCB connected to a SDcard reader on the same PCB.With CubeMX I generated the code that allow me to mount a FATFS on my microcontroller and I can create/open/write/read on file with no problem.But my application needs to log a lot of data to the sdcard periodically, to free-up the CPU I would like to do the transfer using a DMA.In the reference manual 58.5.7 MDMA request generation it is explained that the MDMA can control the SDMMC peripheral to start new transfer"The internal trigger lines from the SDMMC allow passing direct request to MDMA controllerto enable successive transfers from/to different internal RAM addresses without CPU use. [...]The event can trigger the clearance of
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.