Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I have setup and configured an STM32H5-based MCU via STM32CubeMX and with cmake as build system. I managed to build it successfully using Ninja generator. However, I can't change the configuration to Release and it is always Debug even though I used -DCMAKE_BUILD_TYPE=Release. I tried this in command line and using STM32 VSCODE Extension and all with the same results. I even tried to pass -DCMAKE_CONFIGURATION_TYPES="Debug;Release". Here is my build script: @echo offset TargetBuild=%1:CHECK_INPUTIF [%TargetBuild%] == [] GOTO :ERROR:PROCESScd ../ &rm -rf Secure/build &rm -rf NonSecure/build &rm -rf build mkdir build &cd build &cmake -DCMAKE_CONFIGURATION_TYPES=%TargetBuild% -DCMAKE_BUILD_TYPE=%TargetBuild% -DCMAKE_TOOLCHAIN_FILE=gcc-arm-none-eabi.cmake -B%TargetBuild% -G Ninja -S../ &cd %TargetBuild% &ninjagoto :eof:ERRORecho "Error: No target build given"echo "Usage Example:""echo "_build.cmd Release"goto :eofChe
[SOLVED - I found the solution after posting]Hi,the STM32F469 has DSI but when I try to enable it in CubeMX it shows in Italic and greyed out and if I click on it cannot be enabled. See screenshots below.Why is that?How do I enable it?Thank you
Hi All I have installed STM32 CubeMX on a Mac (Apple Silicon) and I get the following error when trying to generate code: The Eclipse executable launcher was unable to locate its companion shared library. Any one come accross this and any idea how to fix?
Hello, The project generation for CubeIDE fails on apple Silicon due to x86 compiled libraries org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.2.800.v20231003-1442/eclipse_11802.so' (code signature in 66ADAB06-1B30-301C-8ECA-7EDC8C31724D '/Applications/STMicroelectronics/STM32CubeMX.app/Contents/Resources/third_parties_plugins/binaries/STM32CubeIDE-MX-services/revA/pool/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.2.800.v20231003-1442/eclipse_11802.so' not valid for use in process:
Hi,How can I set up two Cordic Configuration, because I want to calulate using two different function. CORDIC_ConfigTypeDef sConfigSine;CORDIC_ConfigTypeDef sConfigPhase;CORDIC_ConfigTypeDef sConfigCosine; I tried to set up 3 different cordic configuration and switch between, but after I switch, the cordic do not calculate anything. Does anyone has the same issue before and how to solve it? Thanks e.g. firstHAL_CORDIC_Configure(&hcordic, &sConfigCosine);HAL_CORDIC_CalculateZO(&hcordic, &theta, &sin_cosine, 1, 0);thenHAL_CORDIC_Configure(&hcordic, &sConfigPhase);HAL_CORDIC_CalculateZO(&hcordic, &alpha_beta, &Phase, 1, 0);The second output is not valid. Thank you all!
I’ve generated a Makefile project in STM32CubeMX 6.12.0. This is the Makefile it generated:########################################################################################################################## # File automatically-generated by tool: [projectgenerator] version: [4.4.0-B60] date: [Fri Oct 25 00:09:08 CEST 2024] ########################################################################################################################## # ------------------------------------------------ # Generic Makefile (based on gcc) # # ChangeLog : # 2017-02-10 - Several enhancements + project update mode # 2015-07-22 - first version # ------------------------------------------------ ###################################### # target ###################################### TARGET = AdcDmaMakefile ###################################### # building variables ###################################### # debug build? DEBUG = 1 # optimization OPT = -Og #######################################
I'm trying to use STM32CubeMX to generate a USBX Device CDC ACM in standalone mode (without using ThreadX).I'm using a Nucleo-H563ZI to test with. I can do this with ThreadX and get it working, but when I try the standalone configuration it doesn't work.Is there any documentation, howto or guide on how to configure and setup USBX standalone on the H5 series?
Currently I am using CuebMX version 6.12 and tried generating BSP and HAL code for STM32U535RBT6 controller.But the generated code is not MISRA C 2012 compliant. How do I generate MISRA C 2012 compliance code?
Hi, I want to use the RTC. ( Use STM32F429ZI Discovery board )So, I set 1. RCC-> High Speed Clock Cystal/Ceramic Resonator RCC-> Low Speed Clock Cystal/Ceramic Resonator2. Clock Configuration -> RTC Clock Mux -> LSE3. Pinout & Configuration -> Timers -> RTC -> Active Clock Source4. Generate Code and Build project but, failedCan you help me to solve this problem?
The makefile generated by STM32CubeMX has the following line describing the linkers dependencies. $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile Unfortunately editing the .ld file will not force the linker to be executed next time make is executed. This could be resolved if $(LDSCRIPT) was added to this line. The makefile line would become… $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) $(LDSCRIPT) Makefile Could STM32CueMX change the generated makefile to include this?
Steps.Open STM32CubeMX. I am using version 6.12.1Click MCU SelectorSelect STM32U073K8U6. Note this table says the flash size is 64 kBytesClick Start ProjectSelect the Project Manager tabChange the Toolchain / IDE option to makefileClick Generate Code. I needed to enter a project name.Line 63 of the generated STM32U073K8Ux_FLASH.ld file is"FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K"I was expecting this line should say 64k.I can manually edit this file to say 64k.This is OK until I click the generate code button again which will overwrite my correction.
使用cubemx选用LSM6DSR的SPI通信、选用motion_di库,选用倾斜解算应用导出的项目文件(在连接文档中有压缩包)。导出后我删除了一些我不需要的操作以及一些必要部位的标志位,能正常产生数据但我无法确定数据是否正确,并且在两次或者两次以上循环后会跳入硬故障程序。具体如文档,wo'xiang'温'yi'xiaTranslation to English: Using cubemx with the LSM6DSR SPI communication option, the motion_di library option, and the tilt solver application exported project file (there is a zip file in the connection documentation). After exporting I removed some operations I didn't need and some flag bits in necessary parts, it generates data normally but I can't be sure if the data is correct and jumps to a hard fault program after two or more cycles. Specifically as documented, wo'xiang'wen'yi'xia
I'm looking at CubeMX's generation of the linker file (specifically an unconfigured project using the NUCLEO-H7S3L8) and I notice some discrepancies with certain memory region sizes.According to RM0477, the DCTM - RAM region begins at 0x2000_0000 and ends at 0x0x2003_0000, giving 192 KiB worth of memory. It can be seen in Figure 3 if one happens to have an electron microscope on their workbench.Yet, CubeMX's linker file says that the DTCM region has a length of 0x0001_0000, which is 64 kibibytes.__FLASH_BEGIN = 0x08000000; __FLASH_SIZE = 0x00010000; __RAM_BEGIN = 0x24000000; __RAM_SIZE = 0x4FC00; __RAM_NONCACHEABLEBUFFER_SIZE = 0x400; /* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = __RAM_BEGIN, LENGTH = __RAM_SIZE RAM_NONCACHEABLEBUFFER (xrw) : ORIGIN = __RAM_BEGIN + __RAM_SIZE, LENGTH = __RAM_NONCACHEABLEBUFFER_SIZE ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 0x00010000 DTCM (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000 SRAMAHB (rw) : ORIGIN = 0x30000000, LENGTH = 0x0
Hi,Recently, I got a copy of code for LWIP working with F407ZG in Keil project, I successfully ported it into CubeIDE with full functionality of CubeMX except for ETH selection (i.e. ported the code into a normal CubeIDE project with .ioc file without ETH selection). It works fine with F407ZG, but when I ported it again into a CubeIDE project with F407VE, it reports a failure on Software Reset, the call to HAL_ETH_Init() in stm32f4xx_hal_eth.c returns HAL_TIMEOUT:The original Keil project finished in October 2021, therefore the HAL driver is not up to date.From F407ZG to F407VE, only 3 pins are different for ETH pin configuration:The pin connections between the MCU and the PHY chip remain the same, and the ETH_RX_CLK and the ETH_TX_CLK are all enabled and checked with online debugging.I wonder what is the reason of the Software Reset failure. Bad soldering of the MCU or the PHY chip? Or something else? The MCU and PHY have all been replaced for test. I don't know what to
So I have a busy board, and SPI MISO is occupied.I would like to communicate in synchronous fashion with an FPGA.Can I Make this USART peripheral work in a SPI Master full dulex, synchronous mode?The baud rate seems to be limited in CubeMx, is this because the drivers are too weak?In this peripheral, wich seems to never be used in such cases, will the receiver pin correctly receive the clocked in DATA or will it fail? In my case the MCU will be acting as the throttle clock. Just like SPI.We are talking of speeds of 8 Mhz? On a 35mm trace.
Hello,I need to receive UDP Broadcast, but The "callback" function is never called. "No broadcast" UDP communication works fine.Is IwIP at all able to receive UDP broadcast?I use LwIP 2.0.3, STM32F407, PHY DP83848/*----- Default Value for IP_SOF_BROADCAST: 0 ---*/ #define IP_SOF_BROADCAST 1 /*----- Default Value for IP_SOF_BROADCAST_RECV: 0 ---*/ #define IP_SOF_BROADCAST_RECV 1 void udp_server_init(void) { struct udp_pcb *upcb; err_t err; upcb = udp_new(); ip_set_option(upcb, SOF_BROADCAST); if (upcb) { err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000); if(err == ERR_OK) { udp_recv(upcb, udp_receive_callback, NULL); } } } void udp_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2); pbuf_free(p); // Free the p buffer //udp_transmit(upcb, addr, udp2_tx_data, udp2_tx_len); } Thank youPeter
So I'm using a SDIO connection to write some files to the SD card (MCU STM32F446Vet6).Using the PC8-PC12 lines. Using the FATFS and SDIO from CubeMX. In main.c file have this sniped of code /* USER CODE BEGIN 2 */ if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != FR_OK) { Error_Handler(); } else { res=f_mkfs((TCHAR const*)SDPath, FM_ANY, 0, rtext, sizeof(rtext)); if(res != FR_OK) { Error_Handler(); } else { //Open file for writing (Create) if(f_open(&SDFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK) { Error_Handler(); } else { //Write to the text file res = f_write(&SDFile, wtext, strlen((char *)wtext), (void *)&byteswritten); if((byteswritten == 0) || (res != FR_OK)) { Error_Handler(); } else { f_close(&SDFile); } } } } f_mount(&SDFatFS, (TCHAR const*)NULL, 0); /* at line 9 (res=f_mkfs((TCHAR const*)SDPath, FM_ANY, 0, rtext, sizeof(rtext));) getting the Error FR_NOT_REA
Hello,I have a problem with configuring the clocks for I2S on the STM32H562RG. I’m using a V4220M codec (the same as the CS4220), which requires a clock that is a maximum of 512x the sampling frequency. However, when I try to set the sampling frequency to 44kHz in CubeIDE and the clock for I2S (master clock) to 22.528MHz, Cube gives me an error saying that for this sampling frequency, the minimum clock for I2S is 39.424MHz. :\ Is there anything that can be done about this?
Hello,I am currently experiencing issues with compiling a Makefile project for the STM32F103C8T6, generated by STM32CubeMX. The project has the FreeRTOS middleware enabled, with CMSIS V2.Compilation of the generated code results in these errors:https://pastebin.com/WJEXLh09I believe the first error has something to do with a missing symbol/definition for CMSIS_device_header, but I am unsure as to which header file should be there instead. The other error seems to be a configuration error, but I, once again, have no idea what to do to fix it.It's also worth noting that I was able to generate a project with the same settings and compile it previously. I don't recall tampering with anything that could have caused this breakage.
Hi,I got some problem with using ADC Differential Mode. When I am using ADC Single Ended Mode:Channel 8 Reading: ~8735Channel 9 Reading: ~10907When I am using ADC Differential Mode:Reading: ~7106That's weird. ADC Differential Mode should be subtracting both reading so suppose I should get 8735-10907=-2172? Why I will get 7106? Is it the signing problem? I already use int16_t instead of uint16_tDoes anyone can help me on this?Thank you!!!!
Hi,I am programming my STM32U5 that using MDF to filter the ADC value and transfer to memory with GPDMA.My problem is the output of the MDF is very different from the ADC output, and the MDF output keep fluctuating, but my adc value should be stable. Is it anything wrong with my ADC/MDF setting?My code:HAL_ADC_Start(&hadc1);MdfDMAConfig.Address = data;MdfDMAConfig.DataLength = 6;MdfDMAConfig.MsbOnly = DISABLE;HAL_MDF_AcqStart_DMA(&MdfHandle0, &MdfFilterConfig0, &MdfDMAConfig); My ADC Setting: My MDF Setting:My GPDMA Setting: My ADC Reading: My MDF Reading: Thank you so much!!!!
Hi,I'm new to STM32 tools.If I add a new component in STM32CubeMX, where can I find the documentation to the added sonftware modules?E.g. if I add DMA2D from the left pane software is added to the project.How do I know what this software offers and how to use it.All I get are references to the controller datasheet and reference manual on mouseover.Greets,Joerg
Hi I am new to STM32 MCU and we are migrating from Microchip to ST.I am using:STM32Cube IDE version 1.13.2STM32CubeMX version 6.8.1dev kit = STM32H747I-DISCOI followed all the instructions given in the txt file i am attaching with this thread.I want to achieve an inter-processor communication.My code for OpenAmp compiles okay but not functioning, i.e., it hangs in MX_OPENAMP_Init() function.I have updated all flash.ld files etc. as document instructs.can someone provide me with a simple STM32Cube IDE project that i can run on devkit which actually works. A project like described in the PDF file.Thank you
I am working with STM32U073 and the LCD initialization code generated by CubeMx 6.12.0 (from STM32CubeIDE 1.16.0) does not work with LSI selected as the clock source.HAL_LCD_Init() returns HAL_TIMEOUT due to LCD_WaitForSynchro() timing out.The issue is caused by two problems:1. With only LCD enabled (i.e. RTC disabled) the LSI oscillator is not enabled at all when SystemClock_Config() calls HAL_RCC_OscConfig(): void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Configure the main internal regulator output voltage */ HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2); /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; RCC_OscInitStruct.MSIState = RCC_MSI_ON; RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT; RCC_OscInitStruct.MSIClockRange = RCC_M
I use touchfgx 4.24.1 Designer to generate a new project. After generating it, I use this stm32cubemx 6.12.1 to open the stm32cubeProject. It will say that my stm32cubemx 6.12.1 does not have touchfgx 4.24.0 installed, and it wants me to install touchfgx 4.24. 0.My question is, I obviously used the 4.24.1 version of the project, why do I need to install touchfgx 4.24.0 when opening the stm32cubeProject project in stm32cubemx 6.12.1? I am sure that my stm32cubemx has touchfgx 4.24.1 installed.
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.