Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am trying to do tcp client application with stm32n6570-dk board and when I select RGMII mode in ETH1, ethernet interface is grayed out in network interface settings in netxduo. How can I fix it? Cube IDE versiyon is 1.19.0, CubeMX version is 6.15.0 -RC7.
Hello ST team,I would like to report a pin mapping issue in STM32CubeMX when configuring the LTDC peripheral in RGB666 (18-bit) mode, especially on STM32H750 (and other STM32H7 devices).Problem descriptionWhen selecting RGB666 (18 bits) as the LTDC color format, CubeMX automatically assigns 7 bits to the Red channel instead of 6.Example of generated mapping: RED: R1–R7 ← 7 bits GREEN: G2–G7BLUE: B2–B7 This results in a RGB766 (19-bit) configuration, which is invalid for the LTDC hardware.The correct mapping for RGB666 should be: RED: R2–R7 :white_heavy_check_mark:GREEN: G2–G7 :white_heavy_check_mark:BLUE: B2–B7 :white_heavy_check_mark:
I generated an STM32 project using STM32CubeMX for Keil (MDK-ARM).In Keil, functions like HAL_GPIO_TogglePin() don’t show up in code completion (IntelliSense).I found that in Project → Options for Target → C/C++ → Include Paths, the paths use / (for example ../Drivers/STM32F1xx_HAL_Driver/Inc) instead of \.If I manually change / to \, code completion works — but STM32CubeMX changes them back after every code regeneration.How can I permanently fix or configure STM32CubeMX to generate Windows-style include paths (\) for Keil projects?
In STM32CubeMX 6.15.0 / Win11 I generate a default CMake project for the Nucleo-G431KB board.The generated cmake/stm32cubemx/CMakeLists.txt contains:# STM32CubeMX generated symbols (macros) set(MX_Defines_Syms USE_NUCLEO_64 USE_HAL_DRIVER STM32G431xx $<$<CONFIG:Debug>:DEBUG> )but the board is a Nucleo-32, not 64. As a consequence, pinout is wrong, like a wrong pin for the USER_LED is assumed.hthKnarfB
Hi, good evening. I'm currently working with STM32CubeMX (version 6.15.0). I've configured the main options, pin assignment, generated the .ioc file, but I cannot create the code.Once I click on 'create code' I get stuck here:Fyi, the .ioc file is in the same directory as the firmware, i.e. C:/Users/matte/STM32Cube/Repository/Also, the .ioc file is in the same disk as the program.Finally, I've deleted the .stm32cubemx folder, as I've seen others did, in an effort to solve a similar problem. Same behaviour if I try togenerate code from STM32CubeIDE: Is this something you've encountered already ? Thank you very much !
Background: I am trying to bring up simultaneous operation of both FDCAN peripherals on an STM32G0, but due to a combination of unfamiliarity with the clock internals, and a misleading baud rate calculator, I spent a while trying to debug what I thought was a non-functioning FDCAN2 peripheral, but was actually working at an unexpected frequency. FDCAN1 configuration: FDCAN2 configuration (noting that the prescaler is 8, while the clock divider is 1): with this configuration, FDCAN2 transmission works as expected (verified using a PEAK CAN dongle) at 250kbaud when I am running it on its own in normal operation -- started the FDCAN2 peripheral using HAL_FDCAN_Start(&hfdcan2). However, if I also start FDCAN1, then I can no longer read any transmissions from my CAN dongle. After unsuccessfully attempting to debug the issue in firmware, probing my CAN lines revealed that FDCAN2 was operating at 30kbuad (250k/8 = 30k). Going back at the CubeMX configuration, I tried changin
在32位中,字的单位应该要*4吧?为什么这里直接是按字节赋值???坑死我了 Translation: "In 32-bit, the word unit should be * 4, right? Why is it assigned directly by byte here? ? ?" Edited by ST moderator to be inline with the community rules. In next time please write in English as it's an international community. Thank you for your understanding.
When I upgraded to STM32CubeMx version 6.15.0, my project that uses FatFs added a call to HAL_SD_Init() inside MX_SDMMC1_SD_Init() when I regenerated code:This is incorrect behavior because the FatFs library calls HAL_SD_Init() from BSP_SD_Init if the SD card is present, based on the configured Detect_SDIO pin in the CubeMx Platform settings. The newly generated code in version 6.15 causes the ErrorHandler() to be called on power-up if there is no SD card attached.I'm using an STM32H7B3. I attached an example ioc file that shows this issue. The code was correct in version 6.14
Dear STMicroelectronics Support Team,I hope this message finds you well.I am currently working with an STM32WB series microcontroller and using STM32CubeMX (version [insert version number]) for configuration.While setting up the project, I noticed that the STM32_WPAN middleware component is grayed out and cannot be selected or enabled.I have verified that the correct MCU/board is chosen and that the project is properly configured for wireless features. However, the WPAN stack remains unavailable in the MX configuration interface.Details:MCU/Board: STM32WB5MMGHx STM32CubeMX Version: 6.15.0STM32Cube Firmware Package: v1.23.0IPCC : ActivatedHSEM : ActivatedRCC : HSE + LSERF : Activate RFObserved behavior: “STM32_WPAN” option is grayed out and cannot be selected.Expected behavior: The STM32_WPAN middleware should be selectable to configure wireless stack features.Could you please advise what might cause this and how I can enable or access the WPAN middleware in CubeMX?Thank
I may have found a CubeMX migration bug. I'm using version 6.14.1.I am developing a product based on the STM32G0B1 subfamily. The original MCU is STM32G0B1KBU6 which has 128K Flash.I need more flash, so I need to migrate the source code to the STM32G0B1KEU6, which has 512K Flash. The other functionality (e.g. pin outs, peripherals) are identical.To migrate the CubeMX project, This procedure was followed:https://community.st.com/t5/stm32-mcus/how-to-switch-from-one-stm32-to-another-using-stm32cubemx/ta-p/49884That post, which was posted by an ST Employee, was updated on August 6, 2025 (less than three months ago).I was able to import my existing KBU6 CubeMX project into a new project that targeted the KEU6 MCU. When I clicked GENERATE CODE, it eventually gave me this error dialog:EclipsecAn error has occurred. See the log fileC:\Users\XXXXX\.stm32cubeide\workspace_7364571360629961633\metadata\.log.That log file fairly short, it's at the bottom of this post. I was still able to
When generating code with CubeMx version 6.15.0 there is a bug.No ClockPrescaler setting is found in the generaded code at the UART'SMCU: STM32H563Peripherals: USART1,2,3 and LPUART1When you generated the Code, a ClockPrescaler was not generated (missing).The Code goes in Error-Handler, because Prescaler is 1 by default. /** * @brief LPUART1 Initialization Function * @PAram None * @retval None */ static void MX_LPUART1_UART_Init(void) { /* USER CODE BEGIN LPUART1_Init 0 */ /* USER CODE END LPUART1_Init 0 */ /* USER CODE BEGIN LPUART1_Init 1 */ // #### THIS WAS NOT GENERATED by STM32CubeMX: #### // #### Code goes in Error_Handler #### hlpuart1.Init.ClockPrescaler = UART_PRESCALER_DIV16; /* USER CODE END LPUART1_Init 1 */ hlpuart1.Instance = LPUART1; hlpuart1.Init.BaudRate = 9600; hlpuart1.Init.WordLength = UART_WORDLENGTH_8B; hlpuart1.Init.StopBits = UART_STOPBITS_1; hlpuart1.Init.Parity = UART_PARITY_NONE; hlpuart1.Init.Mode = UART_MODE_TX_RX; hlpu
HelloHRTIM´s ADC Triggers post scalers on STM32G474 have 5 bits (0..31) , but in CubeMX you can set 10 bits (0..1048575). Upper bits are trimed so it can be confusing when you set value above 31. My versions:STM32CubeMX Version: 6.15.0-RC7 Build: 20250701-1659 (UTC)STM32Cube MCU Package for STM32G4 Series 1.6.1STM32CubeIDE Version: 1.19.0
When I select IO pin swap in CubeMX, the LL SPI initialization code does not update the pin swap register.Using H5 Nucleo board and LL HAL. Easy workaround if you know to look for it.
Hello all, I recently install CubeIDE and I want to do a blinky example on the User led for the nucleo-U545REI see that the GPIO for the USER LED is PA5 So in cubeIDE, I open CubeMX, configure PA5 PIN TO GPIO_OUTPUT and try to generate the code by clicking on the button "Device configuration tool Code Generation", but nothing happens Can someone explain me why the generation is not working ? Thanks
When I try and enable UART5 in the .n657_dk2.ioc file, the development system seems to go into an infinite loop with the mouse cursor spinning endlessly.Bug1: To replicate,1- open the n657_dk2.ioc file2- goto the connectivity section3- enable UART5 in FSBL4- change mode to Asynchronous5- set Hardware Flow control to RTS/CTS.system hangs....Bug 2: if you try and save the file, it corrupts the file and you cannot edit the .ioc file anymore..ioc file attachedIMPORTANT!!! I need a fast work around so I can go to layout this week....
When the TouchGFX Graphics Application is selected, the supplementary TouchGFX code is generated; however, the TouchGFX library itself is not included in the project. I tried all available code generators, but none of them added the library.
Hi,When configuring a DMA channel in Circular mode with the LL code generator for STM32H523, the generated initialization code is incorrect.It creates a DMA Link Node (LL_DMA_LinkNodeTypeDef) on the stack, which is invalid since the DMA continuously accesses this structure. The link node should be placed in persistent memory instead.Additionally, the generated code does not set the source address, destination address, or block length when the link node is created, although these can be manually set later.Regards,Peter
Hello Community, I have tried to configure TIM8 in CubeMX (Version 6.15.0) with device STM32N645B0 (VFGBA198). But TIM8 is not available in the Timers Group. All other timers are displayed, only TIM8 is missing. Also trying to activate TIM8 over the pin directly does not work. Any ideas? Best regards Thomas
I am using Keil MDK Pro ver 5.38, Compiler ver 6.19, Middleware 8.0.0 (Also tried lower and upper versions). I am using STM32F746NGH6 MCU . I generated a USB FS Host only code in CubeMX. Exported to keil. Compiled the code and got zero errors and zero warningsHowever, after adding RTX5 and middleware components to keil project, the error of MX_Device.h file not found. Ther is no clear solution for this problem on unternet anywhere. Why STM32CubeMX is not generating this file? What is the way forward?
I want to use STM32FC091 USART1 for a MODBUS communication on RS485 with DMA. The STM32FC091 USART1 has a full implementation and supports using DMA, receiver timeout interrupt, Modbus communication and driver enable features.I just successfully tested USART1 with DMA on RS485 with my NUCLEO-C092RC. With STM32CubeMX I set USART1 in asynchronous mode and it properly works. But when I try to select Modbus Communication mode for USART1 I get:Driver Enable (DE) for RS485 features is not available. And only a USART1_TX GPIO Setting is available, all the others are not.How to set USART1 for Modbus Communication?
Not sure if this belongs in CubeMX or STM32 code for VS.I have a CMAKE project generated from CubeMX.When I build within VS Code IDE with the STM32 Extension I get several nocent warnings I would like to eliminate.Some of these are deep in the HAL and/or the generated code produced by CubeMX.ex:warning: declaration of 'hrtc' shadows a global declarationwarning: cast increases required alignment of target type [-Wcast-align]etc.I tried several modifications to my top level CMakeLists.txt suggested by AI to suppress these warnings but NONE work.I know this line:include("cmake/gcc-arm-none-eabi.cmake")brings in all the gcc compile options but I don't want to modify this file as it gets regenerated every time I do a CubeMX "GENERATE CODE" Things I have tried are:set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shadow")target_compile_options(my_target PRIVATE -Wno-shadow)set(MCU_GCC_FLAGS "${MCU_GCC_FLAGS} -Wno-shadow")add_compile_options(${MCU_GCC_FLAGS})add_compile_options(-Wno-shadow)set(CM
Hello. I'm using STM32CubeMX with STM32f777ZI MCU to create a CMAKE project.The generated linker script file (STM32F777XX_FLASH.ld) has a really simple definition of RAM memory regions:/* Specify the memory areas */MEMORY{RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512KFLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K}There is no separation of SRAM1, SRAM2, DTCM and etc. For example - I want to enable cache in SRAM1 and I need to have a proper section definitons. I want to use in my code something like:__attribute__((aligned(sizeof(uint32_t)), section ... and etc.Is it possible to force STM32CubeMX to generate more detailed RAM segmentation for F7 cores?
STM32H5 USB Custom HID CubeMX issue.When setting parameter "UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH" to 64 in CubeMX, the corresponding define in the "ux_user.h" file is commented out.Setting this parameter to any other valid value (between 0 and 255, excluding 64) in CubeMX generates an uncommented define.I presume CubeMX is doing this because it assumes the default value from USBX is 64 bytes.In fact a default value is provided by usbx in "ux_device_class_hid.h", but this value is actually 32 bytes.Thus, using out of the box CubeMX generated code when "UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH" set to 64 results in very nasty memory overwrites in the USBX device structures that subsequently result in hard fault.Please update CubeMX to not comment out this define when set to 64.Thank you.
Hello Forum,I've noticed a feature/bug/behaviour in CubeMX 6.15.0 that I'm unsure about so could do with some advice. I've been configuring an STM32U5A9ZJT 144 pin MCU for a project I'm working on. This has been an evolutionary process. To make the point I'll just focus on two peripherals, LPUART1 which has already been configured and I2C3 that I want to add in and configure.I start with LPUART1 configured as follows:Which has pins assigned like this on the MCU:I then enable the previously disabled I2C3 peripheral - there's nothing to say it conflicts with anything. This results in I2C3 looking like:Having done this CubeMX silently reconfigured the LPUART1 pins. thus:So the question is: "Is this normal?" If so I've never noticed before. It seems odd to me as I could have had a physical board made with the LPUART1 pins setup in the initial config. Adding the I2C3 peripheral breaks LPUART1.Any thoughts/advice much appreciated.DD &
Hi everyone, can anyone provide total DCMIPP camera interface STM32CubeMX .ioc file therefore I can create a project and My applications. Please help me to implement the B-CAMS-IMX camera.I also try with BSP drivers that are available in STM32N6570_discovery_bus.c and .h , STM32N6570_discovery.c and .h file but in IMX335.c file I am unable to read device ID properly.So, please provide proper DCMIPP camera interface STM32CubeMX .ioc Thankyou.
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.