Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am trying to set up STM32F411 disc board with Cubemx, the clock tree is set up as default for the board by CubeMx as shown where system clock is set to 96MHz as shown. The generated code for this is contained in function SystemClock_Config(void). There are two problems with this clock setting: In MX advanced setting, if I set RCC driver in using LL library. The initiating code will stuck in "while(LL_RCC_HSE_IsReady() != 1)". However if the skeleton code is generate by setting RCC to HAL the init code works fine and do not stuck in the middle. The init code generated by CubeMX is attached below. For the RCC code generated using HAL, although the code runs in the debug mode, the system clock and timer clock frequencies are not the same as it mean to be (96MHz/48MHz). This was tested by setting timer pre-scaler and Auto reload register and check the update event. The real frequency seem to be much slower then the expected although all the code for setting system clock is made by CubeM
Hi,I am running Capture Mode at TIM2 channel 1. My CubeMx configuration below. I am getting CCR1 value correctly but i checked at debugger mode, CCR2 value is always 0. Thus i can't measure duty. What's the problem ?
Hello,We have custom board with the STM32H7A3 and when i configure the HSI i always get error at. it return HAL_TIMEOUT /* Wait till PLL is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U) { if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) { return HAL_TIMEOUT; } }I tried with the STM32H7B3 discovery board and its fine when i use the HSI with same configuration.Attached you can see screen of my clock configuration.
Hi everyone,I meet some issue about PWM + DMA on STM32F103 (Bluebill KIT).I generate 7 pulses with frequency 1Mhz and duty cycle of pulses is 50,30,50,50,70,50,0% sequence.But the result have some issue:On my OSC, i see 9 pulses and it more than i need.The 50% pulses repeat 4 times before and after the 70% pulse.I don't understand why !>>> Signal on my OSC: >>> Here is my config in CubeMX:Sys clock=40Mhz, Timers clock=10MhzPWM configDMA configNVIC by default>>> Here is my code:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may
Hi, I'm a beginner!Could you help me, why callback of "RTC Alarm" does not work?What am I doing wrong?Link to a code of main.c https://pastebin.com/75XcH5Qr
Hello, I am running into an issue using the SPI functionality on my STM32H7 chip that is on a custom made board. What I am trying to do is read an adas3022 adc (Link to datasheet below) on a spi peripheral from the STM32H7. I have written functions for the spi protocol that are run in some tasks using freeRTOS. However, even outside of the task, just inside of the main while loop, it seems to not show the pulse of the clock. The gpio pins are shown to be correct (high and low) but the clock pin is not showing anything on the oscilloscope at all. The code also gets stuck on the second loop around waiting for the spi peripheral to get ready but it never does. There is a workaround suggested in the following forum and manual that I have read but it doesn’t seem to work. Below are screenshots of the main code and links to the manual and forum:Figure1: part 1 of my spi_protocol() function.Figure2: part 2 of my spi protocol function.Figure 3: part 1 of my main while loop with the enable and
Are there any CubeMX examples? There are good Repositories for the CubeIDE but can find nothing for the CubeMX
Hello All, I am trying to start a new project which is suppose to run freertos.Once I have enable it then genertaing the code give below warning: But when I try to change the timebase to TIM6, the option is disabled I have enabled TIM6 as below: Can you please let me know what I am doing wrong.
Hello!I just created a fresh project in STM32CubeIDE for STM32L496ZGTxP and included FREERTOS with CubeMX and left everything at its default setting for the time being. After generating the code and compiling, I get 50 compiler warnings. All look somewhat like this:../Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c:443:64: warning: passing argument 4 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion] 443 | (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL); | ^~~~ | &nb
Hi - I'm working on some projects with STM32CubeIDE (1.6.1) and CubeMX (). What I've noticed is that if I generate a CubeMX project targeting a Makefile build the linker directive that is generated has some non-trivial differences with the .ld generated for a STM32CubeIDE project.Even in the header, you can see from the comment:** Author : Auto-generated by System Workbench for STM32that the tool is generating an outdated ld. If you diff the two files, you'll see how _estack is defined is different, there are many missing ALIGN(4); calls, RamFunc is missing, etc.I think this is just an oversight, and should be corrected in the next build of CubeMX/CubeIDE.
Hello,I have developed an application based on lwIP and freeRTOS for STM32F746NGH6. The code was generated using STM32CubeMX, freeRTOS version 10.2.1, CMSIS-RTOS version 2.00 and Cube FW F7 V1.16.1.The application runs a webserver and receives data from a client at the rate X Bytes/min.The program crashes after around 60 hours. To quickly test this, I reduced the datareception rate at X Bytes/4sec. The program crashed after around 10 minutes. The analysisusing fault analyzer of STM32CubeIDE showed that the cause of the crash is precise data bus access error (PRECISERR).The cause of error seems to be the function HAL_ETH_GetReceivedFrame_IT. Please see theattached snapshots (good case and bad case). According to me, at the time of crash, the address of RXDesc ist invalid which is causing the PRECISERR. Normally the address of RXDesc is 0x2004C000 but I do not understand how this is getting corrupted.This is an excerpt from my linker script:/* Memories definition */MEMORY{ RAM (xrw) : OR
Hi,I'm new to STM32 board and following a tutorial which uses DAC. The board I'm using is STM32F411E-Disco, and I select the board in CubeIDE to create a project.The board 32F411EDISCOVERY - Discovery kit with STM32F411VE MCU - STMicroelectronics has a DAC but I can't find it when I try to configure the pins in CubeIDE/CubeMX.Do I miss something?
..
Hey Guys , I have stm32l053r8 custom board . I am trying to send the data using LPUART but unable to send any data. I have shared the snapshot of the code and the configuration . Please do let me know what I am doing wrong ?Thanks in advance.
Hi, I've created a custom board with the STM32F405RGT6. I am trying to simultaneously send two sinewaves (90 deg out of phase) from the two dac channels to an IQ modulator chip. The DAC is set up to have data given to them via DMA (DMA streams 5 and 6). Both channels of the DAC are currently set up with timer 8 trigger output as the trigger event, although ideally I would like to change that to timer 2 later. The problem right now is that for some reason, only DAC channel 1 is sending out a sine wave, while DAC channel 2 is doing strange things - sometimes the signal I get is just at ground, sometimes it is like a small constant signal (like 10s of mV), and sometimes I get like a weird wave. The thing is, both DAC outputs have identical configurations I believe (configuration in cubeMX attached). I have checked the hardware and there are no problems (both output pins are connected to the correct pin on the MCU, neither of them are shorted to ground or anything. Also, I've seen these si
Hello,Quite possibly a dumb question as I am just starting to use STM32CubeIDE, but using Pinout & Configuration editor for STM32F469NIH device, I immediately (without any more allocations) see DSIHOST as greyed out. No helpful hints of any kind are displayed. This is a critical interface for me. Why is it greyed out???
Hi All,Presently my systick timer is set to 1ms. Does anyone know how to configure that to be set to 1us? Also can It be set such that it increments by 0.1us?This is the present clock configuration Here is the present system clock configuration code that I havevoid SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSI14; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSI14State = RCC_HSI14_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.HSI14CalibrationValue = 16; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; if (HAL_RCC_OscC
I'm using STM32H747xi with cubemx and keil. In openamp, I add below these;in project file / stm32h747xx_sram1_CM7 and stm32h747xx_sram1_CM4. These have .scf . I have still error. Anyone know that about this solution.
I'm using STM32H747 disco with Cube MX and Keil. I have don't enable "openamp" in Cube MX. I have downloaded and added STM32MP1 packages but it didi't change. Anyone know that how to solve this problem? Thanks.
Hello all,When upgrading to latest STM32CubeIDE 1.7.1, the generated project for STM32L431 did not trigger SysTick_Handler anymore.I diffed the project from another project generated with 1.5.1 where it was working.I found that it exclusively had to do with the file "Core/Src/system_stm32l4xx.c". There seems to have been some changes to VTOR addresses.I diffed the files between projects with the following command:$ diff working_project/Core/Src/system_stm32l4xx.c failing_project/Core/Src/system_stm32l4xx.cI attach the diff in hopes for an explanation on what is wrong or in hopes that this is a bug that can be resolved.[EDIT]I noticed in the release notes for STM32L4xx CMSIS that this was added in V1.7.1:system_stm32l4xx.c/.hUpdate VTOR configuration to be modified by userI understand that flexibility might be good but should not the default generated project at least have a working solution?Best regards,Anton
CubeMx generates the following code /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_RTC_Init(); MX_USART1_UART_Init(); MX_TIM5_Init(); MX_SPI1_Init(); MX_TIM14_Init(); MX_I2C1_Init(); MX_QUADSPI_Init(); MX_SAI1_Init(); MX_SAI2_Init(); MX_SAI3_Init(); MX_DMA_Init(); MX_SPI3_Init(); /* USER CODE BEGIN 2 */this does not work because MX_DMA_INIT should be called before other peripherals which use DMA,Pperipherals clock initialization has moved to HAL_???_MspInit functions, so the initialization sequence is important.
i see in stm32u5xx_hal_dma.c that only normal mode ofr dma is compliant. How can I manage the ciricular mode ?
When using IDE 1.7.0, viewing the NVIC configuration window in the configuration tool and then generating code without changing anything causes the .ioc file to be modified. I tried the same thing in CubeMX 6.3.0 and the bug doesn't occur there.I've attached the .ioc file I've been using. The modification is that line 179 (NVIC.TIM2_IRQn...) gets deleted. I suspect that it is related to Timer 2 being used as the timebase source because changing time base sources to different timers doesn't add the corresponding IRQ. Possibly also some interaction with FreeRTOS, but I haven't investigated enough to be sure.Has anyone seen similar behavior and/or have an idea of a setting or config that might be causing this behavior?
i am bit flabbergasted to find that it became impossible to selected DMA channels for I2S. when i try to select a DMA channel for I2S peripheral the IDE responds with a scruffy "No available DMA requests for this peripheral" i am running the following setup:STM32CubeIDE 1.7.0STM32H7 FW 1.9.0macOS 11.5 i can confirm that I2S + DMA used to work in the past on older versions of IDE + FW.
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.