Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
STMCubeMX version: 6.14.0Mcu Reference: STM32H757XIHxFirmware package name and version: STM32Cube FW_H7 V1.12.1Openamp version: v2018.10We had an old project where openamp worked perfectly with the same version (of openamp), what was diffrent was the custom configuration for a specific display(from TGFX 4.25.0) and the version of the ioc file. The actual user configuration in the ioc is the same as is the code. Now we have to make a new project based on touchgfx Custom board configuration 70STM32H7 v4.1.0. The old one was based on 70STM32H7 v3.2.0 (STMCubeMX version: v6.10.0 and FW_H7 V1.11.1) and worked fine without such errors. Openamp versions match on both IOCs. I checked the errno.h file for the definitions.I am currently working on the M4 core. I setup openamp in the ioc then converted main.c to main.cpp. When I try building I get the following errors:C:/Users/Uporabnik/Documents/Riverdi7NewConfig/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/metal/syst
CubeMx v6.14, cmake project, stm32h573ritx. Hi, I am developing a project using threadx and usbx on a h573ritx mcu in cmake using cubemx generator, I have encountered where all but usbx_stm32_device_controllers folder files are included in the CMakeLists.txt. Adding them does seem to fix the issue.
HelloI am currently working with the STM32G071 microcontroller and encountering an issue with the ADC when using a specific configuration.Here is a summary of my setup:ADC configured in "Sequencer fully configurable" modeScan conversion mode: DisabledDiscontinuous conversion mode: EnabledOversampling: Enabled (Ratio = 8x, Right bit shift = 3)When I measure two or more channels in this setup, the last channel in the sequence shows an incorrect result, with an error of about 30%. The earlier channels in the sequence seem to be accurate.I would like to understand if this behavior is expected due to the chosen configuration, or if there is a workaround or recommendation to avoid this issue. Any guidance or clarification would be greatly appreciated.Thank you in advance for your support.Best regards,
Hello,I'm working with the STM32N657X0H3Q MCU and trying to implement a UDP server . I enabled the Ethernet peripheral and selected NetXDuo in STM32CubeMX(6.14.1), then generated the code for MDK-ARM (Keil). However, two important driver files were not generated:nx_stm32_phy_driver.cnx_stm32_eth_driver.cI noticed that in your example here:"https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/NUCLEO-N657X0-Q/Applications/NetXDuo/Nx_UDP_Echo_Server"the two files mentioned above are included, but this example does not contain a .ioc file, so I couldn't verify how they were configured.To troubleshoot, I looked for another example with a similar configuration and found the STM32H5 series UDP example here:"https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Applications/NetXDuo/Nx_UDP_Echo_Server"This H5 example includes a .ioc file, and I observed that under NetXDuo > Network Interface, we can select:Ethernet Interface.LAN8742 PHY Drive
We are setting up ThreadX on the STM32H747I-DISCO and have enabled the Memory Management section in CubeMX to generate linker scripts. There is an option to automatically insert the ThreadX Heap memory section on the CM4 core, but not the CM7:threadx options The options within the ThreadX Middleware are the same:threadx middleware options Is there some other option that we should be using to automatically generate the ThreadX memory section?
I've generated simple project for STM32C011F6U6, in project manager i've selected all drivers in LL API. Generated project contains HAL_IncTick() call in SysTick_Handler which is not defined. STM32CubeIDE Version: 1.18.0STM32CubeMX Version: 6.14.0-RC8 Build: 20250227-1554 (UTC)
Hello everyone,I have a question regarding the configuration of the OCTOSPI, especially the prescaler value.I am using the UI to configure the XSPI's prescaler and setting it to 3.The generated code is as follows. You can see that the prescaler value is set to 3.XSPI_HandleTypeDef hospi1; /* OCTOSPI1 init function */ void MX_OCTOSPI1_Init(void) { /* USER CODE BEGIN OCTOSPI1_Init 0 */ /* USER CODE END OCTOSPI1_Init 0 */ /* USER CODE BEGIN OCTOSPI1_Init 1 */ /* USER CODE END OCTOSPI1_Init 1 */ hospi1.Instance = OCTOSPI1; hospi1.Init.FifoThresholdByte = 1; hospi1.Init.MemoryMode = HAL_XSPI_SINGLE_MEM; hospi1.Init.MemoryType = HAL_XSPI_MEMTYPE_MACRONIX; hospi1.Init.MemorySize = HAL_XSPI_SIZE_128MB; hospi1.Init.ChipSelectHighTimeCycle = 1; hospi1.Init.FreeRunningClock = HAL_XSPI_FREERUNCLK_DISABLE; hospi1.Init.ClockMode = HAL_XSPI_CLOCK_MODE_0; hospi1.Init.WrapSize = HAL_XSPI_WRAP_NOT_SUPPORTED; hospi1.Init.ClockPrescaler = 3; /*HERE value set at 3*/ hospi1.Init.SampleShiftin
In this movie setup done SDMMC 4BIT mode selected in CubeMX: Setup looks: In the older versions CubeMX like video before generated code for SDMMC or SDIO 4BIT setup looks like: That was confusing and doesn't really running SDIO/SDMMC in 4 bit wide mode. Today Cube generate code with SDMMC_BUS_WIDE_4B parameter BUT this is NOT ENOUGHT to running SDIO/SDMMC in 4 bits wide mode. Here is need a bit magic in a few codelines. For setup DISCOVERY F746G: In the generated code need to add a magic few lines which was selected in the red border:In the comparision 4bit to 1bit mode was 128ms/510KB read time for 1 bit mode versus 68ms for 4 bit mode.A little video with 4bit SDMMC work:For any custom board with STM32F407VET6 was setup:The code was very simmilary to previous: All of this was after my hot dispute with YT streamer called STM32World, where I don't bellieved him about the SDIO 4Bit mode could be really work on the STM32. And hi really proved
I just upgraded from version 6.13 to 6.14. I have an exiting project for an STM32H7B3 that uses SAI1. When I click the Generate Code button, I get the following warning:(The second warning is also a bug, I'm using CMake on my project so it is irrelevant).The SAI1 configuration area is also blank and does not show any warnings or errors:If I create a new project for the STM32H7B3LIH6Q, and enable SAI1 SAI A in master mode, my mouse just spins forever and I do not get configuration options.
STM32CubeMX 6.13.0MCU: STM32H747The generated code for USB device, class: CDC on Core M4 causes HardFault.The reason is the following definitions in the usbd_desc.c file: #define DEVICE_SERIAL0 (*(uint32_t *) 0x11223344) #define DEVICE_SERIAL1 (*(uint32_t *) 0x55667788) #define DEVICE_SERIAL2 (*(uint32_t *) 0x12345678) The code should probably look like this: #define DEVICE_SERIAL0 (0x11223344) #define DEVICE_SERIAL1 (0x55667788) #define DEVICE_SERIAL2 (0x12345678) Note: the literals come from the STM32CubeMX tool:The code for the M7 core uses the UID for a serial number, but the M4 core does not have access to the system memory region.Regards,Peter
in LwIP_UDPTCP_Echo_Server_Netconn_RTOS example for H7S3, LwIP_UDPTCP_Echo_Server_Netconn_RTOS.ioc returns error Invalid State: Most probably trying to open 'LwIP_UDPTCP_Echo_Server_Netconn_RTOS.ioc' file from an abnomal previous IDE session exit. Please close such editor and have a new try to recover properly.but there are no other editors open - i just downloaded a fresh version in new directory.Using STM32CubeIde 1.8.1 in Window computerOpening
STM32CubeMX 6.13.0MCU: STM32H747Peripheral: USB_OTG_FSUSB Class: CDCCore: M4FW: 1.12.1CMake generator selectedThe generated file "mx-generated.cmake" in the CM4 folder only includes the USB Class source file, but not the USB Core source files.: ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c ../Common/Src/system_stm32h7xx_dualcore_boot_cm4_cm7.c ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c ./Core/Src/sysmem.c ./Core/Src/syscalls.c ./Core/Startup/startup_stm32h747xx_CM4.s IOC file is attached.
STM32CubeMX 6.13.0.MCU - STM32H747.LL library selected.Generating the EXTI2_IRQHandler for the M4 core: void EXTI2_IRQHandler(void) { /* USER CODE BEGIN EXTI2_IRQn 0 */ /* USER CODE END EXTI2_IRQn 0 */ if (LL_EXTI_IsActiveFlag_0_31(LL_EXTI_LINE_2) != RESET) { LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_2); /* USER CODE BEGIN LL_EXTI_LINE_2 */ /* USER CODE END LL_EXTI_LINE_2 */ } /* USER CODE BEGIN EXTI2_IRQn 1 */ /* USER CODE END EXTI2_IRQn 1 */ } The generated code uses LL_EXTI_IsActiveFlag_0_31 and LL_C_EXTI_ClearFlag_0_31 instead of LL_C2_EXTI_IsActiveFlag_0_31 and LL_C2_EXTI_ClearFlag_0_31 for CORE2.
I wrote a code for this microcontroller to test the CAN protocol, and it worked successfully in loopback test mode—data was transmitted and received correctly without using any external CAN transceiver. Then, I switched the CAN mode from loopback to normal mode and physically connected the TX and RX pins together using a wire.However, with the same code (only changing the test mode), I noticed that in Live Watch, the TX pin shows activity (data being transmitted), but the RX pin shows nothing—no data being received. I even checked the signals on an oscilloscope, and the waveforms on TX and RX were identical, confirming that the signal is physically present on both lines. Yet, according to the software, no data is received.This led me to wonder: since some microcontrollers support external loopback modes while others do not, could it be that this microcontroller does not support external loopback in normal mode by simply wiring TX and RX together? Is that correct?
Dear Support Team,While using STM32CubeMX, I encountered an error when attempting to select "Refresh Data" (via Help > Refresh Data) or "ACCESS TO MCU Selector". The error message displayed is: cube-finder-db.zip (HTTP Access Forbidden). The screenshot of the error message is also attached.As suggested in a community forum, I have already attempted to run STM32CubeMX with administrative privileges; however, the issue persists. I would appreciate your assistance in resolving this matter.Additionally, could you kindly provide the direct URL for the cube-finder-db.zip file? Please also confirm whether specific Connection Parameter Settings are required to successfully download this file.I would be grateful for your prompt response.Best regards
The H7 USBX audio example project originally found here in GitHub: https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/dev/usbx/Projects/STM32H743I-EVAL/Applications/USBX/Ux_Device_Audiois no longer available. I am looking for an example project for USBX audio on H7 or H5 and would like to know if this project will ever be available again.
Moved from STM32H7B0 DFSDM Synchronization: Abnormal Clock Output During Register Configuration to a new thread in STM32CubeMX forum. Thank you for your detailed instructions!I set a breakpoint as you suggested and found that the audio clock is indeed generated as you said, but its behavior is abnormal, and not modified by codes after.Unfortunately, I cannot measure the waveform of the audio clock (DFSDM1 ACLK) directly, as it is not mapped to any IO output by default. To debug this, I re-mapped the DFSDM1 clock output (DFSDM1_CKOUT) from PC2_C to PB0. Surprisingly, the clock waveform on PB0 is now output correctly at the expected frequency (2.4MHz). This suggests a potential issue with the original GPIO pin PC2_C. Could this be due to accidental ESD damage to PC2_C? I would greatly appreciate your insights on whether this pin re-mapping approach is feasible for long-term use, or if there are better ways to diagnose/recover the original pin f
When I generated the source code with STM32CubeMX 6.14.1, my Japanese comments in USER CODE area are garbled. The character code is Shift_JIS. The version 6.12.1 is no problem.Could you please confirm and modify ASAP?
Hello, I'm new to ST platform and I would like to understand about clock configuration.I'm using NUCLEOU545REQ board for my development and want to know how to enable HSI16 clock and configure system clock to 24Mhz using stm32cubeGUI.
What I have to do that I can directly call some python scripts as pre/post code generation step with CubeMX 6.14.1 under Linux?Currently I can execute directly the python script on a Windows Machine, but on the Linux machine nothing happens. On Linux I can execute the scripts directly from command line without CubeMX and I can execute the scripts over a bash script which is calling the python script.Do I need to configure anything additional?Is there a possibility to select which python version is used?Any other hint where my problem could be? Thanks in advancenobody
Hello,I'm using STM32F103RB and have configured TIM1 Channel 1/2/3 as PWM Generation CH1/2/3 in Center-Aligned Mode 2.The clock source is internal (HSI = 8 MHz), and the APB2 timer clock is set to 64 MHz.I configured PSC = 1 and ARR = 1599 to produce a 20 kHz PWM.My goal is to trigger ADC at the exact midpoint of the PWM ON-time, which in Center-Aligned PWM Mode 2 should correspond to the point where CNT reaches ARR.To do this, I tried setting Trigger Event Selection (TRGO) to Update Event, but I suspect that the update event happens both when CNT = 0 and CNT = ARR.If so, it wouldn't guarantee that the trigger is generated only at the center of the ON pulse, which is my intended sampling point for BEMF.My questions are:Does Update Event in Center-Aligned Mode 2 occur both at CNT = 0 and CNT = ARR?If so, what is the best way to configure TRGO so that ADC is triggered only when CNT = ARR, i.e., the center of PWM ON-time?Would using Output Compare (OCxREF) as the TRGO source and setting C
Hi,I am using the STM32F103RB (NUCLEO-F103RB) and trying to configure the clocks using STM32CubeMX.According to the official reference manual (RM0008) and datasheet, the maximum allowed APB2 clock frequency is 72 MHz, and I know that peripherals like TIM1 or ADC are connected to APB2.I have tried several combinations of PLL settings:HSE = 8MHzPLL Multiplier = x9 → SYSCLK = 72MHzAHB Prescaler = /1APB2 Prescaler = /1 (PCLK2 = SYSCLK = 72MHz)However, in the CubeMX Clock Configuration tab, even when I do this, the APB2 clock (PCLK2) never goes above 64 MHz. CubeMX simply refuses to allow me to set it to 72MHz. It caps it at 64 MHz.My questions are:Is this a limitation of STM32CubeMX, or does STM32F103RB actually not support APB2 at 72MHz despite the datasheet?If this is a CubeMX issue, is there a workaround or a manual fix for it?How can I really run TIM1 or ADC at their maximum clock (72MHz) as stated in the datasheet?I'd appreciate any clarification or feedback from ST engineers or other
Hi,I'm working on setting up a Virtual COM Port for the STM32H563 using bare metal code, without any operating system. As a reference, I'm using the STM32CubeH5 project for the NUCLEO-H563ZI board, STM32CubeH5/Projects/NUCLEO-H563ZI/Applications/USBX/Ux_Device_HID_CDC_ACM at main · STMicroelectronics/STM32CubeH5. I've created the IOC file and enabled USBX and CDC ACM, which are necessary. However, after generating the source files, I couldn't find any definitions for _ux_device_class_cdc_acm_write and _ux_device_class_cdc_acm_read. I found Solved: How to use virtual COM port with nucleo-H563ZI - STMicroelectronics Community which suggests writing a _write function for printf using _ux_device_class_cdc_acm_write. This is my next step, but since I can't find _ux_device_class_cdc_acm_write, I'm stuck. I'm using CubeMX version 6.11.1 and I'm required to stick to this version.Is there anyone who can assist me? Best Regards,Swa
Hello guys. I've bought Riverdi 12.1” board that mounts STM32H757XIH6. I developed graphic part and I use uSD, and USB Mass-Storage without any problems. I use FreeRTOS and FatFS. Now it's time to use Ethernet, so I bought PoE - Riverdi, enabled LWIP library following instructions on the video How to use Ethernet on Riverdi STM32 Embedded Displays || PoE Add-on. I set MX in this way: The linker script ethernetif.c I compiled and I connect ethernet cable and it seems work poperly because if I ping I obtain right answer, but! sometimes processor goes to HardFault I've writed simple TCP server that accept connection on port 100 and send "Hello" every second. When I try to connect with TERA TERM it goes immediately on HardFault. Here the code of ethernet_input Can someone Help me ? Thankyou in advance  
Hi everyone,I'm having trouble with my ST-Link V2 programmer and STM32Cube tools. When I try to update the firmware via STM32CubeProgrammer (or STM32CubeUtility), I get the following error:"STLink is not in DFU mode. Please restart it."Additionally, when I try to upload code through STM32CubeIDE, it fails to connect. CubeProgrammer also gives me this error when I attempt to connect:"Your connection is defined with the HWrst mode."Here’s what I’ve tried so far:Verified all SWD connections: SWDIO, SWCLK, GND, 3.3VTried different USB cables and USB portsTried connecting with both STM32CubeIDE and CubeProgrammerChecked Device Manager: ST-Link shows up as USB device, but firmware update still failsTried to manually enter DFU mode, but unsure how with this ST-Link V2 device (it's possibly a clone)System Info:OS: Win11 ProSTM32 Model: STM32F103C8T6ST-Link version: V2 I'd appreciate any suggestions on how to:Successfully update the ST-Link firmwareBypass or resolve the DFU mod
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.