Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I was wondering if multiple team members are modifying this file,what is the clean way to do a merge this file using Git? I am pretty sure STM Community is using CubeMX and there should be a way to update this file by multiple people and merge the changes without messing up the project.Any suggestions/comments are welcome.Thanks
Can not access .ioc file merge post I created, getting access denied while trying to access it, anybody know what i might be missing?Link for the posthttps://community.st.com/t5/stm32cubemx-mcus/how-to-cleanly-merge-stcubegenerated-ioc-file-in-a-team/td-p/594912
Hello.To generate a multiplatform code I defined a SW architecture and packaging as follow :Build system :Vendor package can use the cdt project to generate the BSP (cdt builder is the only toolchain supported for system init code generation )Application is created as cmake project created by stmCubeIDE (new in stmcube ide 1.13) and links to the BSP.At first sight the APP would be a complete application and the LLD a library providing only the HAL calls. That would mean that the APP hosts :Startup codeLinker scriptInterrupt.I am not sure the HAL could work with independently defined interrupt handler so I let those be part of LLD except the linker script (present but not used).The LLD package contains :System init (peripheral and clocks, interrupt handler, startup code)The main() (that can be changed though, but I’m lazy about calling the init function in the right order).Progress summaryIssue to create the HAL as library : it needs to be configured as a full binary. The workarou
I feel like I'm missing something basic here. What is the fastest way to configure many pins for GPIO in CubeMX? I have over 100 pins I need to configure and the only way I know how is somewhat tedious.For example, I need to make the entirety of PORT D, E, G, I, and J pins all GPIO_Output. The best way I've found is to use the search bar at the bottom of the Pinout view in CubeMX, search for PG0, then click on the pin in Pinout view, select GPIO_Output, then right-click on the same pin, select Enter User Label, and then type in my label.Is there a way to just get an alphabetical list of all the pins, PA0, PA1, PA2, etc. so I can just multiple-select and configure entire groups as GPIO_Outputs at once? Pins will show up in the GPIO Mode and Configuration table, but only after they are configured, not before. I can't easily just work my way around the package in Pinout view because the pins are never physically in alphabetical order, so that would involve a lot of hunting for the right p
Hello,With CubeMX V6.8 (I did not check with latest update), there is a bug in the USART clock source selection, for chip STM32L451VETWhen selecting SYSCLK for USART2 or USART3 (did not check with UART4), in the function HAL_UART_MspInit() the clock is init with :PeriphClkInit.Usart2ClockSelection = RCC_USART1CLKSOURCE_SYSCLK;instead of PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_SYSCLK;That results in an incorrect initialisation !I don't know if it is related to the fact that in my project USART1 is also clocked by RCC_USART1CLKSOURCE_SYSCLKAurelien
Hey there, at the moment I am stuck with the following problem: I need to trigger a SPI DMA Transfer precisely at each Timer overflow. NVIC Timer interrupts are not an option, because the jitter is way too high when I have to jump into code each time (I managed to trigger SPI-DMA transfer using the Timers NVIC global interrupt, but as I said, jitter is way too high). So now I am looking for a solution that involves the Cube MX, I want to configure the Timer in a way so that it directly triggers the DMA of the SPI? Or is there anything I can once declare in code that will do the job for me? In the end the solution should work without the CPU at all. I am using a NUCLEO-F446RE Board here, running at 180MHz. If someone has a quick solution (In Cube MX or Code, doesn’t matter as long as it works) I would be very thankful!Greetings Julius
Hi, I ran into a bug a while back where some ADC reads I had set up weren't working. In the course of debugging I found that the ADCs only worked after I changed the order in which some automatically generated startup functions were called in order to initialize the DMA controller before the ADCs. However, whenever I make changes to my .ioc and generate code it regenerates these startup functions in the wrong order. Why is this happening and how do I fix it?This is the incorrect order they are generated in:This is the order I have to change it to for the ADCs to work:
I am trying to follow the "Getting started with X-CUBE-AI Expansion Package for Artificial Intelligence (AI)" document (User Manual UM2526), but I cannot validate the model on target. Note that I'm using the STM32F746-DISCO instead of the recommended NUCLEO-F746ZG, but that's a minor difference.I can sucessfully validate the model on desktop (using random numbers and real data), but get an error when trying to validate on target using the "automatic compilation and download" option.CubeMX reports "Automatic build and run failed".Consulting the STM32CubeMX.log file I see the following error:2023-09-19 11:57:49,034 [ERROR] STM32CubeIDEBuilder:207 - !MESSAGE The project description file (.project) for 'mxAI1803873821400' is missing. This file contains important information about the project. The project will not function properly until this file is restored.My project is named STM32F746-DISCO, not the random string of characters shown. Even when I've used the "Generate Code" o
Seeing issue while brining-up Winbond W25X20L FLASH with STM32, Write and read a byte in a loop does not work.Tried to see the signal's using the scope and seems like clock has some issue, appreciate any help. Please let mw know if more information is needed here.CubeMx Settings and code I am using is provided belowSTM32CubeMX Settings for SPI1 after going through blog post like this Getting Started with STM32 - How to Use SPI (digikey.com) Basically updated.1. data_size from 4 to 8, 2. baud_rate to 1.5Mbps using 64 as Prescaler, 3. Disabled NSSP ModeHere is the Code i am using to read/write a byte in a loop#include "main.h"#include "stm32h7xx_hal.h"// Define the SPI handleextern SPI_HandleTypeDef hspi1;#define TEST_BYTE0 0xAB#define SPI_ADDRESS 0x0005#define SPI1_CS GPIO_PIN_0// W25X20CL instructionsconst uint8_t EEPROM_READ = 0b00000011;const uint8_t EEPROM_WRITE = 0b00000010;const uint8_t EEPROM_WRDI = 0b00000100;const uint8_t
Hi All,I am new on STM32 and want to use printf on UART.I could run the printf on uart in the example folder.But couldnt find how does it work, actually couldnt find any comment in it about enabling printf on uart.I am useing STM32CubeMx and want to enable printf on its projects.I have tried some suggestion like adding following function that didnt work:void __io_putchar(uint8_t ch) { /** * \brief __io_putchar - A routine to transmit a single character out the serial port * \return void * \param[in] ch - uint8_t the character to transmit * \author andreichichak * \date Oct 16, 2015 * \details This routine assumes that we will be using UART2. A timeout value of 1ms (4th parameter) * gives a retry if the transmit buffer is full when back to back characters are transmitted, * avoiding dropping characters. */ HAL_UART_Transmit(&huart2, &ch, 1, 1);}Could someone help me on this issue? I am using NUCLEO-L011K4 board.Mostafa
Hi, I'm getting "ai_platform.h" file missing when doing "analyze" under the X-CUBE-AI section.I was following the steps from a contest, I have followed the same steps on a different desktop computer and I didn't have this issue on that system. I don't know why I'm getting this error on my personal computer. For the same ".onnx" file, I'm getting this error on my PC, and the output from analyze shows the size as ~45KB, whereas, the output on the other system (on which I didn't get this error) shows size of ~22KB. Please help me out.
Hallo, according to RM0433 6.4.1 "System supply startup" at point 5. "The software shall then initialize the system including supply configurationprogramming in PWR control register 3 (PWR_CR3). Once the supply configurationhas been configured, the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) shall be checked to guarantee valid voltage levels" How should I understand it? Should the software always wait for ACTVOSRDY bit or should it only if PWR_CR3 is modified? Early start-up in Reset_Handler routine delivered by Cube-MX in /Startup/startup_stm32h7xx.s writes already to SRAM without checking the ACTVOSRDY bit. Quite late initialization in Cube-MX inside SystemClock_Config() does wait for ACTVOSRDY bit with help of: " while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} " but there are no writes to PWR_CSR1 at this place. Moreover, two lines befere there is SRAM access what should not work if exactly ACTVOSRDY is not set as stated in RM0433 in 6.4.1.5.a):"As long as ACTVOSRDY ind
It is now available with CubeMx 6.8 but does it also support STM32U5 which does not have native support for STM Classic Core Middleware libraries?https://github.com/alambe94/I-CUBE-USBD-Composite
Hello. I examined similar questions and answers. Since I'm a newbie, I couldn't find an answer to my problem.In the documentation of the STM32F756ZG development board, it is said that up to 24 channels of ADC measurements can be usable with 3 ADCs. When I want to assign pins in the CubeIDE, warning says that some pins cannot be used due to conflict.There are 2 different conflicts for ADC1, and only one for ADC3. I don't need to use ETH, but even if I set to ETH "disabled", the conflict does not disappear.I wonder if I can make 24 measurements with other available pins. Is it possible?Or does the dev card not allow using all the capabilities of the MCU?
Hello,I am using Cube32MX for STM32H743bi IO multiplexing. first i added USB HS phy ULPI interface then see FDCAN2 not allowed in the tool and error message says it is in conflict with USB ULPI. However i manually checked there were certain pins for CAN2 classic and even FD available.I want to know whether it s some bug or there is some internal MCU sharing between these two that i am unaware of. Else several options are available for FDCAN2 after consuming USB ULPI.thnx
Posted on October 20, 2017 at 07:13 I have a brand-new STM32F303 Nucleo144 and cannot get any CubeMX generated apps to work with USB. The app builds and runs fine, and I can see printf output via SWO, but the device never evenbegins enumeration. The following procedure was used to develop a minimal reproducible example: Start new project in CubeMXSelect Board Selector, Type of Board: Nucelo144, MCU Series: STM32F3, Board NUCLEO-F303ZEUnder RCC, select HSE = Bypass Clock SourceUnder USB, select Device(FS)Under USB_DEVICE, Class for FS IP: Human Interface ClassSelect Clock Configuration tab, allow autoconfiguration, ensure USB clock is correctly set to 48MHzGo to Project Settings, changeMinimum Heap Size to 0x400, Minimum Stack Size to 0x800Choose toolchain to be Makefile (using GCC-ARM for Windows)Save file, Generate SourceEdit main.c to insert some trivial test code (such as the `USBD_HID_SendReport` sample in the 'STM32 USB in 10 Minutes' video)Run make, verify build successUsing ST
HelloIn glass LCD display configuration (for STM32L152RB in my case), for static display, in Cube we can see segment numbers SEG[0-31]. Meanwhile, SEG[31:28] are double numbered, also to SEG[43:40]. To use [31:28] designators there must be MUX_SEG bit in LCD_CR set.After code generation MUX_SEG is still disabled (0). I found the line in MX_LCD_Init function: hlcd.Init.MuxSegment = LCD_MUXSEGMENT_DISABLE;And i can't find proper setting in Cube to enable this MUX, i has to do it manually after code generation.This problem is misleading, because segments 31-28 are located in ROM[0] register, 43-40 in ROM[1] register. Cube shows numbers 31-28, we try to write ROM[0] register, what is not working, because this segments has numbers 43-30 and we should write other register (ROM[1]). And this is because of wrong MUX_SEG bit settings.Could you check this somehow?
I'm going to use CubeMX, is there a way to measure the voltage input through STM32F401CCU6 and ST-LINK? I'd like to know an example code or method if there is
I can't get my board to detect the WiFi chip over SDIO. I configured my boot SD card with a custom Linux install and everything is working except WiFi. It seems the WiFi chip is not recognized at all over the SDIO bus. dir listing of /sys/bus/sdio/devices shows nothing, so the kernel isn't even detecting the chip. I tried using STM32CubeMX to generate a device tree, but this didn't work, and in fact the resulting dts file has references to headers that don't even exist like stm32mp15xf.dtsi. However, the OpenSTLinux that shipped with the board works, and the WiFi chip is seen by the kernel. I have configured everything properly with my kernel config, so I'm not sure where the problem is. I suspect it is with the device tree, but as I mentioned I can't generate a new one due to the missing headers. What should I do?
Hello,I'm working with STM32CubeMX version 6.9.2Each time I generate, all files in Drivers and in Middlewares\Third_Party\FreeRTOS directory are set in read only mode. I can remove it, and each time read only mode is set again.This is really annoying!Seen when generating for L4 µCRegards
Every time I need to configure I2C, which is not often, I have to check the correct rise and fall times for the default 100kHz frequency and doing so I am asking myself a question why the typical 100kHz value is provided by default but rise and fall times are not, when most of the time 1000 and 300ns values are needed and I2C will NOT work with default values 0. Would not it increase user experience if the correct, typical values were provided in addition to the typical clock frequency?Btw, CubeMX calculated timings are slightly off the I2C specs and conditions defined in ST RM docs. I believe the CubeMX algorithm is incorrect. Therefore I suggest to always enable the 'advanced settings' and allow the user to enter timings manually. Explaining why the calculation algorithm is incorrect is beyond the scope of this post.
I'm trying to setup a project with STM32CubeIDE 1.8 (includes CubeMX 6.4) that uses LPUART1 on a STM32L031K6. I want to lower the CPU frequency to 4MHz, and, to reduce power, I'm using HSI/4 as clock input.LPUART baudrate is set wrong (4 times higher than expected according to logic analyzer), it's generated out of PCLK1 frequency that is assigned as HSI_VALUE >> 2. While HSI_VALUE is defined in stm32l0xx_ll_rcc.h:#define HSI_VALUE (16000000U)But, during debug I realize that HSI_VALUE value is 4000000, it is redefined as a compiler directive:-mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DSTM32L031xx -DUSE_FULL_LL_DRIVER -DHSE_VALUE=8000000 -DHSE_STARTUP_TIMEOUT=100 -DLSE_STARTUP_TIMEOUT=5000 -DLSE_VALUE=32768 -DMSI_VALUE=2097000 -DLSI_VALUE=37000 -DVDD_VALUE=3300 -DPREFETCH_ENABLE=0 -DINSTRUCTION_CACHE_ENABLE=1 -DDATA_CACHE_ENABLE=1 -DHSI_VALUE=4000000 -c -I../Core/Inc -I../Drivers/STM32L0xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L0xx/Include -I../Drivers/CMSIS/Include -O
Greetings,I'm having trouble porting the existing CubeMX configuration to a pinout compatible MCU.I'm using STM32H745IIK6 and trying to change it to STM32H755IIK6 following the instructions on page 287. of UM1718 Rev 34 ("Tutorial 5: Exporting current project configuration to a compatible MCU"). But, when I select the MCU and click "OK, Import", I get the following error:The existing CubeMX configuration loads fine and I can modify and save things, but when I try to do this MCU change, that error occurs.Is there any fix to this, since it would be pretty annoying to have to manually copy everyting from the existing CubeMX configuration?I'm using version 6.2.1.BR,Domagoj
Hello,I'm developping a Zigbee firmware for a custom board embedding a STM32WB MCU. So I'm using STM32CubeMX application to configure my card and the Zigbee middleware. For some reason, I need to understand how the differents Zigbee functions work and unfortunately, I only have the header files. So, my question is : How can I obtain the Zigbee source files ?Sincerely, Evandzd
STM32CubeMX 6.9.2 was released on st.com as well as an in-tool update patch. Main issues fixed in this patch: Ticket 158577 - [Bootpath Config] env.bat add quotes to variable stm32tpccli Ticket 158868 - [Bootpath Config] secure manager post build cmd must also generate a .bin file Ticket 158979 - Wrong location of RAM in linker file for secure manager Ticket 158982 - Secure Manager : missing secure manager api files in STM32CubeIDE generation Ticket 159213 - Secure Manager : When enabling RTC MX does not generate SystemClock_config anymore Ticket 159423 - [Boot path Config] Exception occurs when changing Boot Path reference location Ticket 159633 - [Secure Manager] remove TPC access when "Secure Manager" Boot Path has been selected Ticket 160247 - Secure Manager MX code generation on MAC produce wrong postbuild.sh Where do I obtain STM32CubeMX 6.9.2 ? STM32CubeMX 6.9.2: STM32CubeMX - STM32Cube initialization code generator - STMicroelectronics Or in the Home view clic
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.