Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi, recently I had a problem using STM32CubeMX to modify the pre-configuration of an STM32F746 processor made by TouchGFX for the STM32F746G-DISCO Discovery board. I was disoriented with the configuration of a particular GPIO pin needed by my application on the Arduino connector of this discovery board (PG7), which was free but "invisible" (i.e. not listed at all) in the table of the GPIOs in the Configuration form of the Pinout & Configuration view. Undoubtely, the problem was generated by my limited experience with CubeMX, but I think that this can be a common problem with new users of the current interface. IMHO it could be a good idea to add on top of the GPIOs table in the Configuration form a checkbox to enable/disable the visualization of ALL GPIO pins, also the unused ones, as well as a "filter row" where the user can write search strings to filter the listed items (). In the current version of CubeMX, the uninitialized pins are not visible at all in the table and the "Sear
Bug:CubeMX codegeneration for the RCC (clock module) may lead to hardfault during clock initialization.I have a minimal example IOC (attached).This faults during RCC initialization (in SystemClock_Config), after LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL1);This happens because the peripheral domain prescalers need to be increased BEFORE switching to the faster clock (AFAICT), this would mean moving LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL1) toward the end of the function (after LL_RCC_SetAPB4Prescaler).This is right now 100% reproducible for me, but I suspect that instruction prefetching can potentially hide/sidestep the problem: If I enable -Os optimization flags, then the problem vanishes depending on how many __NOP() instructions (0-3) are inserted directly before LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL1);.Best way to reproduce the hardfault is single-instruction-stepping over this section with the debugger (that catches it every time for me).Workaround:Use HAL l
Hi. I am working with the above H750B discovery board developing a touch gui for my project. I am still at the very early stages of design. I have imported the project into CubeIDE and I have started to implement the required user code for the existing screen widgets and so far all is good (everything is working as it should). I now want to enable the boards SPI and USART peripherals as the H750B will eventually have to communicate with the projects additional MCU's (STM32411RE) via the H750B's gui. The unmodified TouchGFX STM32H750B-DK.ioc clock configuration screen is presumably set optimally via TouchGFX Generator however, adding SPI1 as a peripheral in CubeIDE generates clock issue errors. Using the auto resolve option the result knocks the SPI1,2,3 Clock Mux and SYSCLK down to 75MHz. I assume that 75MHz is the maximum speed at which the SPI peripheral can operate?I'm wondering how to reset the SYSCLK back to it's unmodified 480MH
Hello!!!I worked before with version 6.9.1 on my laptop (Win8.1) and it worked.Then I bought the PC: Windows 10 Enterprise 22H2 build 19045.5131, AMD Ryzen 9 7900X 12-Core Processor, 32 GB RAM and NVIDIA GeForce RTX 4060 Ti.I decided to install the new versions CubeIDE (1.16.1) and CubeMX (6.12.1). OK, I worked with IDE and everything was fine even with old project. Then I needed to change some settings and pins. I opened CubeMX and migrate my old .ioc there started some strange things:- CubeMX is loading my system (come one... look at my PC properties)- didn't generated code but saved parameters to .iocNote: I tried to continue with old version CubeMX but it worked until the CubeMX started to freezing. After I closed .ioc and when I open it again - see the picture (white picture) Then I decided to make a new one .ioc. And what happened:- CubeMX is loading my system with some operation- I configurated system properties, timers, clocks, connectivi
Dear all!this is the first time i handle with STM32H7 series. in my project control ILI9488 by TouchGFX platform, 4 mosfets, 1 Led. in the first step, i try to blink a led at pin PB5 but seem unsuccess. i don't know how to fix, so can you share me my mistake and how to fix it. in attach file have schematic. can you take a look and share me your input.
i am new to makefile Enviromint please refer the screenshot regards,raj
Hello,Since the latest release of CubeMX (6.12.1) installed, I have been encountering syntax errors related to the "FLASH.ld" file.This issue only arises when I generate code while setting the Toolchain/IDE to CMake. I am using STM32F103C8T6.It seems that CubeMX does not specify which RAM to use when setting the Toolchain/IDE to CMake.I have also included the FLASH.ld file that was generated for your reference. The terminal output the wrong as below , after run the default cmake-build task with the project templete generated by CubeMX (6.12.1) :STM32F103C8Tx_FLASH.ld:56: syntax errorcollect2.exe: error: ld returned 1 exit statusninja: build stopped: subcommand failed.build finished with error(s).Then, after replacing 6.12.1 flash.ld with 6.12.0 flash.ld , the errors are eliminated.Here are two versions of the flash.ld attached. ---Thanks for your help.
my daily job is C# programming, so after a break on stm32, I started again with platformIO and CubeMx ( and thought how hard can it be to turn a led on and off ? ) the problem i have with the STM32F0 discovery ( the green one ) the EXTI IRQ event is not triggered. i found this example. https://www.youtube.com/watch?v=xawN4Y7uSJ4 this is my platformIO.ini [platformio] default_envs = disco_f051r8 [env:disco_f051r8] platform = ststm32 board = disco_f051r8 framework = stm32cube board_build.mcu = stm32f051r8t6 upload_protocol = stlink build_flags = -I./Inc board_build.f_cpu = 48000000L after adding the include path ( Inc ) it worked. connecting the board, building debugging step by step. etc etc. turn a led on and off , push a button reading the value 1 or 0 ( so i know the button is working ) got it quickly working. the the next step is EXTI interrupt. ( made it with CubeMX32 ) very easy to choose the pins and set up ever
I try to install STM32CubeMX 6.12.1 on my Ubuntu 24.04.1 and installer gives a following error: root:/usr/src/ST/STM32CubeMX/6.12.1# ./SetupSTM32CubeMX-6.12.1 Check exe path on linux FullExe path1 is: /usr/src/ST/STM32CubeMX/6.12.1/SetupSTM32CubeMX-6.12.1 Exe path is: /usr/src/ST/STM32CubeMX/6.12.1 Search java from relative path ---- Checking java in /usr/src/ST/STM32CubeMX/6.12.1/./jre/bin/java current working dir : /usr/src/ST/STM32CubeMX/6.12.1 av[0] ./SetupSTM32CubeMX-6.12.1 chdir to :/usr/src/ST/STM32CubeMX/6.12.1/. New current working dir /usr/src/ST/STM32CubeMX/6.12.1 Full command: /usr/src/ST/STM32CubeMX/6.12.1/./jre/bin/java -args[0] java -args[1] -jar -args[2] SetupSTM32CubeMX-6.12.1 Command line arguments: SEVERE: java.lang.reflect.InvocationTargetException Same installer works fine in Ubuntu 22.04 docker container at same PC
Hello community, We are pleased to announce you that the minor release STM32CubeMX V6.12.1 is now available for download on st.com. Main issues fixed in this minor release: ADC init code error. When ADC is configured in multimode, an issue with the initialization code structure occurred in the LL Mode due to choosing a value for the "Delay between 2 sampling phases" parameter not matching the constants defined in the LL library file "stm32h7xx_ll_adc.h". The IOC file provided with the STM32MP257F-EV1 board on STM32CubeMX 6.12.0 does not allow the generation of the correct device tree. The STM32CubeMX V6.12.1 solves the issue by modifying the device tree files related to the STM32MP257F-EV1 board. FLEXGEN data must be generated for each assigned IP on Cortex®-M33 context. When configuring a peripheral in the Cortex®-M33 context, the FLEXCLKGEN settings for the RCC node in the device tree (DT) are not generated. The STM32CubeMX V6.12.1 fixes this issue by configuring the FLEXCLK
Hi,I am using STM32CubeMX 6.12.1 to generate a C-based firmware that depends on FreeRTOS. I enabled TrustZone and I have configuration for secure and non-secure part of the firmware. Everytime, I re-generate the code, the Secure project config is setup with incorrect path to RTOS2. This folder should reside in Secure_Project/Middlewares/RTOS2 and not in Secure_Project/RTOS2.Also, in the non-secure project, I would have freertos.h and tasks.h included in stm32h5xx_it.c under Core/Src. I know from the CubeMX that the FreeRTOS can only be included in the secure region and not permitted in the non-secure. However, the CubeMX always insert these inclusion under the non-secure project Core for some reason Kind Regards,Hani
Used stm32cubemx 6.11.0 to extract the example Ux-device-CDC-ACM for nucleo board u5a5zj-qI ran generate codeI used stm32cubeide 1.16.1 to load the IOC and I was able to build and run the example and see it allocate the VCP port on windows 10Then I used stm32cubeide to disable ADC1 and did a rebuild.I got the error below.What am I doing wrong ?I have attached my original .ioc file and the one on which the build fails. abi-gcc "C:/Ceribell/test/U5A5/using mx 6_11_0/Ux_Device_CDC_ACM/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.c" -mcpu=cortex-m33 -std=gnu11 -g3 -DDEBUG -DUSE_FULL_LL_DRIVER -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE=1 -DUSBPD_PORT_COUNT=1 -DUSBPD_THREADX -D_SNK -DUSBPDCORE_LIB_NO_PD -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32U5A5xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBPD/App -I../../USBPD/Target -I../../USBX/App -I../../USBX/Target -I../../Drivers/STM32U5xx_HAL_Driver/Inc -I../../Drivers/STM32U5xx_HAL_Driver/Inc/Lega
Hi, I have got a project configured successfully using STM32CubeMX code generation for STM32H5 MCU series. I noticed that the Src and Inc folders are dublicated under Core folder and under the project folder. When I make any changes in my drivers configuration on CubeMX and regenerate the code, only the source folders (Src and Inc) under Core are updated, however the other dublicated source files are not. My question is that why the source files are dublicated? This creates confusion in my project setup and unnecessary files included in my git repo. Also there are two main.c files; one in the project folder and the other in Core folder. I am wondering if there is some kind of settings I have to do under STM32CubeMX. I also imported the configured project into STM32CubeIDE and I am not sure if the issue in the IDE or in the CubeMX Kind Regards, Hani
Hello everyone, I have a question. I am using CubemX to generate HAL library and FreeRTOS. There are no errors during the compilation, but when I write the code, the auto-completion feature does not work (I have set it up), and even the uint8_t variable does not turn blue. When I look at the project files, it says that the stm32f1xx.h file cannot be found, but the entire project was generated by CubemX, and the file is located in the file path. I have also added the path to the file in C/C++ and there were no errors during the compilation. I cannot find a solution to this problem online, so I am seeking help from the experts here.
I noticed that the FreeRTOS task function template generated by CubeMX lacks a defensive programming practice recommended in FreeRTOS examples and documentation. Current Generated Code: void TaskFunction(void const * argument) { for(;;) { // Task code } } Recommended Pattern (from FreeRTOS examples): void TaskFunction(void const * argument) { for(;;) { // Task code } osThreadTerminate(taskTaskHandle); // Safety guard if loop is ever broken } Rationale:1. While the infinite loop means the code after it should never be reached, having osThreadTerminate(threadID) (vTaskDelete()) acts as a safety guard2. If the loop is unexpectedly broken (due to a bug or other condition), the current implementation could lead to undefined behavior3. This pattern is shown and recommended in official FreeRTOS examples and documentation4. Adding this guard aligns with defensive programming practices Impact:- Low: This is not a functional bug as the code works correct
i used stm32cubeMX 6.12.1and stm32cubeIDE 1.16.1then I told cube to select the Nucleo u5a5zJ boardi configured the clocks and turned on SPI1 and accepted the default pinsi configured the GPDMA to use channels 7 and 6 Next I generated code. i used the user code from the u575 SPI FULL DUPLEX_DMA masterbut only the user code. i assume that the system would provide the proper drivers , etc for the u5A5 BOARD.i compiled the code with stm32cubeIDE and it ran. i did not connect and SPI chips I just let the code transmit the string and i put a breakpoint in main around line 161 at the compare functions.the code hit the break point indicating the transmission completed and i saw SPI clocks on my scope on pin PA5.. called this project phil_u5a5_spi1 and it is attached.then i repeated the same procedure for SPI2 i accept the default pins except for SPI MOSI i changed PC3 to PC1.i made PB10 pull downPC1,PD3 pull up.this code did not compile. i had to go in and chang
HelloI have a project with STM32G474CB in CubeMX and it generates the linker script with following: MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K } But, as I understand, this is only the case when the device is switched into single-bank mode (which is not the default from the manufacturer!). The default would be two 64K flash chunks with second being at offset 0x08040000, am I correct?Thanks.
The MX configuration reported (generated from within the STM32CubeIDE, if that makes a difference) only includes the settings for the Config Parameters, Include Parameters and Advanced Settings tabs, but there are many more (Tasks and Queues, Timers and Semaphores, ...).Using STM32CubeIDE 1.16.1 for an STM32H7.
Split from: https://community.st.com/t5/stm32cubeide-mcus/changes-in-ioc-file-not-updating-the-code/td-p/661312 as the OP abandoned that thread, and it's a different problem anyhow. Hello GladsonIm here because now i have the same problem of you. I don't know if you could resolve the problem but in my case, i receive this message from the software when i tried to create a new project.I hope this can be helpful.
Hi,I have the same problem with two different projects, one using STM32U575 and the other using STM32L432KC (on Nucleo board).If I change NVIC config (I've tried changing preemption priority) and click generate code, some ISRs are no more generated. Depending on the NVIC configuration for code generation/HAL code, the project won't compile or compile but as soon as the interrupt is received, the processor will jump to default handler where it gets stuck.Closing and reopening the IDE, then regenerating code fixes the problem.Attached the IOC for U575. IDE: 1.16.1CubeMX: STM32CubeMX 6.12.1FW: 1.6.0 for U5, 1.18.1 for L4BR
Hello. I'm using EVM board with STM32F407ZGT.I set up the USB as below to use it as a USB Device. (CDC)But only one COM port can be found in the device manager on the PC.I want to know if I can't set 2 usb device or if it's a problem with setting.Please help me!!
I use STM32H745 RMII and DP83822 To use CubeMx generate code for lwip, selected phy is LAN8742.Modify the code But can't make it work Any body has the experience or some advice ?Hope someone can help me.
Posted on February 08, 2017 at 12:00Hiin cubeMX for any TIM PWM IO I can enable / disable 'fast mode'.What is fast mode?In which pdf document would I find the description of fast mode, and register address? I am trying to find my way in all the different documentation pdfs!Thx#pwm #cube-mx
Hello,Today I have been trying to install STM3CubeMX as well as the STM3Cube IDE . But , no matter what I try, I never get a download link to proceed with the download after pressing the "download latest" button on the desired software. Nothing at all happens after I press it in fact. I am a logged in and verified user , which is something I've read about being an issue if I am not one. Could you clue me in on what's the problem ? Thank you in advance.Sincerely,Maksim
STM32CubeMX 6.9.1 and IAR 9.32.1 on Nucelo_L476RGWhen enabling multi-threaded support for our FreeRTOS project in STM32CubeMX I am seeing builds of the binary that during startup (before reaching main) there are calls to __iar_system_Mtxlock() (dlib_lock_glue.c) before __iar_system_Mtxinit() and as the locks are not initialised, the system hangs in Error_Handler().Is there anything I need to do to do in startup for this to work correctly?
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.