Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I've been working with USBX for a while now, and after updating to the latest X-CUBE-AZRTOS-H7 package (v3.2.0), I'm running into a couple of problems relating to the templates STM32CubeMX generates. Specifically, the files ux_device_descriptors.c and ux_device_descriptors.h1). In the function USBD_Get_String_Framework, the variable "count" is declared as uint8_t. This is a problem if the string framework is more than 256 bytes in length. This definition is outside of the user editable code, so I need to remember to edit it every time I regenerate my code. This should be set to uint16_t or unsigned.2). Also in USBD_Get_String_Framework, the USER CODE tags are missing BEGIN and END. As a result, any code I put in between them is deleted when regenerating code.3). In the header file, the "USER CODE BEGIN/END Private_defines" tags appear twice, which results in any code in one of the sections begin duplicated when regenerating code.These are not a big deal, but they are a
Hi all,once again I stumble across CubeMX being so inflexible in its code generation.I use CubeMX to generate initialization code but I'm also using C++ and that's where CubeMX has major downsides.For example it is still not possible to tell CubeMX to generate the MX_XXX_Init function calls anywhere but in main.Further more an option to add a simple pointer to all HandleTypeDefs which is free to use would help a lot.From my experience STM HAL drivers are actually working pretty much ok but sometimes the are based on assumptions that a either flawed or don't apply in the project context.Hence you have to write your own driver.Just a simple pointer so I can pass additional information together with the handle struct would make life much easier especially when trying to implement a driver as C++ class.To any ST employee reading this:Are there any plans to make CubeMX more flexible?To all users of CubeMX:What would you really like ST to change in CubeMX?BR
I used to have the CubeMX generated code as a library in my main project: /BSP/CubeMX/ contains the .ioc and generated code.I could include the CubeMX 6.13 (and earlier I think) generated CmakeLists.txt and have all generated code compiled as a static library:project(BSP) add_library(${PROJECT_NAME} STATIC) add_subdirectory(CubeMX/cmake/stm32cubemx SYSTEM) target_link_libraries(${PROJECT_NAME} PRIVATE stm32cubemx) # Suppress compile warnings in 3rd-party C code target_compile_options(${PROJECT_NAME} PRIVATE -Wno-unused-parameter #-Wno-conversion) #expose header files from stm32cubemx to public target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "$<TARGET_PROPERTY:stm32cubemx,INTERFACE_INCLUDE_DIRECTORIES>")I needed some workarounds for getting everything to work, but I had a environment where I could re-generate CubeMX code and the whole project keeps on compiling without the need to fix something manually.Now the CubeMX generated CMakeLists.txt changed its content and I'm
Hi. Newby question about my STM32CubeMX (6.14.0) installation on Ubuntu. With the initial 'update', why do I get so many...:2025-03-31 14:17:40,313 [INFO] WebApp:194 - Connection lost2025-03-31 14:17:40,865 [INFO] WebApp:191 - Connection restablished...messages on the console? Is this normal? Its being going on for hours now !!!!(I have a good fiber connection to the internet)Thanks for your timeLeonBFollowed step described in the readme as close as possible:On Linux®:On STM32CubeMX-Lin line, click "Get software" to download the package.Extract (unzip) the downloaded package.Make sure you have administrator rights to access the target installation directory. You can run the installation as root (or sudo) to install STM32CubeMX in shared directories.Do chmod 777 SetupSTM32CubeMX-6.14.0 to change the properties, so that the file is executable.Double-click on the SetupSTM32CubeMX-6.14.0 file, or launch it from the console window.I did not do the last step but instead started the app
Originally a reply here, but seems to be a new question.Thank you, i worked in "Clock Configuration", but RTC is locked . It means for this MCU works only with internal clock for RTC?
I am working with the STM32F407ZGT6 microcontroller and have encountered a warning related to Ethernet and USB functionalities being assigned to the same pins. While I have attempted to resolve this by using alternative pin mappings, the conflict warning still persists. I would like to clarify the following: Understanding the Warning – Despite assigning Ethernet and USB to different available pins, the warning remains. Could you provide insights into why this occurs and whether it impacts functionality? Resolution Approach – Are there specific configurations, software settings, or modifications required to eliminate this conflict? Technical References – If there are any relevant technical documents or application notes addressing this issue, I would appreciate your guidance. Any insights or suggestions would be greatly appreciated! Thanks in advance! Best regards,Ishika Sapkal
Hello,Is it possible for ST to re-order the startup code in ST's implementation of AzRtos (CubeMX)?. I think it would make everyone's life a lot easier if all the AzRtos services (ThreadX, FileX, NetX, USBX) start before the user apps/threads.Currently, in the file: app_azure_rtos.c, the process is:create TX memory poolStart User threads (app_threadx.c)create FX memory poolStart MX_FileX_Init()create NetX memory poolStart MX_NetXDuo_Init()create USBX memory poolStart MX_USBX_Host_Init()Start MX_USBX_Device Init()The problem is that user threads are started before the necessary system services are available.I think it was done this way to simplify how CubeMX generates the code (where the user threads are grouped with ThreadX). In my opinion it makes more sense to move "step 2" after the USB services are up and running. In my opinion it should be as follows:create TX memory poolcreate FX memory poolStart MX_FileX_Init()create NetX memory poolStart MX_NetXDuo_Init()creat
In MX can be choiced wrap or incr? No info . Primary i ask for usage with internal SRAM5 in U5x.Same for other optimal GPU2D setup. ST have many time to correct this.
I am working on X-CUBE-AZURE in B-U585I-IOT02A board. My IDE version is 1.18 and i am using Fedora 41. When i enable FDCAN peripheral in CubeMX it places the stm32u5xx_hal_fdcan.c and .h file into the X-CUBE-AZURE/Drivers/STM32U5xx_HAL_Driver/Src. Even though it places the correct .c and .h files the build fails when i enable FDCAN from CubeMX. Here is the build error message./home/erhangok/Documents/GitHub/IOT_Node_Azure_v01fw/Projects/B-U585I-IOT02A/Applications/NetXDuo/Nx_Azure_IoT/Core/Src/main.c:357:(.text.MX_FDCAN1_Init+0x72): undefined reference to `HAL_FDCAN_Init' collect2: error: ld returned 1 exit status make: *** [makefile:104: Nx_Azure_IoT.elf] Error 1 "make -j8 all" terminated with exit code 2. Build might be incomplete. 15:41:47 Build Failed. 2 errors, 478 warnings. (took 19s.801ms)Even though the file exists in Drivers/STM32U5xx_HAL_Driver it still cannot find it. When i look further into this i saw that subdir.mk file does not contain this line: "./Drivers/STM32U5xx_HA
Hi When I try to set DSI clock more than 500M, the STM32cubemx will display an error message "dsi clock source frequency must be =< 62MHz" as below. But it said STM32H747 DSI clcok can reach 1Ghz in datasheet.I use 25Mhz HSE and attach STM32cubemx project for reference.
Hello!The code generated for lwIP and Ethernet (Internal MAC) has three threads for working of lwIP and the Ethernet driver.tcip_thread: main thread used to execute the lwIP stack all TCP/IP processing is done by this.EthIf: Process the RX interrupt on Ethernet peripheral, when new data packet is received passes it to lwip.EthLink: constanly monitors the Phy chip for any connection/disconnection and auto-negotiation events.I am using v 1.17.0 of the IDE (latest at the time of writting)The problem is that the default value of STACK size of EthIf (Rx Handler Thread) is very small: Only 350 bytes. which leads to stackoverflow. I have manually changed the value from code. But I cannot find any GUI to change this! Only we are allowed to configure the tcip_thread but their is NO option for last two threads. Further there is only a single constant that is used for initialization of both the threads (EthIf and EthLink)#define INTERFACE_THREAD_STACK_SIZE ( 1024 )and this same constant is
We are using this the X-CUBE-SMBUS middleware for a simple SMBus like device, and noticed that the generated configuration file sets the wrong define for the "Condensed command table" setting.The generated config file sets the DENSE_CMD_TABLE define, but the library expects DENSE_CMD_TBLX-CUBE-SMBUS/2.1.0/STM32CubeMX/templates/stm32_config_stack_h.ftl:[#if SMB_densetable_value == "1"]#define DENSE_CMD_TABLE[/#ifshould read[#if SMB_densetable_value == "1"]#define DENSE_CMD_TBL[/#ifThe error is noticeable if the PMBUS version is set to 1.1 or 1.2. Setting PMBUS version to 1.3 (default) hides the error as DENSE_CMD_TBL is a required feature for PMBUS 1.3 and is automatically enabled regardless of what the CubeMX config says.In our case we are using the library for a minimal SMBus like device, not using any PMBus features. So PMBUS feature level is set to 1.1 and most features are disabled.
I am configuring to support Stop mode 2 in the stm32_wpan configuration section in the STM32CubeMX.The following lines are generated in stm32_lpm_if.cSYSTEM_DEBUG_SIGNAL_SET(LOW_POWER_STOP2_MODE_ENTER); SYSTEM_DEBUG_SIGNAL_SET(LOW_POWER_STOP2_MODE_ACTIVE); SYSTEM_DEBUG_SIGNAL_SET(LOW_POWER_STOP2_MODE_EXIT);However, the definitions of LOW_POWER_STOP2_MODE_ENTER, LOW_POWER_STOP2_MODE_ACTIVE and LOW_POWER_STOP2_MODE_EXIT don't get generated, which are causing undefined compilation errors.I checked the expected types for these definitions, and see that these should be defined as part of the system_debug_signal_t enum inside debug_signals.h. I have tried looking for additional configurations that might generate the missing definitions but I haven't had any success so far.What should I look into or how can I generate these missing definitions? I could try to manually add these definitions to system_debug_signal_t. but then any time I re-generate with new configurations it
Hi,I am trying to minimise the error between the I2S sampling rate.You can do this pretty well in the STM32F4 because it has an independent I2SPLL (0.02% error between target sampling rate and actual rate is excellent), this is done by changing the PLLI2S N and R values. However, I do not understand why the 48kHz sample rate needs "I2S clocks (MHz)" to be around 49 MHz. Can someone explain that?
Hello!I'm using an STM32u5a9 with a user interface and SMBus enabled battery and charger board.CubeMX does not allow me to include both the X-CUBE-TOUCHGFX and X-CUBE-SMBUS libraries. I'm guessing there is some conflict with the I2C or how the HAL handles it? if I choose X-CUBE-TOUCHGFX first then try to choose X-CUBE-SMBus, CubeMX reports "This component cannot be selected: this application cannot be selected while the application from pack STMicrolectronics.X-CUBE-Touchgfx is selected": I'm wondering is there a way to get around this and use both libraries? It's my first time working with SMBus but I should also be able to configure an i2c bus separate from the one used for touchgfx to handle the smbus communication just without the HAL. Appreciate anyone's input! Thank you!
Hello, I would like to know how to install CubeMX and in which directory should I install it so that STM32CubeIDE can recognize it ? Thank you
Hi,I looked everywhere including the MCU Finder App and there does not seem to be any dev kit with DSI display that has a DSI example project that uses CubeMX .IOC configuration.Surely there must be at least one...?Could someone please point me in the right direction. :folded_hands:Thank you :)
Hi all,I encountered a build error while developing a TouchGFX project for the STM32H747-DISCO board. I followed these steps:Steps to Reproduce:Create a TouchGFX Project:Used TouchGFX Environment on Windows to generate an empty STM32H747-DISCO project.Added a background image and an Analog Clock.Set the initial time of the clock to 00:00:00.Clicked "Generate Code".Modify the Project in STM32CubeMX:Opened the project directory.Used STM32CubeMX v6.14.0 to open the CubeMX project file.Added the following peripherals:CM4: RTC, OpenAMP, FreeRTOSCM7: OpenAMPClicked "Generate Code" again.Build in STM32CubeIDE:Opened the project in STM32CubeIDE v1.18.0.Attempted to build the CM7 project.Encountered the following build error:Build Error Output:15:24:38 **** Incremental Build of configuration Debug for project STM32H747I-DISCO_CM7 **** make all arm-none-eabi-g++ -o "STM32H747I-DISCO_CM7.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -mcpu=cortex-m7 -T"D:\TouchGFX_Project\STM32H7_RTC_Clock\
Hi,in CubeMX clock configuration, after inputting a desired value into one of the PLL outputs (like in the LTDC Clock box) you can lock it and it turns gray (see screenshot), you can then set another related PLL output (like the DSI) and it should reconfigure the PLL parameters so both outputs are as desired (or at least the second one - the DSI in this example - is as close as possible to the set value).But it does not seem to work like that at all...Once I lock the LTDC, and then change the DSI clock, it does change the locked LTDC clock and by a lot. I can find closer matching values manually by trying a few combinations.Is it a bug in CubeMX?How can I get it to work correctly (fix one value and get CubeMX to calculate the PLL settings of the second when I input it)?Thank you
Hi AllI have installed STM32 CubeMX on a Mac and I get the following error when trying to generate code:The Eclipse executable launcher was unable to locate its companion shared library.
I just wanted a basic driver with a few API calls to run the VL53L4CX proximity sensor, but I think I got enough code to land a Falcon 9. Attempting to add the X-CUBE-TOF1 middleware with the VL53L4CX sensor to our projects in CubeMX v6.14.0 currently fails. STM32CubeMX either permanently freezes or generates invalid code and references, even when inserted into a fresh project. We had to reinstall CubeMX and revert all changes to a prior state to get it unstuck. The base driver files require something like 9 header files just to define the sensor in the user application. The VL53L4CX driver is too complicated. Are there any simplified documentation resources with stepwise register read and writes?Where is the actual I2C register datasheet to use this sensor?
I am using hrtim to trigger the adc, but if the regular channel is not triggered with hrtim, it doesn't go into the interrupt of the ADC properly, I checked a lot of information and didn't find a solution, here is my code and cubemx configuration: NVIC_SetPriority(HRTIM1_TIMC_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); NVIC_EnableIRQ(HRTIM1_TIMC_IRQn); NVIC_SetPriority(HRTIM1_FLT_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),4, 0)); NVIC_EnableIRQ(HRTIM1_FLT_IRQn); LL_HRTIM_SetSyncInSrc(HRTIM1, LL_HRTIM_SYNCIN_SRC_TIM_EVENT); LL_HRTIM_ConfigDLLCalibration(HRTIM1, LL_HRTIM_DLLCALIBRATION_MODE_CONTINUOUS, LL_HRTIM_DLLCALIBRATION_RATE_3); LL_HRTIM_ConfigADCTrig(HRTIM1, LL_HRTIM_ADCTRIG_2, LL_HRTIM_ADCTRIG_UPDATE_TIMER_D, LL_HRTIM_ADCTRIG_SRC24_TIMDCMP2|LL_HRTIM_ADCTRIG_SRC24_TIMDRST); LL_HRTIM_SetADCPostScaler(HRTIM1, LL_HRTIM_ADCTRIG_2, 0x0); LL_HRTIM_ConfigADCTrig(HRTIM1, LL_HRTIM_ADCTRIG_3, LL_HRTIM_ADCTRIG_UPDATE_TIMER_D, LL_HRTIM_ADCTRIG_SR
I am using the STM32CubeMX to edit pinout configurations for the STM32U595ZJYxQ. Process worked well for the past few days however on Friday the tool appeared to hang after saving the config. The first time this happened the tool closed on its own after several minutes. The next time this happened today, I restarted the laptop. Once the reboot completed, I tried opening the file again but the contents of the file appeared to have changed. The LTIM core assignments were gone as was a SPI chip select GPIO config. The IOC was backed up by versions so I picked last friday's version and it opened without those issues. Comparing file versions between working and corrupted, I see a 3kbyte size difference (14K corrupted vs 17K working). My experience was on a file that was saved on a corporate NAS behind a VPN. I have since copied that file locally and started only making local updates. Has anyone else experienced thest types of issues? I am running STM32CubeMX v6.14
Hi, I’m new to STM32. I wanted to set SPI_TX in DMA settings, but I think it has to be configured before using it, as you can see in the picture. I want to give an output for display... can anyone help to solve the problem?
STM32G030K6T6 - can not configure ADC1_IN16 @ PA12The STM32CubeIDE does not allowed me to enable the ADC1_IN16.The message is "IN16 Disable...Available if sequencer is set to not fully configurable in parameter settings tab"How can I enable it?
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.