Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi, The mbedTLS v3.6.x is LTS version and released for quite long time. Do you have plan to upgrade mbedTLS to v3.6.x with MX? If not, customer shall manually integrate/upgrade the mbedTLS to v3.6.x. Could you please give me a guideline to do that. Thanks!
Hello, Using the latest CubeMX 6.15.0 I was generating ThreadX for Secure - Non Secure Project (for STM32N6 - Cortex_M55). This did not add file : "\Middlewares\ST\threadx\ports\cortex_M55\gnu\src\txe_thread_secure_stack_allocate.c" and so is not added in to the CubeIDE project. Where as it's counterpart - "\Middlewares\ST\threadx\ports\cortex_M55\gnu\src\txe_thread_secure_stack_free.c" is getting generated and added to the project. Also, compiler includes like "/Secure_nsclib" , "/Drivers/CMSIS/Include" did not get added into the Compiler Include Paths in the CubeIDE project that this CubeMX generates.
When generating code for Makefile, the MacOS version 6.15 succeeds while the Linux version 6.15 fails.I have the same version of firmware packages installed on both OS.MacOS STM32CubeMX produce this following snippet in the Makefile####################################### # LDFLAGS ####################################### # link script LDSCRIPT = STM32U5a5xx_FLASH.ldand do copy the correct file to the project directory. However, the Linux version fail to define linker script file and does not copy required script to the project folder. ####################################### # LDFLAGS ####################################### # link script LDSCRIPT = The log explains why, the file does not exists.No such linker file: /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_FLASH.ld No such linker file: /home/mike/STM32Cube/Repository//STM32Cube_FW_U5_V1.8.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Template
After updating to STM32CubeMX 6.15.0 with STM32CubeWBA FW V1.7.0 for the STM32WBA63CIUx, I noticed a change in how the HAL tick is driven.In MX_APPE_Init() (generated in app_entry.c), CubeMX now creates a UTIL timer to increment the HAL tick: /* Create an RTC based timer to trigger HAL tick increment */ UTIL_TIMER_Create(&TimerHALtick_Id, HAL_TICK_FREQ_100HZ, UTIL_TIMER_PERIODIC, &TimerHALtickCB, 0); uwTickFreq = HAL_TICK_FREQ_100HZ; /* Start HAL tick timer */ UTIL_TIMER_StartWithPeriod(&TimerHALtick_Id, HAL_TICK_FREQ_100HZ);This runs at 100 Hz by default and causes my system to wake every 10 ms.Previously, I used TIM17 for the HAL tick, with FreeRTOS (tickless idle) and STM32_WPAN BLE, and it worked well. Now, I see both TIM17 and this new UTIL timer, which leads to unnecessary wakeups.My questions:Is there official documentation on this new HAL tick implementation using UTIL_TIMER?How can it be configured or disabled via STM32CubeMX instead of modifying the
Hi there,According to the STM32H755 datasheet, the Cortex-M7 frequency can reach up to 480MHz.However, when I configure the sysclk in STM32CubeMX, it shows the maximum frequency is 300MHz.What's wrong with my config? Or is there any misunderstanding by me?Thanks for your help!
My colleague is working with the stm32h743.Initially PC7 was setup as a PWM output. That worked fine.When he changed the pin to GPIO_output, no code was produced to set up the pin.By manually entering code, we could get the pin to be configured as we want. But no matter what we tried, the IDE would not generate configuration code
I am porting code from an existing project that runs on an STM32F4 chip onto an STM32H7 chip, and have been losing my sanity for a couple of days trying to get over hurdle #1: I use a UART for communicating with the chip, and have not been able to get DMA transfers to work. I used CubeMX to create a new project for the new chip. Based on https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices I have confirmed that the buffer that I've pointed the DMA peripheral at is indeed sitting in SRAM2 (D2 area), which it should have access to. For fun, I'm not enabling the data cache, and am not fiddling with the MPU yet. Using HAL_UART_Transmit() with no DMA works fine, but with DMA the transmit function runs once, no data is transferred, and the port stays busy forever. Resetting the port status will let the function run again, but still doesn't transfer any data. No error flags get set, and no interrupts get called (e.g. TxHalfCplt or DMAError), the transfer just doesn't h
I'm using STM32CubeIDE version 1.19.0 and MxCube version 6.15.0.In ExtMemLoader middleware configuration there's a Memory Size option:The *** thing is that it lists C macro options that are capital letters (by naming convention) so megabits (acronym Mb) turn into megabytes (MB). But that "16MB" macro is actually 16 megabits (2 megabytes) in stm32h7rsxx_hal_xspi.h:#define HAL_XSPI_SIZE_16MB (0x00000014U) /*!< 16 Mbits ( 2 MBytes = 2^(20+1)) */That explains why I get bus fault beyond 2 MiB and wasted hour on checking everything.The XSPI configuration option for size is clearer because it writes full unit in "Mbits".Please use clear units.Another confusion comes from the "Memory Mode" option in XSPI peripheral. CubeMX allows to pick Enable or Disable. But in generated code it becomes clear that it is actually enablement of dual-memory mode or not, hence single-memory mode. Some parameters have explanation box appearing. I feel this one needs explanation box, better parameter namin
There's a bug in the latest version of stm32cubemx(6.15.0), I migrate my configuration into this version of cubemx, then generate code, and I did not notice that cubemx could change my config and stick into it.I mean, I use tim3 ch2 & ch3 to generate a fixed squrewave, so I set counter period as 5249, and ch2 & ch3 pulse as 2624, then generate code. Ch2 is fine, but ch3 pulse setting will be generated as 5249 in code. And after I save config.ioc file, then reopen it, in the ch3 pulse collumn it shows 5249, although I changed it and saved for so many time, it just remain showing this 5249 value.I'm so exhausted to find the problem, it's so unlogic and mysterious. Please follow up this bug to help other developers from this heck......p.s.I attached my ioc file for you to investigate.
Hello,I am working with STM32CubeIDE (STM32H7 project, IDE version: 1.15.1, build: 21094_20240412_1041 (UTC)) and I noticed an issue with automatically re-added include paths in my project.In my .cproject file, the following include entries keep showing up after every build or after CubeMX code generation, even though I do not use these middlewares and don’t even have them installed in my workspace: <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1384018038" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler"> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.509112497" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.manag
Hi!Can we switch the SPI Mode from Mode 1 to Mode 0 or vice versa in the same project ??For eg. If I have set the SPI Mode to Mode 1 using my IOC which is required by one of my ICs but one of my ICs works on SPI Mode 0 so can I change the mode from Mode 1 to Mode 0 using the code only to control one IC.Please reply ASAP!Thanks
Hi Team,I am trying to use the HSE for Nucleo U5A5ZJ but I have some confusion. The document says .."HSE is the 16 MHz oscillator for the STM32 microcontroller. This clock is available depending on the targetSTM32 series microcontroller used on the Nucleo-144 board."So does this board have the external oscillator or not?In the clock configuration diagram, it defaults the Input frequency to 8MHz. Why?Even if i use this 8MHz HSE deploying the code to the board results in messages like "Target is not responding, retrying...". Can you please give some guidance.Thanks.Sandeep
Hi,I am finding STM32CubeMX is hanging when generating code in my project. I have had this in the past and managed to work around it by adjusting main.c so it didn't complain however that isn't working this time. If I run it in the console I see..2025-08-20 15:48:29,933 [INFO] CodeEngine:265 - oldGeneratedFile, /Users/oconnd1/work/micro/hv_psu/hv_psu01/Core/Inc/main.h_save 2025-08-20 15:48:30,033 [INFO] CodeEngine:289 - Generated code: /Users/oconnd1/work/micro/hv_psu/hv_psu01/Core/Inc/main.h 2025-08-20 15:48:30,037 [INFO] CodeEngine:265 - oldGeneratedFile, /Users/oconnd1/work/micro/hv_psu/hv_psu01/Core/Src/main.c_save 2025-08-20 15:48:30,208 [INFO] CodeEngine:289 - Generated code: /Users/oconnd1/work/micro/hv_psu/hv_psu01/Core/Src/main.c 2025-08-20 15:48:30,215 [ERROR] ProjectBuilder:2238 - java.lang.NullPointerException: Cannot read the array length because "<local4>" is null at com.st.microxplorer.codegenerator.CodeGenerator.cleanDir(CodeGenerator.java:2746) ~[STM32CubeM
Hello,Previously I had CubeMX 6.13.0 and here is the code which was autogenerated and working as expected for RS485 communication, where I have manually handled the Direction pin in my code.static void MX_LPUART1_UART_Init(void) { hlpuart1.Instance = LPUART1; hlpuart1.Init.BaudRate = 115200; 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; hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_RS485Ex_Init(&hlpuart1, UART_DE_POLARITY_HIGH, 0, 0) != HAL_OK) { Error_Handler(); } if (HAL_UARTEx_SetTxFifoThreshold(&hlpuart1, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK) { Error_Handler(); } if (HAL_UARTEx_SetRxFifoThreshold(&hlpuart1, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK) { Error_Handler(); } if (HAL_UARTEx_DisableFifoMode(&a
my project is making TF card a Udisk ,I use cubemx generate keil project, when I use AC6 -O0, everything goes fine,I connect USB, the Udisk display , read ,write is OK, but when I set -O1 or -O2, the Udisk won't come out and shows unknown USB device,when I set -O3 is fine,I try to set optimize level group by group , only "Middlewares/USB_Device_Library" -O1 or -O2 cause this problem, I dont know if it is ST USB library problem
Hello,When I use MX's file browser (when clicking File > Load Project ... or File > Save Project As.., for instance), it won't show the contents of some directories.It shows me the contents of my home folder, but if I try to browse my Desktop, Documents, or Downloads folders, it shows nothing. And yet, for whatever reason, it has no problem showing the contents of my Movies, Music, or Pictures folders.I've looked in System Settings > Privacy & Security > Files & Folders (as well as Full Disk Access, fwiw), and there are no entries showing that MX has been restricted in any way.However, MX does show up in the App Management section, which has the description "Allow the applications below to update or delete other applications," and the toggle is turned off. AFAICT, there's only one change in behavior if I enable this toggle and restart MX: when I try to browse any of the problematic folders, there's a pause and my cursor briefly becomes a blue beach ball before I'm s
I was following the tutorial (Get started with STM32Cube for VS Code: from installation to debugging - YouTube) when I managed to find a nasty footgun. STM32CubeMx will allow you to create a project whose name contains a space, and then if you set the toolchain to CMake, it generates the code fine, but if you load the project into STM32Cube for VSC and try to build, you will get all kinds of cryptic CMAKE error messages caused by the space in the project name.Now, STM32CubeMx does have some input validation. It only prevents you from initially generating the project IF you have space in the name and you set the toolchain to CMake BEFORE you generate the code, but that's it. If you save the IOC with a space, save the project as with a space, you generate under any of the other toolchains then switch to CMake, you'll trigger this error.I burned a few hours on this, so I thought it would be worth bringing up to save someone else the headache in the future. You might want to implement some
Hello,Descriptor limits is wrong, I found what in ST network examples the RX TX descriptor address is set at lower regions, but cubeMX does not allow to set to lower than 0x3410000, limit is at 0x34100000, everything is work without problems in D1 ram on N6, I need more ram and set at lower address, I ques this limit is related to H7 and maybe others MCU's, for N6 the limits is different.
Hi,Could someone please explain the meaning of this image? It's a snapshot from CubeMX GPIO section.Does it imply that PA12 and PA10 can be used as a single pin, or does it mean something else?
Hi everyone, I'm currently working with one NUCLEO-F767ZI board and everytime I create a new project on STM32CubeMX this "Error Downloading the following files: crdb_full.zip (Cannot unzipped)" appears. I already tried to reinstall the STM32CubeMX and delete the crdb_full.zip file at <userfolder>\.stmcufinder\plugins\mcufinder\mcu\cs as suggested in another post.I attempted unzipping the crdb_full.zip manually but it seems that there is an error with the file itself. Is there any solutuion or workaround to solve this problem? Is this affecting the build?
Hi,I'm using V6.15.0 of CubeMX with STM32U5 to generate DMA code. When I use the following configuration, it appears to generate incorrect code?I've noticed the following:1) It placed the Node_GPDMA1_Channel1 structure on the stack:This doesn't seem right, and I would note that when memory to memory DMA is selected, it allocates this (correctly) statically.2) It sets the source increment mode to LL_DMA_SRC_FIXED: This again doesn't seem right. When transferring from memory to peripheral, the source increment mode should be LL_DMA_SRC_INCREMENT. 3) This code is confusing and inconsistent: When generating memory to memory code, the LL_DMA_SetLinkedListBaseAddr call is placed inside the comments. When generating peripheral to memory code, it is placed outside of the comments. Regards John
I am using NucleoF446RE (STM32F446RE) with CubeIDE 1.19.0.I wish to set PLL as 16MHz by HSE (STLINK 8MHz MCO).Because HSI clock is 16MHz.I had set PLL M/N/P = 4/64/8. CubeMX reported P was fail . ]So I had set P=4. and It makes PLL-CLK = 32MHzAfter hal generation I have modified SystemClock_Config as following. void SystemClock_Config(void){RCC_OscInitTypeDef RCC_OscInitStruct = {0};RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Configure the main internal regulator output voltage*/__HAL_RCC_PWR_CLK_ENABLE();__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3); /** Initializes the RCC Oscillators according to the specified parameters* in the RCC_OscInitTypeDef structure.*/RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;RCC_OscInitStruct.PLL.PLLM = 4;RCC_OscInitStruct.PLL.PLLN = 64;RCC_OscInitStruct.PLL.
We are pleased to announce that the version 6.15.0 of STM32CubeMX is available. What is new in 6.15.0: Enhanced microprocessor support: Added the STM32MP21-A35-TD, STM32MP21-M33-TD, STM32MP25-M33-TD, and STM32MP23-M33-TD trusted domains for the STM32MP2 MPUs and their Arm® Cortex®-A35 and Cortex®-M33 processors. Integrated the STARM-Clang toolchain: The STMicroelectronics LLVM-based toolchain for Arm®, STARM-Clang, leverages Clang's modular architecture for faster compilation and enhanced support for modern language standards, expanding the build capabilities. Build process enhancements: Use of CMake for more efficient project compilation. Removal of the -Wpedantic and -Wextra options from CMake GCC toolchain template to match the build results produced by STM32CubeIDE. Updated the RIF feature implementation: Integrated the RIF feature for STM32MP2 microprocessors with the STM32MP21-A35-TD, STM32MP21-M33-TD, STM32MP25-M33-TD, and STM32MP23-M33-TD trusted domains. Updated soft
Hello, While I was developing code for STM32N6, which uses FreeRTOS that uses SysTick as tick source, I changed the HAL timebase to utilize Timer 6 (TIM6). I've noticed that the generated CubeMX code will incorrectly calculate the input clock frequency for the timer, by assuming it is APB1. According to the reference manual (RM0486 Rev 2, p.449), the kernel clock for the Timer 6 is the timer group 1 clock, which is derived from the SYS Clock, divided by the value of the prescaler TIMPRE. So it is not APB1, but it is SYSCLK/TIMPRE, if I am not misunderstanding something.What happened to me is that I had the TIMPRE set to '/2', but there was no code generated for setting TIMPRE, and the Timer was running from SYSCLK / 1, which was 400 MHz in my case. The CubeMX generated code used the value of APB1 (which was 200 MHz in my case) for the calculations and ended up with 2x greater frequency of TIM6 (period of 0.5 ms, instead of the wanted 1 ms).Here is the CubeMX generated code for HAL
Hi everyone,when I export a project from STM32CubeMX (6.1.1) to the STM32CubeIDE (1.5.1), a project with double space indent is created. However, the CubeIDE uses Tabs. How can I fix that? Who uses double space indent anyway?Thanks a lot :)
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.