Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello, I am trying to do an injection conversion of the DFSDM peripheral with the read process being triggered via an internal timer (TIM1) utilising the HAL drivers. Specifically, I want to set the counter to count up and trigger the read process every 9 kHz. So far I haven't had any success in getting the injection conversion complete interrupt to fire, I have confirmed this by setting a breakpoint in the DFSDM1_FLT0_IRQHandler() func, note this is never reached.I am initialising the DFSDM via the cube IDE. I have successfully being able to do a regular conversion when triggering via software i.e. when calling "HAL_DFSDM_ChannelCkabStart_IT()". and have been getting accurate values. I am nearly certain the setup of TIM1 is correct as when trying to do a read of an ADC in the same way it is successful. I have attached screen shots detailing how I have set up the DFSDM, TIM1, and the small amount of code that should be required to get everything to work. Note, I am using an STM32L562VE
Does anyone have the same issue? Link to a similar question:https://community.st.com/s/question/0D53W0000260fFASAY/im-a-stmcube-newbie-im-under-the-impression-when-i-set-up-the-clocks-in-stm32cubeide-it-should-generate-all-the-clock-configurations-right-now-im-not-getting-the-rccperiphclkinittypedef-periphclkinit-0-should-it-be-there-see-clock-configI also want the cubeMX to add "RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};"automatically command in "void SystemClock_Config(void)" function, but it isn't.
Cube MX seems to constantly confuse FreeRTOS Tasks and Threads.Term Tasks is being used where Threads are being actually configured.In FreeRTOS Tasks and Threads are two different beings.This is super confusing.
I created project using ARM MDK (Keil) tool chain where I installed STM32 FW Pack and then using MX Cube to create main.c, stm32F7xx_it.h and stm32F7xx_it.c. I was not using any OS. Application is working ok. Now I am trying to add CMSIS - RTOS2 so I can create threads and get advantages of RTOS. For that I have ticked Keil RTX5 and created main thread as information available on ARM-Keil website. Some how it doesn't work. So has anyone tried and tested CMSIS-RTOS2 with CubeMx successfully?
We have a project that was working with a demo board with a different micro than our final project uses. We imported into CubeIDE an ioc generated by CubeMX by our hardware engineer. We did a bit of work on the project to include source from a variety of libraries and git submodules and get things just-so.We now are switching to the final MCU, and he has generated a new .ioc. to fit it. As far as I can tell, we now need to remake our entire project with the new ioc? Is there a way to swap a new IOC into an existing project?
HelloI have a bunch of STM32G030F6 and they are in TSSOP20 package.I used SWD and BOOT0 pins to program L433 and want to do the same on G030F6However, unlike same TSSOP20 package F070F6 has, G030F6 share BOOT0 pin with SWCLK.19th pin of STM32G030F6 is both BOOT0 and SWCLK.How does one program it using SWD? Do i need another method? I want to build a small devel board for future projects so i need to program both blank and pre-programmed chips.I might be missed some parts from datasheet i apologize if i did.
Hi,For a project I'm using Nucleo STM32L432KC and STM32CubeMX V1.17.0.I'm using the same code template for differents project and it's the first time I get this kind of errors:At some points, when writing to a GPIO of expander PCA9535DB, I have HAL_ERROR returned. This error occurs when in function HAL_I2C_Mem_Write (same error with HAL_I2C_Mem_Read) from stm32l4xx_hal_i2c.c file. /* Process Locked */ __HAL_LOCK(hi2c); /* Init tickstart for timeout management*/ tickstart = HAL_GetTick(); if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) { return HAL_ERROR; } Above the code that return the HAL_ERROR. (from file stm32l4xx_hal_i2c.c)The fact is that the timeout is raised in I2C_WaitOnFlagUntilTimeout but I have no idea why. As the code sometimes work and sometimes not, I assume that I2C address and parameters are correct. (Speed is 100KHz).If someone already has the same behavior, help is welcome.Best regards,Antoine
Hello all,While configuring the FMC SRAM configurations for STM32H747 MCU I found the option for bank swapping.As I see the reference manual I understand that the chip select configured interchanges it's address with that of the SDRAM bank addresses.And I did face an issue to read and write from the SRAM but when I enabled the bank swap option in the cube MX now my SRAM responds correctly.Kindly help me out in understanding the role of BANK SWAPPING here.Thank You!
Hi,I would like to report 2 bugs.I created a blank new project for STM32G030F6P6. When I try to enable USART1, it says "Unknown conflict". See the attached screenshot.For STM32L452RET6, when I set LSE drive level other than the default with LL drivers, the function call to LL_RCC_LSE_SetDriveCapability gets repeated basically in all peripheral initializer functions. This bug has been around for a while, it does not affect functionality but it bugs me.
Creating an CubeMX project with just a minumum of functionallity (M7 / M4 SysTick) can be started for the M7 but not for the M4 ???M4 sometimes works, sometimes raises a memory error!Greatings from Saint Égrève.
I am learning the stm32 using a stm32g070cbt6 micro controller with custom PCB with keil. When I add an external pull-up to the pa4 pin and use it as an input pin. Nevertheless, when I read the pin, the output is low always, even though on the hardware pin is high(3.3v). Yet I couldn't figure out why it happened. Please assist in finding this problem.Thanks in advance.#include "main.h"void SystemClock_Config(void); uint16_t count =0;int main(void){ HAL_Init(); SystemClock_Config(); RCC->IOPENR |= (1<<0); GPIOA->MODER &= ~((1<<8) | (1<<9)); while (1) { if (!(GPIOA->IDR &(1<<4))) // if the pin is low count should increament { count++; } }}void SystemClock_Config(void){ RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSIDiv = RC
MCU: NUCLEO-L433RC-PSTM32CubeMX version: 6.8.0MDK-ARM Community version: 5.38.0.0Java version: 8 update 361 (build 1.8.0_361-b09)When I try to generate code I get this message:The Code is successfully generated under : C:/Users/.../project Project language : C but MDK-ARM V5.32project generation have a problem.I open the generated project with uVision and when I try to build target files I get this message:project\project.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.Not enough information to list image symbols.Not enough information to list load addresses in the image map.In the uVision project window I also noticed that there is no Application/MDK-ARM folder with startup_stml433xx.s file. Does this mean that CubeMX is not generating this file?How could I solve this problem?I would really appreciate the help.
uC: STM32H725AEIxFW-Package: STM32Cube FW_H7 V1.10.0CubeMX-Version: 6.6.1IOC-File: Attached (SPI_bug.ioc)I tried to generate code with CubeMX for my project. I set up SPI2 as Full-Duplex Master without hardware NSS with the follwing pin config:SCK: PB13MISO: PC2MOSI: PC3The code generated in `void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)` looks like the following for MOSI and MISO:GPIO_InitStruct.Pin = SPI_MISO_Pin|SPI_MOSI_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);Although it should look like that:GPIO_InitStruct.Pin = SPI_MISO_Pin|SPI_MOSI_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);=> The configuration for `Alternate` is missing!With the generated code, the MOSI and MISO lines do
I have a program running on NUCLEO-L4P5ZG board. The USB device VCOM runs fine on STM32CubeMX v6.5.0 (STM32CubeIDE v1.9.0). It was broken since STM32CubeMX v6.6.0 (IDE v1.10.0). The problem still exists in STM32CubeMX v6.7.0 (IDE v1.11.2). My workaround is to use the Core\Src\stm32l4xx_hal_timebase_tim.c file from STM32CubeMX v6.5.0. I attached the three files for helping fixing the problem. stm32l4xx_hal_timebase_tim_cz.c is from STM32CubeMX v6.5.0. stm32l4xx_hal_timebase_tim.c is from STM32CubeMX v6.7.0.
Today my STM32CubeIDE does an update to the Version: 1.11.0 (Build: 13638_20221122_1308 (UTC) ) including the CubeMX Version: 6.7.0-RC2 (Build: 20221118-1646 (UTC))Using the FreeRTOS Middleware the generation of the main file has a big bug. There will be the "USER CODE Header" lines instead of the FreeRTOS lines inseide the main()-function.This happens also if I create a new empty project using the FreeRTOS middleware. It will generate the attached main-c-file. See lines 145-151.I haven't searched where the bug comes from.
In the peripheral's User Constants tab, unhighlighted IP Handle Label values are in light gray, which makes them illegible. On my monitor at least.
I did not tested if this is specific to all MCU but for U5 familly this is sure:How to reproduce : Launch cubeMX, (6.7.0)select U5 board like nucleoGo to project manager, and select under Toolchain - Makefile.--> Bug, the Makefile genereted is missing some details on CPU, so cannot build.To solve it add : CPU = -mcpu=cortex-m33after ####################################### # CFLAGS ####################################### # cpuMoreover, and i am not sure about this but I think I read somewhere that U5 was using : fpv5-sp-d16 and not fpv4-sp-d16 as in generated makefileso I replaced FPU = -mfpu=fpv4-sp-d16by this : FPU = -mfpu=fpv5-sp-d16Please review the makefile generation under cudeMX seems to have some mistake for U5 series at least.Hope this help and avoid other to lose time to spot this.
Dear ST,Could you please help me on that how can I solve the below issue?After updating the HALL firmware in teh Cube MX to FW F4 V 1.27.1 when i am regenerating the code. In the place where the FREE RTOS componens are created before a headline of the main.c is generated instead.Do you know is the Firmware update reset some settings?Thank you,David
Hello,I using STM32CubeIDE to create my Code with STM32CubeMX.With version STM32CubeMX V6.6.1 there where no problems.Now with the update V6.7.0 and the project migration all the freeRTOS initialization stuff will no more generated. Following code:/* Create the queue(s) */ /* creation of mailboxCanRx */ mailboxCanRxHandle = osMessageQueueNew (32, sizeof(CanRxMsgStruct), &mailboxCanRx_attributes); /* creation of mailboxCanTx */ mailboxCanTxHandle = osMessageQueueNew (64, sizeof(CanTxMsgStruct), &mailboxCanTx_attributes); /* creation of mailboxEemCmd */ mailboxEemCmdHandle = osMessageQueueNew (64, sizeof(EemJobStruct), &mailboxEemCmd_attributes); /* Create the thread(s) */ /* creation of taskMain */ taskMainHandle = osThreadNew(osTaskMain, (void*) &taskMain_attributes.stack_size, &taskMain_attributes); /* creation of taskWatchdog */ taskWatchdogHandle = osThreadNew(osTaskWatchdog, (void*) &taskWatchdog_attributes.stack_size,
I selected LDO power supplyBut frequency is still limited to 400MHz.
According note of page 27 of datasheet only is possible VOS2 and VOS3. But in STM32CubeMX is possible selections of VOS0, VSO1, VSO2 and VSO3.Thank you in advance
Hi,I'm trying to configure the Ethernet peripheral on an STM32H730, using CubeMX, in order to use it with KSZ8863 PHY. (https://ww1.microchip.com/downloads/en/DeviceDoc/00002335B.pdf)Unfortunately I can't find a way to configure ETH_TX_ER other than just clicking on the pin in pinout view and selecting ETH_TX_ER.If I do so the pin is marked in yellow, which for my understanding suggests it is not configured properly.Additionally it is not shown in the GPIO settings of ETH tab. So I assume there is an issue with it.As I'm new to ethernet on MCU's, I might miss some generic information but I had a look at the reference manual as well and couldn't find any helpful description of ETH_TX_ER and its functionality.Any help or information is appreciated!
In order to control the position of the motor with x-cube-mcsdk, I set the Z phase (absolute) of the encoder.However, I got a compilation error as shown in the attached image.Please teach me how to fix the F/W.The version of each tool is as follows.x-cube-mcsdk ver.6.1.0stm32cubemx ver.6.7.0stm32cube_fw_f3 ver.1.11.3IAR ewarm ver.9.30.1Thank you.
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.