Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
See attached .ioc Tried to change LIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY from 5 to 1 in the FreeRTOS settings, but didn't seem to allow me to lower the priority levels in NVIC settings.
Hi everyone,I am working on an experiment using the STM32G0B1 NUCLEO board to implement the PMBUS slave functionality with the SMBUS middleware.According to AN4502, the buffer in SMBUS_StackHandleTypeDef *pStackContext is described as being used for IO. I have a question regarding handling master requests. When the master sends a command to read the input voltage, such as PMBC_READ_VIN (0x88), at what point should the application layer populate the buffer with the data so that the master receives the correct value?If anyone has experience with this or could provide example code, I would greatly appreciate your help.Thank you!
Using STM32CubeMX Version 6.11.1 for code generation of STM32U545RETxQ LQFP64.When pressing "Generate Code" there is a message recommending SMPS setting from the PWR menu.However, no SMPS there and not anywhere in the configuration menu. (Attached)Any idea?
Hello there,I’m trying to squeeze functionality into an STM32U5 MCU via the STM32CubeMX tool.After setting the pins, the clock configuration fails to find a solution.The requirements for the clock are to run from an internal source, as the design is cost-sensitiveand run the system clock as close as possible to the maximum possible clock, which is 160MHz.I tried a few system clock values, but STM32CubeMX always failed, also, STM32CubeMX does not provide a direction or an alternative solution (e.g. Here is an alternative solution but it runs only at a system clock of XXX MHz).I’d like to emphasise that each such clock configuration search is very long (more than an hour on a strong computer), but eventually always fails. What would be the best way to move forward?
Hi,I did setup CubeMX latest(6.13) and previous version , Kaspersky have seen virus and I ignored it. After that I got some malfunction on my pc like internet connection disabled, windows bar doesnt work.
Good Morning, I'm using Simulink to develop code for the STM32F767 MCU, however we're looking at moving to a newer micro (STM32H7R318T6). This MCU doesn't seem to be available in STM32CubeMX V6.4.0, which is the officially supported version, so I have 2 questions: - From STMicro's side, is there any reason why a later version won't work with Simulink? I understand if STMicro can't/won't answer this query. - Is there a way of making these more recent MCU's available in V6.4.0 that I've completely overlooked?
Hello,Since the latest release of CubeMX (6.12.1), I have been encountering syntax errors related to the "FLASH.ld" file. This issue only arises when I generate code while setting the Toolchain/IDE to CMake. I am using STM32H753IIKx. It seems that CubeMX does not specify which RAM to use when setting the Toolchain/IDE to CMake.I have also included the FLASH.ld file that was generated for your reference. Thanks for your help.
Hello. I have been using STM32CubeIDE for a long time where I did not really need to bother about make or any other tools to build my projects since everything is already prepared for you within the STM32CubeIDE for the ease of use.My OS : Windows 11I wanted to learn more about make and how it works. Perhaps in the future we would make a switch to make as our main toolchain to build the projects as it might be more universal.I have followed 3 steps:1. Install MSYS2 (make)2. Install gcc-arm-none-eabi-10.3-2021.10-win323. [code]cd[/code] into my project directory and run command:mingw32-makeIt tried build the project and I got the following error: C:\Users\petrikas.lu\Work_no_sync\stm32_make_test\stm32_make_test>mingw32-make mkdir build arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F407xx -ICore/Inc -IDrivers/STM32F4xx_HAL_Driver/Inc -IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32
I am running STM32CubeIDE Version: 1.11.2 Build: 14494_20230119_0724 (UTC). When I startup CubeIDE, I am seeing the following error in the Error Log: "CubeMX plugin appears to be active, Log4j initialization might be too late."I would appreciate it if someone could point me in the correct direction to resolve it (or ignore it). I am relatively new to CubeIDE, as I have primarily been doing my STM32 work from the command line with Makefiles. CubeIDE seems to be working fine so the error is not slowing me down at the moment.
I have a few errors with the generated output of the mx-generated.cmake files on TrustZone projects using the CMake toolchain.First off, STM32CubeMx puts the startup assembly file into the `Secure/startup` and `NonSecure/startup` folders. The mx-generated.cmake file capitalizes `Startup` though, so CMake won't find the file on some systems: ./Core/Startup/startup_stm32u585xx.s My other issue is that if you include the STM32_USBPD_Library, it doesn't have the correct relative path for any files in the `Middlewares/ST/STM32_USBPD_Library/Core` folders. It has a `.` instead of `..` in the include directories, sources, and linked directories. What's weird is that all the other files in the libraries are fine. Here are some screenshots of these errors:I'm testing on an STM32U585VIT6Q.
STM32CubeIDE 1.15.1, Windows, STM32H563 MCU When MX_ADC2_Init() generated by saving IOC file I get the wrong sampling time and rank for Vddcore. The IOC file shows 640.5 cycles and rank 3 but MX_ADC2_Init() shows 2.5 cycles and rank 1: /** * @brief ADC2 Initialization Function * None * @retval None */ static void MX_ADC2_Init(void) { /* USER CODE BEGIN ADC2_Init 0 */ /* USER CODE END ADC2_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC2_Init 1 */ /* USER CODE END ADC2_Init 1 */ /** Common config */ hadc2.Instance = ADC2; hadc2.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV16; hadc2.Init.Resolution = ADC_RESOLUTION_12B; hadc2.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc2.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc2.Init.EOCSelection = ADC_EOC_SEQ_CONV; hadc2.Init.LowPowerAutoWait = DISABLE; hadc2.Init.ContinuousConvMode = ENABLE; hadc2.Init.NbrOfConversion = 3; hadc2.Init.DiscontinuousConvMode = DISABLE; hadc2.Init.ExternalTrigConv = ADC_
I'm using at STM32H563VITz in LQFP100 package.According to the reference manual (RM0481 Rev 21209) I can use the internal Voltage Reference (and then set it to 2.0478V)I've also referenced the post at: How to configure VREFBUF on my STM32 - STMicroelectronics CommunityWhen I open the .ioc file for my project. I don't have the option to select the Internal Voltage ReferenceIt could be a bug in Cube MX - but I suspect it's more likely that I haven't enabled some component or peripharl in the .ico file?
Hello,I've generated code for a dual cure MCU (stm32H755) and tried to build the project (on a unix system). However, I get an error in `mx-generated.cmake` indicating that the startup file cannot be found. I tracked down the issue to the directory for the startup `.s` file being in `startup` all lowercase, while the CMake expects `Startup` (capital S). Here's an example:target_sources(${CMAKE_PROJECT_NAME} PRIVATE ./Src/main.c ./Src/stm32h7xx_it.c ./Src/stm32h7xx_hal_msp.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c ../Drivers/STM32H7xx_HAL_Driver/Src/stm32
Hi everybody,I found a bug in STMCubeMX in the way it generates .ld scripts.Context:STMCubeMX V 6.12.1 (linux)EVK : NUCLEO-F446REToolchain/IDE : Makefilearm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)Problem:The STM32F446RE Tx_FLUSH.ld file generated by STMCubeMX contains several errors that do not allow a link to be made correctly using Makefile.Here are the difference :Notice:the STM32F446RETx_FLASH.ld.CubeMx is the one generated by STMCubeMXthe STM32F446RETx_FLASH.ld is the corrected oneThey are both stored in the attached zip.diff -rup ./STM32F446RETx_FLASH.ld.CubeMx ./STM32F446RETx_FLASH.ld --- ./STM32F446RETx_FLASH.ld.CubeMx 2024-10-06 08:43:28.775227144 +0200 +++ ./STM32F446RETx_FLASH.ld 2024-10-06 08:43:23.579187576 +0200 @@ -53,7 +53,7 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ -_estack = ORIGIN() + LENGTH(); /* end of RAM */ +_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */ /* Generate a link error if
Lines 19 and 26 are repeated. Mode is set to normal (0x0000) twice. The structure is already initialized to `={0};` it doesn't need to be overwritten once, let alone twice.Initialized for STM32H563.usart.c /* GPDMA1_REQUEST_USART1_TX Init */ DMA_InitStruct.SrcAddress = 0x00000000U; DMA_InitStruct.DestAddress = 0x00000000U; DMA_InitStruct.Direction = LL_DMA_DIRECTION_MEMORY_TO_PERIPH; DMA_InitStruct.BlkHWRequest = LL_DMA_HWREQUEST_SINGLEBURST; DMA_InitStruct.DataAlignment = LL_DMA_DATA_ALIGN_ZEROPADD; DMA_InitStruct.SrcBurstLength = 1; DMA_InitStruct.DestBurstLength = 1; DMA_InitStruct.SrcDataWidth = LL_DMA_SRC_DATAWIDTH_BYTE; DMA_InitStruct.DestDataWidth = LL_DMA_DEST_DATAWIDTH_BYTE; DMA_InitStruct.SrcIncMode = LL_DMA_SRC_INCREMENT; DMA_InitStruct.DestIncMode = LL_DMA_DEST_FIXED; DMA_InitStruct.Priority = LL_DMA_LOW_PRIORITY_MID_WEIGHT; DMA_InitStruct.BlkDataLength = 0x00000000U; DMA_InitStruct.Mode = LL_DMA_NORMAL; DMA_InitStruct.TriggerMode = LL_DMA_TRIGM_B
I am seeing a similar issue in STM32CubeIDE v1.15.1 when trying to configure the FDCAN for the STM32G432KB - I am not able to set "Nominal Time Seg1" or "Nominal Time Seg2" to '1'.
I'm planning to build a low-power Ethernet project using the STM32H573VI microcontroller. I need to use an SMPS to lower power consumption because of that reason i choose that MCU. During createation of project, I noticed that STM32CubeMX offers RMII interface configuration, but I've found that RMII_RXD0 and RMII_RXD1 pins are missing in that configuration. Upon checking the datasheet, it appears these pins are not available. Is it normal for CubeMX to display RMII configuration options even if they are not supported, or am I overlooking something?Additionally, when I tried configuring MII-half duplex, I also encountered missing pins. Could anyone confirm if it's possible to use any Ethernet PHY interface with the STM32H573VI-TxQ variant, especially considering these pin limitations?
HiI’m using CubeMX 6.12.0 with a STM32U5G7VJT6Q project.When using a fractional divider setting for PLL3 (in the RCC System Clock configuration), CubeMX generates the below LL library code.The LL_RCC_PLL3FRACN_Enable() is correctly included, but it seems the fractional divider line (e.g. LL_RCC_PLL3_SetFRACN(1024)) is missing from the generated code.When switching to HAL it is included correctly.void PeriphCommonClock_Config(void) { LL_RCC_PLL3_ConfigDomain_HSPI_LTDC(LL_RCC_PLL3SOURCE_HSE, 1, 9, 5); LL_RCC_PLL3_EnableDomain_HSPI_LTDC(); LL_RCC_PLL3_SetVCOInputRange(LL_RCC_PLLINPUTRANGE_8_16); LL_RCC_PLL3_Enable(); /* Wait till PLL3 is ready */ while(LL_RCC_PLL3_IsReady() != 1) { } LL_RCC_PLL3FRACN_Enable(); }
I am using STM32H747BITx MCU and i've try CubeMX6.12.0 ,CubeMX6.10.0.Still the same problem. If I do not enable TouchGFX in CubeMX, I can successfully generate the code. However, if I enable TouchGFX, an error message like the one shown in the picture appears, and it cannot be compiled correctly in CubeIDE.
In my project I use 4 adc, managed with the same code. With adc5, and two channels, I had a problem: I read two equal values, that is, the second was equal to first channel.After several searches I discovered that, in the adc.c file created by cubemx, in the section relating to adc5, the line -->sConfig.Channel = ADC_CHANNEL_2;<-- was missingFirst channel configuration /** Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_1; sConfig.Rank = ADC_REGULAR_RANK_1; sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5; sConfig.SingleDiff = ADC_SINGLE_ENDED; sConfig.OffsetNumber = ADC_OFFSET_NONE; sConfig.Offset = 0; if (HAL_ADC_ConfigChannel(&hadc5, &sConfig) != HAL_OK) { Error_Handler(); } /** Configure Regular Channel */Second channel configuration--> sConfig.Channel = ADC_CHANNEL_2; <<-- this was not theresConfig.Rank = ADC_REGULAR_RANK_2; I have re-done the configuration with Cubemx several times but the problem remainsIs it a bug?Can I do something?It is annoyi
Hi!STM32CubeMX generated an incorrect linker file, and I can't build the project with cmake.Example project attached to the post.cmake version - 3.28.1STM32CubeMX version 6.12.1
A BUG when generate code for toolchain `makefile` or `cmake`.My develop environment: Linux PC After generated code, I run `make` and got errors:```/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld:STM32F103C8Tx_FLASH.ld:56: syntax errorcollect2: error: ld returned 1 exit status``` After my investigation, I found that the reason was that all the RAM symbols in this file were replaced with empty! For example: Line 56: _estack = ORIGIN() + LENGTH(); /* end of RAM */Should be: _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */ Line 146: } > AT> FLASHShould be: } >RAM AT> FLASH Here is the patch will fix the BUG: diff --git a/STM32F103C8Tx_FLASH.ld b/STM32F103C8Tx_FLASH.ld index 42d7927..05df42a 100644 --- a/STM32F103C8Tx_FLASH.ld +++ b/STM32F103C8Tx_FLASH.ld @@ -53,7 +53,7 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ -_estack
It's working now. But I have to comment this line __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE(); line in the CubeIDE generated code for it to work
Hi, When I'm generating code with the latest STM32CubeMX 6.12.1 and STM32CubeIDE1.16.0 then sometimes my user folder with the include files were deleted. I don't know yet, why sometimes the folder is not deleted (maybe only small changed in the .ioc file). My Folder is in Middleware\Third_Party\myFolder. Is there a rule were the user folder are allowed to be?Is it a bug from CubeMX or miss use from my side? (Do I have to do something special when I'm adding a new user folder?) Thanks in advancenobody
Hello STM-Team,I'm working on my project with an STM32H723ZG and ran into an issue with the code generation when I selected "Network Interfaces" in the AZRTOS configuration.The code generation will add "NX_ETH_INTERFACE_ENABLED" to the "RTE_Components.h" but forget the "#define" in front of it. That is somewhat annoying because I have to manually add this everytime I regenerate the code.
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.