Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
STM32CubeMX v6.17.0While configuring an STM32CubeMX project for an STM32H753 Ethernet project on a NUCLEO-H753ZI, I observed some strange behavior.After enabling memory management, including the checkboxes- Apply Application Regions Settings to Peripherals and- Apply Application Regions Settings to Linker Files,I would have expected the memory regions to be included in the linker description file STM32H753XX_FLASH.ld.Unfortunately, this was not the case.However, since the STM32H753XX_FLASH.ld file had obviously been regenerated, I did not suspect the file handling itself.After several hours of searching, I discovered that if the .ld file is deleted before regeneration, different content is generated.Steps to reproduce this:Open STM32CubeMXFile / New Project… / Board SelectorSelect NUCLEO-H753ZIIn „Board Project Options“ dialog, click button „Unselect All“Set Project Manager / Project / Toolchain / IDE to CMakeand Default Compiler/Linker to ST Arm ClangFile / Save ProjectGenerate
I am working with a custom board populated with an STM32H7S7L8H6H and a hyperbus flash S26HS01GTGABHB030 connected on XSPI1.My intent is to execute in place on the hyperbus flash but have not been successful thus far.Interestingly I cannot select CONFIG_8LINES for the Memory 1 configuration in CubeMX.
There is a critical code-generation template bug in STM32CubeMX (reproduced in 6.16.1 with STM32CubeH7) when generating USB Device middleware configurations. In the generated usbd_desc.c file, the Get_SerialNum() function is generated with uninitialized local variables that are then used in arithmetic operations.This results in Undefined Behavior (UB). It compiles and works under -O0 because the uninitialized stack happens to evaluate to zero, but it causes an immediate, silent HardFault/BusFault during USB enumeration on Windows when compiled with -O1 or -O2 optimizationsoriginal generated code static void Get_SerialNum(void){ uint32_t deviceserial0; // Uninitialized uint32_t deviceserial1; // Uninitialized uint32_t deviceserial2; // Uninitialized // ST's generator template completely misses the lines assigning the registers! deviceserial0 += deviceserial2; // Undefined Behavior: addition on uninitialized variables if (deviceserial0 != 0) { IntToUnicode(deviceserial0, &U
I have a project that was using an STM32WB55RG. I copied & pasted this project in Cube then opened up the IOC in MX & managed to retarget to an STM32WB55GC. But I now notice that the original project has also been retargeted.So I tried to retarget it back to an STM32WB55RG in MX but the pinout compatible dialogue just hangs at 75%, see below. So what are my options here? Do I have to open up a new project from scratch & abandon my retargeting via MX?
Using an STM32H7Rx or Sx, with both I2C2 and I2C3 in use, and clocked by PLL3R:Cube correctly configures I2C2. However, it doesn't seem to be aware that I2C2 and I2C3 share a clock, so it:incorrectly computes the timing for I2C3, as if it were using PCLK1 (the default), in MX_I2C3_Init();fails to insert the line "PeriphClkInit.I2c23ClockSelection = RCC_I2C23CLKSOURCE_PLL3R;" in the init code for I2C3, in HAL_I2C_MspInit(). This sets both I2C channels back to PCLK1, thereby breaking I2C2 as well.(I didn't try the other clock sources - HSI and CSI - but it's possible that they too don't work for I2C3.)Fortunately, it is possible to manually add the correct code in the user areas immediately after the two sections of affected code, so there is a workaround for now.
Hello ST Community,I would like to report a potential discrepancy I have discovered between the pin definitions in STM32CubeMX and the official datasheet for the STM32N6 series, specifically concerning the Serial Wire Output (SWO) signal used for debugging (SWV/ITM). This issue led to a hardware design error on my part, and I believe it warrants clarification to prevent others from encountering the same problem.According to the STM32N647xx datasheet (and related family documents), the SWO function is assigned to Pin PB5, The TRACECLK function is assigned to Pin PB3However, within STM32CubeMX (I am using version 6.16.1)(N6 MCU package version 1.3.0), the graphical pinout view shows that Pin PB3 is also listed with the "DEBUG-JTDO-SWO" functionality. More importantly, when configuring the debug port in the "SYS" settings (e.g., selecting "Trace Asynchronous Sw"), the software automatically assigns the SWO signal to PB3.Trusting the configuration tool, I proceeded to design my PCB wi
On STM32CubeMX 6.16, STM32N6 package 1.3.0, APB frequency limit is shown as 400MHz instead of 200MHz.AHB is correctly shown as 200MHz
Hi, I'm trying to access SD cards with an STM32C091 MCU. It seems like FatFS is not supported by default in CubeMX, therefore I looked into FileX. I don't have a need for running an RTOS, so I would like to run FileX in standalone mode. However, the FileX parameters in CubeMX don't contain FX_STANDALONE_ENABLE (see attached). Can anyone offer some insight into the topic? Thanks you for your time and effort. :)
In CubeMX Version 6.17.0, for STM32G474RET6, HRTIM1, TIMA output2 configuration, set sources is forced to 0 cannot be changed to 1 and it is showing "Set Sources: nothing to set as Dead Time is enabled, Output2 signal is defined based on Output1 Configuration Set Sources" even if Dead time is kept disabled. This issue was not present on previous versions of CubeMX.
I am a long-time STM32CubeMX user (7+ years). I ran into an issue with STM32CubeMX recently while modifying an existing configuration for an STM32L4 project. This is a usability issue.In the NVIC configuration page, there are two tabs, one labeled "NVIC", the other labelled "Code Generation". In the NVIC tab there is a column labelled "Enabled". The issue is with the word "Enabled" -- it has a clear meaning with regard to interrupts. I wanted the interrupt handler created, but I wanted the code generated with the interrupt disabled. I made the mistake of disabling "Enabled" in the NVIC tab, initially ignoring the "Code Generation" tab. The result was that the interrupt handlers, along with my user code, was removed from the stm32l4xx_it.c file. (I had it in source control, so nothing was lost.)"Enabled" on the NVIC tab means that the interrupt is used and a candidate for code generation. The selection I wanted is on the "Code Generation" tab labelled "Generate Enable in Init". The word
missing --start-group around WBA2_LinkLayer_BLE_Full_lib.EnvironmentSTM32CubeMX version: 6.17.0STM32CubeWBA firmware package: 1.9.0Target device: STM32WBA25CG (NUCLEO-48 board)Toolchain: GNU Tools for STM32 14.3.1+st.2 (arm-none-eabi-gcc/ld)Build system: CMake (toolchain selected via "CMake" in CubeMX project settings)Host OS: Windows 11Steps to reproduceCreate a new STM32CubeMX project for STM32WBA25 (NUCLEO board).Enable BLE (peripheral role, BLE_Full stack).In Project Manager → Toolchain/IDE, select CMake.Generate code.Build with the generated CMakeLists (e.g. cube-cmake --build build/Debug).Expected Build links cleanly.Actual Link fails with:ld.exe: stm32wba_ble_stack_full.a(le_ctrl.o): in function `LECTRL_LL_Init': le_ctrl.c:(.text.LECTRL_LL_Init+0xa): undefined reference to `ll_ble_events_init' ld.exe: (ll_ble_events_init): Unknown destination type (ARM/Thumb) in stm32wba_ble_stack_full.a(le_ctrl.o) le_ctrl.c:(.text.LECTRL_LL_Init+0xa): dangerous relocation: unsuppor
Hello EveryoneI am using CubeMX 6.17.0 and Embedded Software Package STM32H5 1.6.0:Is there a control missing to setup "Trigger Output (TRGO) Parameters? In comparison to e.g. Tim15:
Hello,For one of my project, my goal is to use PTP to synchronise multiple STM32H563 to one host.However, when configuring the ETH Device, I can only enable RMII, as the "RMII_PTP_SYNCHRO" is greyed out.I've read the pop up that tells me to enable TIM2 as a slave with trigger source "ETR1 through Remap", Channel 1 as "Input Capture direct mode from Remap". And both "remap capabilities" are set to "is connected to ETH_PPS".Is there something that I'm missing ?Best regards
Hi everyone,the update to CubeMX 6.17 seems to introduce a new valid range of the "First RX Descriptor Address" of the Ethernet setup on a NucleoH755 board. This is also the case for the STM32H745.This is the valid range according to the CubeMX field description (there is also a typo for the Parameter Description "Fisrt"):First Rx Descriptor AddressFirst Rx Descriptor Address must be between 0x24000000 and 0x30047fff.Parameter Description:Fisrt Rx Descriptor address must be only in the D2 Domain AHB SRAM. Rx descriptor address must not exceed Max value and must no overlap with Tx descriptor and Rx buffer. These areas must not be cacheable.This contradicts the knowledge base article: How to create a project for STM32H7 with Ethernet and LwIP stack working The reference manual also states that 0x3004000 - 0x3004FFFF should be part of the D2 Domain AHB SRAM3 and hence be part of the intended area. Is this just a bug or do I overlook something?Kind regards
With the attached ioc, CubeMx 6.17.0 freezes when I click on "Generate Code" on macos 14.8.3 . If I start it from the command line I can see this error in the console:2026-03-09 17:20:52,902 [INFO] UtilMem:75 - End SaveConfig() Used Memory: 550133736 Bytes (1459617792)2026-03-09 17:20:52,976 [INFO] UtilMem:75 - End SaveConfig() Used Memory: 580273760 Bytes (1459617792)2026-03-09 17:20:53,182 [INFO] ProjectBuilder:603 - [PM] Start Project Generation Thread2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plugin: RCC2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plugin: I2C2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plugin: I2C2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plugin: USART2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plugin: MEMORYMAP2026-03-09 17:20:53,207 [INFO] IPsOverviews:2785 - set Specific Code input for plug
Hi everyone,I think STM32CubeMX is generating an incorrect configuration for STM32L071.In CubeMX → System Core → SYS → System power supply,I selected Power Regulator = SMPS (instead of LDO) and generated the project.After code generation, I get build errors because CubeMX inserts code that does not exist for this device / HAL package:In stm32l0xx_hal_msp.c, I see references like: HAL_PWREx_ConfigSupply(...) PWR_SMPS_SUPPLY But for STM32L0 / my CubeL0 HAL, these are not definedMy version is :
When choosing SmartCard mode for USART, parameter Parity is automatically set to Even. However generated code in usart.c, does not has:hsmartcard1.Init.Parity = SMARTCARD_PARITY_EVEN;Only when I manually reselect that in GUI, the parity will be set in the generated code.I am using Nucleo-G0B1RE.
Hello,I have been trying to configure the ethernet RMII with PTP synchro on cube MX. The idea is to link the PPS signal to trigger the timer. I can't manage to get the remap to be done to the ETH_PTP_PPS as is not displayed in the dropdown. According to the same cube mx that option should appear. On a side note when I enable the RMII_PTP_syncro I also loose all the config information of ethernet which i find rather strange. Do any of you have any suggestions on what's the proper way of configuring this? Is this even possible or is just a bug of the prompt that implies is possible? Thanks in advance ;)
Hello, Began learning STM32 MCUs with my Nucleo-H753ZI board and I think I found a bug. The IO configurator on CubeIDE thinks user LED2 is on PB7 and is blue coloured. I'll paste the code it generates below. But in fact, the user manual UM2407 says user LED2 is on PE1 and is yellow coloured, which is indeed correct. Generated code from CubeIDE for Nucleo-H753ZI:#define LED2_PIN GPIO_PIN_7 #define LED2_GPIO_PORT GPIOB Appears to be a bug that should be fixed in the BSP.
HiAccording to the reference manual the high-cycle capable Flash of a STM32H562 is mapped to the address 0x0900_0000 to 0x0901_7FFF. The Memory Management Tool of CubeMX does not allow me to generate a Region in this address range (see Error below). Is this correct or should CubeMX not allow the generation of a memory region in this range? The Flash Option Byte was configured for the use of the high-cycle Flash.As a work around I can of course manually edit the linker script.I use STM32CubeMX Version 6.14 with the Firmware Package V1.5.0 to generate a STM32CubeIDE project on Windows 11.
Downloaded the update of STM32CubeMX 6.17.0 to install the ARM version on my M4 MacBook Air with macOS Tahoe. The issue is that it installs an Intel version and not an ARM version. I uninstalled version 6.16 before installing this updated version.The installer file was SetupSTM32CubeMX-6.17.0-Mac-ARM.app.tar downloaded from the STM32CubeMX download page.The next macOS version after Tahoe will not support Intel apps and was expecting an Apple Silicon version as per the download!What is up with this?
Cross selector displays operation frequency of STM32H743II as 400MHz, but it should be 480MHz. I've refreshed all data and databases but the result is the same. Is there a known solution for this issue?
Cube MX v6.17.0 and even previous version v6.16.1 have a problem generating SystemIsolation_Config for STM32N6.I made a test IOC file. There are 3 SECURE checkboxes checked in RIF -> RIF Aware IPs -> EXTI1:Line 13 for EXTI13Line 17 for RTC secure-wakeupLine 62 for Wake-up PIN3Screenshot: Generated SystemIsolation_Config(void) in main.c of FSBL contains: /* set up EXTI configuration */ /* EXTI13 line */ HAL_EXTI_ConfigLineAttributes(13,EXTI_LINE_SEC|EXTI_LINE_NPRIV); /* RTC secure wake-up line */ HAL_EXTI_ConfigLineAttributes(17,EXTI_LINE_SEC|EXTI_LINE_NPRIV); /* Wake-up_PIN3 line */ HAL_EXTI_ConfigLineAttributes(62,EXTI_LINE_SEC|EXTI_LINE_NPRIV);These calls fail in this assert in stm32n6xx_hal_exti.c: assert_param(IS_EXTI_LINE(ExtiLine));Full assert is turned on in IOC so it lands in assert_failed.The assert condition check macro is very messy, but it appears like it expects type and register mask with it so I added them (based on table 138. EXTI line connec
在使用最新版本的CubeMX 6.17.0 配置STM32G474QETx系列的HRTIM时,Dead Time明明没有启用,但是显示TA2的置位输出源无法配置。
All related to the deadtime settings are disabled, but the Set Source of Output 2 can't be set up. It keeps constant 0, and says the deadtime is enabled? why??? @Aimen1
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.