Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
For the STM32H743IIKx micro, CubeMX 6.15.0 unnecessarily creates a configuration for the R1 pin when creating an LTDC peripheral when using the RGB666 Display Type.This should not be configured. The required R* pins for this Display Type are R2-R7, as per G2-G7 and B2-B7.This did not occur in previous CubeMX versions, including 6.14.1.This bug means that it is not possible to upgrade to this version of CubeMX with an existing project that already uses the pin(s) required for LTDC_R1.
A new question moved from this post. I have the opposite issue with STM32CubeIDe v1.18 / MX v6.14.0, I want my semaphore initial state to be depleted, but that is not applied to my code: /* creation of DebugUartStringReadySem */ DebugUartStringReadySemHandle = osSemaphoreNew(1, 1, &DebugUartStringReadySem_attributes); My .ioc file seems ok: rtos.0.binarySems.0=allocationType,Dynamic;controlBlockName,NULL;initialState,Depleted;name,DebugUartStringReadySem
In my project for an STM32H7S3, I'm using the Ethernet module, and it works fine.However, I don't need the ETH_CLK pin. In RCC settings, there's an option which suggests I can turn it off; however, clicking the tickbox has no effect. (Note also that the text for this option is "Digital clock input" - even though the pin is an output.)Instead, I can set the pin itself to its Reset state, and that works. However, next time I open the IOC file, that setting is missing, and I have to change the pin state again. In addition, if I save the IOC file without making any changes at all, I can see in the diff that the settings for that pin have been changed:Previously, the generated value of ETH_CLK was outside its valid range (HSE was too low, and any setting from PLL3S was too high), and even though I wasn't using it, Cube wouldn't let me generate code without disabling this pin, because ETH_CLK is an input to the ETH Clock Mux, and presumably all inputs to this mux must be valid
Hello,I'm encountering severe compilation errors in an STM32H7 dual-core project (eth_project_CM7) using FreeRTOS (v10.4.6) and LWIP configured via STM32CubeMX (version 6.9.2). All errors point to FreeRTOS header files (task.h, list.h).The core issue appears to be related to header file inclusion order and the compiler's inability to find FreeRTOS basic type definitions (BaseType_t, TickType_t, etc.), despite thorough configuration checks.1. Project DetailsMCU: STM32H757XI (Cortex-M7 core project: eth_project_CM7)IDE: STM32CubeIDE (latest version)Middleware: FreeRTOS (M7 enabled), LWIP enabled.Language Standard: GNU11 (-std=gnu11) is set in the C Compiler.2. Example Errors (Cascading Failures)The errors are typical of missing type definitions, causing a cascade of syntax errors throughout the FreeRTOS headers:#error "include FreeRTOS.h must appear in source files before include task.h"unknown type name 'BaseType_t'expected declaration specifiers before 'TaskHandle_t'old-style parameter
Hello!I am using the NUCLEO-H755ZI-Q development board. In STM32CubeMX, I selected "Start My project from ST Board" and chose the corresponding model. I generated both an STM32CubeIDE project and an MDK project. The M4 and M7 firmware compiled from the STM32CubeIDE project can be downloaded to the board and run. When the button is pressed, the light can flash. However, the M4 and M7 firmware compiled from the MDK project cannot be run when downloaded to the board. The light does not flash. What could be the reason? Logically speaking, the same CubeMZX sample was used, only the generated projects are different. Please help me. Thank you!
I'm looking to utilize an FTP server with the STM32F7NI-Discovery board. Specifically I'm looking at taking Nx_Webserver demo for that board (which works great) and adding the ftp module to it that NetxDuo provides. However, I'm seeing that the F7 chips don't have a way to add the FTP module to NetxDuo using the STMCube IDE, where that option is available for the H7 chips. Is there anything preventing me from getting an ftp server running by manually copying the addon from the NetxDuo Github repo and modifying the WebServer Demo project to utilize FTP on the F7 board? I've gone ahead and added the files to the project and it compiles just fine, but I run into memory management issues when trying to create an FTP server with it. That could very easily just be my own inexperience with the tools, though.
I have a project for STM32F777 generated by STM32CubeMX 6.15.0.The macro definition of #define assert_param(expr) exists in 2 include files - stm32f7xx_hal_conf.hand stm32_assert.hBoth files are included on different levels of the project. Is there a reason to have two indentical definitions in the code?
Hello all, I'm having problems with I2C1, i have a code that works perfectly while i configure the HCLK to 8MHz but it stops working when i set any higher frequency. Has anybody faced similar problem? I am using STM32CubeIDE for setting the project, this microcontroller has a separate clock from HCLK, and i can't understand why I'm having this problem. Thanks in advance.
Hi all,I am trying to implement ADC acquisition on one channel, with 14 bit, 4x oversample, at 1 Msmps (1 megasample per second). This is possible only using dual interleaved mode. Moreover, I want to acquire continuosly with circular DMA.But it is not clear to me how to set the right values in CubeMX, and I can't use the datasheet (which I have read) to understand, it seems CubeMX and datasheet use different names for the same thing.Let start from my ADC1 settings:Are the settings right until now? What I don't understand is the role of "DMA Access Mode" and "Conversion data management mode": I can disable DMA Access Mode and still have Conversion Data Management Mode = DMA Circular Mode; so what?Or, viceversa, I can have DMA Access Mode enabled, but Conversion Data Management Mode set to "Data stored to DR register only"; is DMA used in this case or what?Now go on to ADC2 settings. Correctly, once ADC1 is set to "Dual interleaved mode only", some values become read-only. But other can
Hello,I have a project on STM32F091 generated with STM32CubeMX.Connectivity included USART3, USART4 and USART5.It created this code that has a problem on the line with huart5 ("(&huart5);" is written twice and it give a warning during build).Do you confirm? What the procedure to correct in next CubeMX version?void USART3_8_IRQHandler(void) { /* USER CODE BEGIN USART3_8_IRQn 0 */ /* USER CODE END USART3_8_IRQn 0 */ HAL_UART_IRQHandler(&huart3); HAL_UART_IRQHandler(&huart4); HAL_UART_IRQHandler(&huart5);(&huart5); /* USER CODE BEGIN USART3_8_IRQn 1 */ /* USER CODE END USART3_8_IRQn 1 */ }regardsjeromeEdited to apply source code formatting - please see How to insert source code for future reference.
Thread split from this discussion; specifically, this post. My mistake. Doesn't make sense to have the nominal SJW mixed with the data bit configuration. It should be inside the Bit timing parameter tree view along with the other nominal configurations.
A recent update to CubeMX (Version 6.15.0) has caused newly generated linker files (Such as CM7/stm32h747xx_flash_CM7.ld) to generate with the following code: /* Remove information from the standard libraries */ /DISCARD/ : { libc.a:* ( * ) libm.a:* ( * ) libgcc.a:* ( * ) } Previously, we generated this code on version 6.14.1 and got the following instead: /* Remove information from the standard libraries */ /DISCARD/ : { libc.a ( * ) libm.a ( * ) libgcc.a ( * ) } This change causes the new version to unconditionally discard C++ standard library code which is a valid thing to do for pure C code, but not for C++ which leverages generated C as ST addressed in this forum post. https://community.st.com/t5/stm32cubemx-mcus/compilation-failure-after-upgrade-to-stm32cubemx-6-15/td-p/837335 I believe the previous versions only discarded the unused sections, which would allow it to discard for C and stay around if linked to via C++.We are a C++ s
In the IOC editor, under PWR, and Monitoring, I have set belowand, I read that below in NVIC needs to be setWhen I look at git diff to observe changes, no files except ioc have been changed. How do I get it to work. I am using CubeIDE 1.19.
HiIt's a disaster that Current CubeMX have to select CMSIS when enabling freertos. many developers use raw freertos API to develop project. The project based on raw freertos api is more compatiable with other MCUs, also they are familar with raw freertos API. I think this option should be reserved for developer. Is there any way to use raw freertos api in cubemx? Peter
Dear SupportI am new to STM32CudeIDE - just downloaded latest v1.19 and opened a new example for Nucleo-H563Zi board, SPI_FullDuplex_ComIT_Slave and its .ioc file, as soon as I opened it, it tell me there is a Clock Configuration issue and need to resolve - as it highlighted in red below, is this a bug? Please advise what i need to do in order to let it work.Regards!Ping
As of yesterday, since an update hit, my CubeMX view won't render (literally it is just a white background). Tried reinstalling and it renders, until I sign up and it updates again, then it stops rendering again. The rest of the IDE works just fine. System:Ubuntu 24.04.3 LTS (Linux 6.14.0-33-generic)Dell Inspiron computer8,0 GiB MemoryWayland windows systemGnome 46CubeIDE 1.19.0
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code Hi everyone, I’m interfacing a microSD card with an STM32U575 microcontroller using the SDMMC1 peripheral. In my project (generated by CubeIDE) I’m using the MX_SDMMC1_SD_Init( ) function to initialize the peripheral. Everything works fine when the card is inserted. The problem occurs when I remove the microSD card (or if it’s not inserted at all): during initialization, the code stops at this point: /* Identify card operating voltage */ errorstate = SD_PowerON(hsd); if (errorstate != HAL_SD_ERROR_NONE) { hsd->State = HAL_SD_STATE_READY; hsd->ErrorCode |= errorstate; return HAL_ERROR; } This condition returns HAL_ERROR, which is then handled by the default Error_Handler( ) function. However, the default Error_Handler( ) generated by CubeIDE contains a while(1) lo
I'm a new user of the STM32 and its tools, and I'm confused about their behavior when using ST's Arm Clang toolchain (not the hybrid Clang-GNU but the full Clang/LLVM). The ST-provided `cmsis_armclang.h` isn't being included in my build of a simple CubeMX-generated project. Instead, `cmsis_gcc.h` is included.Using the current version of STM32CubeMX (6.15.0), I created a project for the NUCLEO-U545RE-Q board (attached). I used the default settings except that I went with ST's contemporary approach for VS Code with ST's extension pack:Toolchain / IDE: CMakeDefault Compiler/Linker: Starm-Clang. I keep wanting to pick Sturm und Drang but sadly that's not an option. ;)And I modified two of the code-generation settings. From the .txt report:STM32Cube MCU packages and embedded software packs : Copy only the necessary library filesGenerate peripheral initialization as a pair of '.c/.h' files per peripheral : YesThe generated code's `starm-clang.cmake` defaulted to the hybrid toolchain by
Hi,CubeMX version 6.15.0 with STM32U5 HAL 1.8.0.<project>/XP2/Core/Src/tim.c: In function 'MX_TIM5_Init': <project>/XP2/Core/Src/tim.c:228:30: error: conversion from 'long unsigned int' to 'uint16_t' {aka 'short unsigned int'} changes value from '4294967196' to '65436' [-Werror=overflow] 228 | TIM_InitStruct.Prescaler = 156-LL_TIM_ETR_FILTER_FDIV1_N2; | ^~~ cc1.exe: all warnings being treated as errors The prescaler setting of "156-1" should be 155 when set, but the code is actually this: /* USER CODE END TIM5_Init 1 */ TIM_InitStruct.Prescaler = 156-LL_TIM_ETR_FILTER_FDIV1_N2; TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_InitStruct.Autoreload = 4294967295; TIM_InitStruct.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; LL_TIM_Init(TIM5, &TIM_InitStruct); LL_TIM_DisableARRPreload(TIM5); LL_TIM_SetClockSource(TIM5, LL_TIM_CLOCKSOURCE_INTERNAL); LL_TIM_SetTriggerOutput(TIM5, LL_TIM_TRGO_RESET); LL_TIM_DisableMasterSlaveMode(TIM5); /* USER CODE BEGIN TI
STM32CubeMX always generates the function MX_LWIP_Init even when its generation is disabled. This causes a redefinition during compilation if a custom implementation already exists. On every regeneration the autogenerated file re inserts the function and its prototype, triggering the conflict.Board: CustomCPU: STM32H743IITx
Hello, I'm trying to implement USB communication with a PC using USB1 (USB-C port) on an STM32N6570-DK with CubeMX. Most tutorials I've found on USBX are for older CubeMX versions and boards, so I'm a bit stuck. When I connect the board to my PC, I only get Error Code 43 in Device Manager. Here's what I've done so far: Enabled PA4 as shown in this diagram: Enabled USB1 in CubeMX. Enabled interrupt and feft default settings otherwise: Enabled USBX. System stack size: 10 * 1024, Memory pool size: 15 * 1024 Additional settings: USB init code: void MX_USB1_OTG_HS_PCD_Init(void) { /* USER CODE BEGIN USB1_OTG_HS_Init 0 */ /* USER CODE END USB1_OTG_HS_Init 0 */ /* USER CODE BEGIN USB1_OTG_HS_Init 1 */ memset(&hpcd_USB_OTG_HS1, 0x0, sizeof(PCD_HandleTypeDef)); /* USER CODE END USB1_OTG_HS_Init 1 */ hpcd_USB_OTG_HS1.Instance = USB1_OTG_HS; hpcd_USB_OTG_HS1.Init.dev_endpoints = 9; hpcd_USB_OTG_HS1.Init.speed = PCD_SPEED_HIGH; hpcd_USB_OTG_
Hi all,I'm using an stm32f746 and I switched to a stm32u5a9 mcu. I was learning about freeRTOS with the f746 and now it looks like I should be using threadX instead. Since I don't know much about RTOS, switching is not a big deal. But using cubeIDE build in cubeMX I could make multiple threads for freeRTOS before. Now it looks like I can make one in cubeMX by clicking the "generate app init code" and setting the "Create threadX application thread" to true. I know I can add more threads to the files manually. I'm wondering if I can make more than one in cubeMX ... like freeRTOS? Thanks
As you can see below picture, B-WL5M-SUBG1 Connectivity Expansion Board's UART pins are PC0 and PC1:But in the STM32Cube_FW_WL_V1.3.1 repository Sigfox_AT_Slave application for B-WL5M-SUBG1 describes uart pins are PA3 and PA2:So in this case, application's UART AT interface doesn't work. Buf if you change LPUART1 pin configurations, it works fine: Thank you for your interest.
I’d like to propose an improvement to the search functionality in the "Pinout & Configuration" → "Pinout View" section of STM32CubeMX.Currently, the search allows filtering by port names and peripheral signals. It would be extremely helpful if the search could support wildcards or regular expression-like patterns. For example:Searching for SPI?_MOSI would return all pins associated with SPI1_MOSI, SPI2_MOSI, SPI3_MOSI, etc.Searching for PA[0-9]+ could list all pins from PA0 to PA15.This enhancement would significantly improve usability, especially when working with large pinouts or when trying to locate signal mappings across multiple instances of peripherals.Thank you for considering this suggestion!Best Simon
Hello, superhero MCU fans.I'm trying to create an STM32N6 project with two projects: FSBL and Appl in its simplest form.Both will live in external flash.The FSBL should start Appl in XiP mode, and that Appl should only blink an LED (Hello World) for now.Of course, I signed the bin files, used the correct EL in STM32CubeProgrammer, and flashed the FSBL to 0x7000000 and the Appl to 0x70100000.I think it looks a lot like the JPEG_DecodingFromOSPI_DMA example, which works just fine!However, I have no idea how it can be created in STM32CubeMX.For example, the example has a "extmem.c" file, but CubeMX isn't generating it. I think there's a problem.So, with STM32CubeMX 6.15.0, I couldn't generate a project where FSBL could launch Appl. The FSBL can blink an LED, but it apparently can't launch the APPL. I'm sure I'm doing it wrong, but I'm new to this and couldn't find a tutorial.It may have to do with the default protection mode.I attached the ioc file.What do I need to do to get this working
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.