Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hey guys, I've recently begun development using CubeIDE. I have two embedded system projects with a very similar code base and the same MCU, so I was hoping to be able to have one project and two different IOC files for the different IO configuration of each processor.Ideally at worst I'd like to simply do something like manually change the project build configuration and then manually regenerate code from the respective IOC file. This way maintenance for the two projects will be much easier by keeping the upper code layers the same. I've found that the IOC file has to have the same name as the project for that to work though, but obviously you can't have two files with the same name.I've noticed I can change the "ProjName" variable by changing build configuration but it doesn't change the actual project name and therefore allow me to open the correct IOC file without manually changing the actual project name through the IDE. I haven't tested if changing the project name in such a way
Hi @Khouloud ZEMMELI I generated C code and other files after opening .IOC file in STM32CubeIDE (not STM32CubeMX).I observe many FLASH sections in the STM32H753BITX_FLASH.ld file do not call ALIGN(4).The left side file is the one that got generated after generating code, where is the right side file is the one that I have received from my colleague.I hereby request that STM32CubeMX be updated to include the ALIGN(4) wherever necessary.Regards,Rajeev
Hello, does anybody know if the new STM32G050C8 does, as at least CubeMX states, have an internal voltage reference buffer?Because any reference manuals or datasheet say the opposite... is the documentation perhaps outdated?Anyway thank you in advance... perhaps anyone has tried it.https://www.st.com/en/microcontrollers-microprocessors/stm32g050c8.html
I'm using a STM32H563 Nucleo and the latest version of CubeMX along with the Keil (V6.19 C Compiler - uVision IDE V5.38)I have discovered a weird issue where even though CubeMX seems to be generating the initialization code for the baud rate for UART9 correctly, it does not actually get loaded into the UART9 Baud Rate Register (BRR) using the Lower Level (LL) libraries:UART_InitStruct.BaudRate = 19200;UART_InitStruct.DataWidth = LL_USART_DATAWIDTH_9B;UART_InitStruct.StopBits = LL_USART_STOPBITS_1;UART_InitStruct.Parity = LL_USART_PARITY_ODD;UART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX;UART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE;UART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16;LL_USART_Init(UART9, &UART_InitStruct);LL_USART_ConfigAsyncMode(UART9);LL_USART_Enable(UART9);When I compile and execute the code, the USART_BRR value stays unchanged at 0 hex. I have tried the same thing on UART7 and it works just fine. I am trying to trace
Hello! I am trying to use MDMA with stm32h743zi, but when i set up it on cubeMX, i don't know which channel number to choose.I looked up information about MDMA but nothing useful found... Any help here to know which number to choose? As always, thank you so much!
Hi, I'm trying to get an alarm signal on an external contact (PC13). In the program everything works as it should and the interrupt occurs, but nothing changes on the external contact. What did I miss?
I am trying to configure the LPUART1 on STM32U585 in single-wire half duplex mode. As I understand, in half-duplex mode, only one pin is configured which is used to send and receive data. I need the half-duplex mode for self-test in my code letting me know that the hardware pin itself is operational. I do not want to use DMA or interrupts for transmit or receive. I am configuring the GPIO Pin as follows - I am only configuring PC1 as both the TX and RX pin. GPIO_HI (UART_PORT, IPC_UART_TX_PIN); //UART PORT = PORT C, IPC_UART_TX_PIN = Pin 1 GPIO_SET_MODE (UART_PORT, IPC_UART_TX_PIN, GPIO_MODE_ALT_FUNC); GPIO_SET_OUT_TYPE (UART_PORT, IPC_UART_TX_PIN, GPIO_OTYPE_OPENDRAIN); GPIO_SET_SPEED (UART_PORT, IPC_UART_TX_PIN, GPIO_SPEED_LO__10MHZ); GPIO_SET_PULL_UPDN(UART_PORT, IPC_UART_TX_PIN, GPIO_PUPD_PULLUP); GPIO_SET_ALT_FUNC (UART_PORT, IPC_UART_TX_PIN, GPIO_AFN_LPUART1); I enable the half-duplex mode when doing self-test by doing the following - &
I migrated a project from STM32CubeMX 6.3.0 to STM32CubeMX 6.10.0. It didn't boot anymore.There was this interesting diff to the linker script: ** Abstract : Linker script for STM32L452VCIx series -** 256Kbytes FLASH and 160Kbytes RAM +** 256Kbytes FLASH and 192Kbytes RAM MEMORY { -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 160K RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K }When did the STM32L452 get 192kB of SRAM? This is wrong. It's 160 kB. The RAM region should just be 128K. This puts the stack past the end of the real memory.
My machine is a 13th gen intel k chip with 32gb of ram. I have gigabit internet up and down. I have 2 samsung 990 NVMe pros. It has an rtx4080 My machine is perfect. Your software is ... not. I install windows 11 pro. I install CubeMX. After a minute of using it it decides to simply stop painting the screen anymore. Just like that. Bam! Unusable junk.I install windows 11 pro (again). I install CubeMX (again). After choosing new project (any of the 4 ways available to me) it hangs. Just an hourglass spinning into the abyss for eternity, whether I'm signed in or not.I'm starting to think ST can't hire people who can write reliable software. Why doesn't this work?There's no excuse for it. This is why I use zephyr, because ST's software is hot wet garbage. Think I'm wrong? Prove it by making this work on my machine. I'm so tired of wasting my time with your junk.
When I try to install the application, it opens and closes and does not give any errors. I read the readme.html file but the ones there did not work. Can you give some information about how I should install it?
Need to achieve 38400 baud rate for reception of NMEA messages but here 38400 is not in the multiple of binary numbers.Setting the clock to 8MHz and then using prescaler is just setting it to 31.25 Kb.How to adjust to be able to achieve that baud rate ?
Working in the MX and with a PicoScope, I measured some square waves looking to see how the MX generated code compared to the standard library code in loop time. I was changing frequency using the 8Hz HSI through the PLL multiplier. I found that with the MX generate code:HAL_GPIO_TogglePin(LED_1_GPIO_Port, LED_1_Pin);HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_RESET);HAL_GPIO_WritePin(LED_1_GPIO_Port, LED_1_Pin, GPIO_PIN_SET);The toggle at 48Hz was slower(2.5micro seconds) than at 32 Hz(1.9micro seconds). WritePin was also slower: 48Hz at 2.3 microseconds, to 1.7 microseconds at 32Hz Using this standard library code, 48Hz was faster than 32Hz, as expected:DigWrite_GPIOC(4, 1);DigWrite_GPIOC(4, 0);(3.9microseconds at 48Hz, and 2.2 microseconds at 32Hz)GPIOC->BSRR = 0x0010;GPIOC->BRR = 0x0010;(392ns at 48Hz, 332ns at 32Hz) This was all done in the MX through the PLL at 8Hz by 6 divided by 1 for 48Hz, and 8Hz by 4 divided by 1 for 32 Hz.The standard librar
Hello,I tried to change the board in my project from STM32G474CC to STM32G473CC. Both should be pin compatible. I've read different solutions for this in the forum but non of them work. Also the description in UM1718 chapter 11.9. When I follow the steps which are descript in this user manual I can not find the "File --> Import Project" option. I can only import from an existing project but then this project ends up in my workspace with the same mcu settings as it has in the original project. Is there an easy solution for changing pin compatible MCUs in the project?I use STM32CubeIDE version 1.5.1Best Regards,Dominic
MCU: STM32F446VESTM32CubeIDE 1.7.0 with CubeMX 6.3.0SAI1 block A is configured in SPDIF TX mode, clock audio frequency is set to 44.1KHz.SAI Clock is approximately 2.823529 MHz. HSE freq is 12MHz.As you can see on screenshot "Real Audio Frequency" almost match selected "Audio Frequency".The following init code was generated by CubeIDE for periph clocks and SAI:/** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SAI1|RCC_PERIPHCLK_SDIO |RCC_PERIPHCLK_CLK48; PeriphClkInitStruct.PLLSAI.PLLSAIM = 6; PeriphClkInitStruct.PLLSAI.PLLSAIN = 96; PeriphClkInitStruct.PLLSAI.PLLSAIQ = 4; PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; PeriphClkInitStruct.PLLSAIDivQ = 17; PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP; PeriphClkInitStruct.SdioClockSelection = RCC_SDIOCLKSOURCE_CLK48; PeriphClkInitStruct.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLLSAI; /* USER CODE END SAI1_Init 1 */ hsai_BlockA1.Instance = S
HRTIMe1 Interrupt needs HRTIM-MASTER Interrupt to fire?I saw similar issue in GitHub but it pertains to Source of fault.Anyway, I am using STM32G4 V1.3 on STMcubeIDE V1.5.1 on win10 machines (2 PCs)It seems that HRTIM-E1 will not fire up the interrupt unless I enable HRTIM-MASTER and its interrupt via CubeMX.Here is the setup of HRTIM-E1:in main()HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TE1 ); HAL_HRTIM_WaveformCountStart_IT(&hhrtim1, HRTIM_TIMERID_TIMER_E );in MX_HRTIM1_Init()static void MX_HRTIM1_Init(void) { /* USER CODE BEGIN HRTIM1_Init 0 */ /* USER CODE END HRTIM1_Init 0 */ HRTIM_TimeBaseCfgTypeDef pTimeBaseCfg = {0}; HRTIM_TimerCfgTypeDef pTimerCfg = {0}; HRTIM_CompareCfgTypeDef pCompareCfg = {0}; HRTIM_TimerCtlTypeDef pTimerCtl = {0}; HRTIM_OutputCfgTypeDef pOutputCfg = {0}; /* USER CODE BEGIN HRTIM1_Init 1 */ /* USER CODE END HRTIM1_Init 1 */ hhrtim1.Instance = HRTIM1; hhrtim1.Init.HRTIMInterruptResquests = HRTI
Dear Team, I am using SPC58 MCU. Can we use motor pilot tool as a addon so that I can integrate this tools with other IDE's. Thanks in advance
I use STM32CubeMX and Keil MDKI generate code and open project , but only open project.eww..-.
Hello ST community,In the software STM32CubeMX there is the possibility to select different timebase sources. By default the SysTick is selected. What criteria should be considered to decide which timebase to use ? What is the advantage/disadvantage of the other timebase sources? Is there an effect on precision or on energy consumption.Are the other timebase options relevant for applications with an RTOS only? Mostly I read that in combination with a RTOS the SysTick is not used for unknown reasons.Many thanks
My STM32F745VET project was built in MX v6.3.0 and uses FreeRTOS. When SysTick is dedicated to the RTOS I get the following message when I try to build code:"When RTOS is used, it is strongly recommended to use a HAL timebase source other than the Systick. The HAL timebase source can be changed from the Pinout tab under SYS"I arbitrarily picked TIM14 for the timebase source and see it has priority 15 in MX, the same as the FreeRTOS tick ISR. The code that MX generates does set the TIM14 ISR priority to 15 in HAL_Init(), but subsequently sets it to "16" in SystemClock_Config() when it calls HAL_RCC_ClockConfig(). This 16 gets truncated to 0 and this ISR interrupts my critical sections of code.I believe this is just a bug in the code generated by MX? I manually fixed it but that solution is not optimal and it'd be better to simply not have this ISR. What risk makes MX "strongly recommend" having a separate HAL timebase?
I got this error below.STM32CubeMX Launcher V1.0.4.0Copyright (C) 2015 ARM Ltd and ARM Germany GmbH. All rights reserved.*** Error: STM32CubeMX could not be found !CubeMXLauncher termiates with error code 3Enter any key to close.I am using Keil Uvision 5 (MDK526) and latest version of CubeMx. I tried to find the solution for hours, but I couldn't find it. I have also fully implemented the suggestions in this article below, but each time the launcher was not found CubeMx. Then I looked at the list of installed programs of my coumputer with Windows Powershell and noticed that CubeMx was not on the InstalledList. And CubeMx was also not in Add/Remove menu. I haven't found it in Regedit. I guess the launcher can't run for this reason. Because it couldn't find CubeMx. So is there a way to solve this problem? Additionally, after installation, CubeMX icon is not displayed on my desktop and CubeMx is not available from the Program menu. ioc files are not displayed with a cube icon. T
Hi,I want to connect my STM32H753ZI Nucleo board to Simulink. I have generated the CubeMx file to blink a simple LED. At first, I got some errors for missing header files. I added them manually. Now, I have the following error when I try to compile the file.error: 'STLK_TX_Pin' undeclared (first use in this function); did you mean 'STLINK_TX_Pin'?291 | GPIO_InitStruct.Pin = STLK_RX_Pin|STLK_TX_Pin;error: 'USB_PowerSwitchOn_GPIO_Port' undeclared (first use in this function) 392 | LL_GPIO_ResetOutputPin(USB_PowerSwitchOn_GPIO_Port, USB_PowerSwitchOn_Pin);error: 'Direction_GPIO_Port' undeclared (first use in this function) 395 | LL_GPIO_ResetOutputPin(Direction_GPIO_Port, Direction_Pin);... As it is recommended by Matlab, I am using CubeMX 6.4. The version of my H7 package is 1.11.0. It is highly appropriated helping to solve this problem.Thanks
Does the latest version of the driver of STM32F4 supporting USB audio class and CDC composite device functionality?I want to use the USB interface of STM32F4 to develop the functions of USB audio and CDC composite devices.I have a question, is the latest version of the driver supporting USB audio and CDC composite device functionality? If supported,please let us know how to implement it.Thank you。
Hello,I have a question while configuring the GPIO on stm32cubeMX. I put all my pins in the program like this:When I configure all the pins and generate the code, not all the configured pins appear in the gpio.c file on stm32cubeIDE; for example, the UART RX and TX pins do not appear in stm32cubeIDE.Thank you so much.
Hi all,Can anyone help me out how I should read out the two bytes 10 bits ADC result from the MCP3021https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/20001805C.pdfMy address is 0x4C 1001100(RD/WR) I'm using the HAL generated library:HAL_I2C_Mem_Read(&hi2c1, (uint16_t)ZTP_I2C_ADDRESS, 0, 8, (uint8_t*)aRxBuffer, 16, 1000);It is not very clear to me what the units should be, bits or bytes?
I started using the new "User Actions" feature, and it seems that there's an issue with the function that allows running a script after code generation. I managed to make the feature work without any problems when the "Window -> Outputs" option is checked. However, when it's unchecked, CubeMx completely freezes. In such cases, you have to terminate its process through the task manager, which is not desirable.For information, I use ".bat" file. CubeMx version 6.9.2
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.