Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
HI,In my design, i am using stm32h7 micro controller. I am using RTC clock using LSE clock source.in LSE_READY_BIT was not set. How to debug the issue..I am generating the code from CubeMX. The LSE crystal was selected in Crystal/Ceramic Resonator. while running the program, RCC clock config is not getting completed due to LSERDY_FLAG not getting set in RCC_BDCR registor. 1) How to know and how to verify the LSERDY_FLAG is set or not??2) How to find whether the problem is in software or Hardware and how to validate?? Thanks,
I am trying to receive 16bit data(at once) through SPI and transmit 8 bit data through USART.clock frequency 16MHz. All initialization done using STM32CubeMX. and build was successful .but after writing following codes , control enters in Hard Fault at first byte receive.variables declared:uint16_t buffer_t[2];uint8_t buffer_r[8];uint8_t data_tx8[16];codes written in while loop:HAL_SPI_Receive(&hspi2,buffer_t,8,10000); uint16_t j=buffer_t[1]; uint16_t k=buffer_t[0];I am not able to understand why hard fault occurs here. (Same code runs properly if the code is configured only for SPI receive). I am using STM32L072 discovery kit.thanks in advance.
Dear Team,Need guidance for the selecting the interrupt there are two types are available external interrupt mode and external event mode, in our condition the GPIO will be high "logic level 1" normally when the interrupt initiated the GPIO pin will go to "logic level 0" then the interrupt program will run In STMCubeMX NVIC is enabled and in the interrupt mode which to select ?PFA of project files in rar format RegardsSudeendra S
Minor bug, but it threw me off for a bit. When selecting ETH for the STM32H750, in the Parameter Settings there is a warning that ETH can only work with address 0x2400_0000. That is actually D1 SRAM which is not accessible by the Ethernet MAC, it needs to be D2 SRAM. The actual settings below (0x3004_0000) are correct, but the warning is incorrect. I don't have Ethernet working yet, but hopefully soon...will
Hello,We are currently evaluating a replacement solution for our current microcontroller. STM32 is currently one of the favorite contestants.The current software is written in C++ and uses alot of code that is pure C++, so no relation to the actual hardware used. In case of a replacement, we only would have to adjust the hardware commands like SPI Transmission command, if the new MCU would support C++. In case of only C support, we would have to re-write all of the C++ libraries followed by extensive testing. This would result in weeks of work and therefore cost.When i took a look at Atollic, i noticed that is advertised as "Highly optimized C/C++". Sadly i noticed that CubeMx only creates C code, and the HAL-Libraries are all C. There are a lot of different tutorials on the internet that claim making Atollic Projects C++, but alot of them are get no response if its truly working.So it tried the following steps:1.) Generate Emtpy project with CubeMX2.) Edit the .cproject file and add&l
I have inserted this simple code to the main() of the CubeIDE generated code. /* USER CODE BEGIN 2 */ HAL_StatusTypeDef status = HAL_UART_Transmit_DMA( & huart3, buf, sizeof(buf)); /* USER CODE END 2 */It should transmit a short message through the STlink console, and then, cause interrupt. But none of these occurred. I have checked on Nucleo F733ZE and Nucleo G431RB( 64pin ). The demonstration program of this problem is attached as zipped. file. To see the demo of the problem. Start the tty program for the STLINK console. Include two project ( for Nucleo F722ZE and G431RB ). Build them Set break point to the interrupt handler of the DMA and UART ( stm32f7xx_it.c and stm32g4xx_it.c)Run the test program. If the program run correctly, you will see the message on the terminal program on host, and program stop at break point on interrupt handler. I could not see these behavior. The environment is :Ubuntu 16.04 LTSCube IDE 1.1.0STM32Cube FW_F7 v1.15.0STM32Cube
HI,First time user stm32l4 nucle and I struggle to get DAC1 out2 processor voltage (using CubeMX and HAL). Is my problem due to bridge 18 of A4 and D4 or there is something wrong with stm32l432?. DAC1out1 works as programmed but not out2. As A4 and D4 shorted I try to setup D4 as Analog or GPIO Digital In , still not getting Out2 signal. Do I need to dummy clock D4 or remove bridge18.
Hi,I have created a project with STm32CubeMX for a stm32F412VET6 microcontroller. I have configured the clock at 64MHz, I also have 1 SPI and 10 outputs. The project builds correctly and is running on the target correctly.Now when just changing the clock frequency to 100 MHz, the projects still builds properly. However, when I launch the code after calling the HAL_GPIO_Init function, it goes in HardFault.
Hi Team, I need you support, I am using STM32F429zi, CubeMx Version 5.3.0, STM32Cube_FW_F4_V1.24.1, REERTOS_version 10.0.1 and Platform is atollic truestudio.Issue: Ethernet UP/Down Link status I enable, #define LWIP_NETIF_STATUS_CALLBACK 1#define LWIP_NETIF_LINK_CALLBACK 1observation: Ethernet INT4 is not enable or is not heating.
Posted on July 02, 2018 at 08:57 I am developing under STM32F4 platform. After migrating from v1.0 to v1.0 firmware, which involves a major change in CAN API, I found there's a mistake in the CubeMX CAN setting options: The generated code relating auto retransmission changed from hcan1.Init.NART = DISABLE;�?�?�? to hcan1.Init.AutoRetransmission = DISABLE;�?�?�? However, the setting option in CubeMX is still NART, which is the inverse of Auto-Retransmission. This option name is very misleading and caused my robotics application that requires a high frequency CAN transmission fail randomly. I found this after catching a ALST (Arbitration Lost Error). Please update the cubemx software to change this setting name. #can-bus #cubemx-4.26
Using the STM32CubeIDE with integrated MX I get a situation where I can only change one peripheral at a time. Say you want a ADC and a timer. You can click the ADC and its generates the pins and the setup dialog. Then click the Timer and nothing happens. Close and save, reopen, and now the Timer can be clicked and configured.By design or a bug?
The GENERATE function in STM32CubeMX version 5.4.0 does not generate the line that begin:CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall ....in the Makefile when generating code for a new project using the STM32L010R8Tx that is to be compiled with gcc. It does work properly for the STM32L476RGTx and the STM32L011K4Tx. I believe that the STM32L010R8Tx is new. Is this problem a bug or was it intentional, and if so, why?Best regards,Peter
I have written a program in the STM32CubeIDE to receive UART data using DMA. I am using the STM32F030K6T6 processor. I am using the HAL functions, eventually doing a call to HAL_UART_Receive_DMA.In the *.ioc file, USART1_RX is set to use DMA1 Channel 3, Peropheral to memory, and Memory increment is checked.Stepping through the HAL code with the IDE, there is generated code like this in main: /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ADC_Init(); MX_TIM1_Init(); MX_I2C1_Init(); MX_USART1_UART_Init(); MX_DMA_Init();The call to MX_USART1_UART_Init gives rise to the following stack trace:(gdb) bt #0 HAL_DMA_Init (hdma=0x200001a4 <hdma_usart1_rx>) at ../Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c:140 #1 0x08001340 in HAL_UART_MspInit (uartHandle=0x200001e8 <huart1>) at ../Core/Src/usart.c:96 #2 0x08004a64 in HAL_RS485Ex_Init (huart=0x200001e8 <huart1>, Polarity=0, AssertionTime=0, DeassertionTime=0) at ../Drivers/STM32F0xx_HAL_Driver/Src
Help!Generating a minimum configuration with UART1 in DMA mode.The blocking version if(1) works, but with if(0) the DMA version nothing comes out. Configuration file for CubeMX attached.What am i missing?? /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ static uint16_t usLEDfwTimer=0; static uint8_t ucByte[]="A"; if(++usLEDfwTimer>=50000) //around 10 times per second { usLEDfwTimer=0; if(1) { HAL_StatusTypeDef sU=HAL_UART_Transmit(&huart1,(uint8_t*)&ucByte[0], 1,1); //this works ! }else { HAL_StatusTypeDef sU=HAL_UART_Transmit_DMA(&huart1,(uint8_t*)&ucByte[0], 1); //dosent work } if(ucByte[0]>'Z')ucByte[0]='A';else ucByte[0]++; } } /* USER CODE END 3 */
I have mentioned, that the STM32CubeMX code generator regenerates header and source files even if there are no changes. This is very annoying, because my version control system always wants to check in the "new" files...I have mentioned this behavior in the macOS Catalina and the Windows 10 version. After I created a new project, this behavior was gone immediately. But I don't want to recreate all my projects now...Best regards!
I have a nucleo-f103rb, and I downloaded the STM32Cube_FW_F1_V1.8.0 to try some examples. The Import function is not available in the software, and in case i try to load a project, I should have .ioc files which I do not in the STM32Cube_FW_F1_V1.8.0 folders. What am I doing wrong? (Im using Debian, CubeMX and Ac6).Thanks in advance
Recently I've found that whilst I was developing, Google Chrome would all of a sudden just crash with a memory error. I look over to task manager and realise that the CubeMX software which I was using to develop my Nucleo F303K8 (not a massive processor) was taking up 2.5GB of RAM. I've attached a screen shot, was wondering if anyone else has had this problem??
In STM32CubeMX v5.4.0 I generated a project using STM32L452RET6, where I disabled the systick timer by selecting "TIM16" as timebase source under "SYS".After code generation, the unedited project doesn't compile as TIM_HandleTypeDef cannot be resolved.This issue is fixed by enabling at least one other TIM via CubeMX.It seems that using a timer as system timebase (which generates stm32l4xx_hal_timebase_tim.c) doesn't apply the correct define to enable the declaration for TIM_HandleTypeDef
Hi,I would like to know, when STM32CubeMX will support FreeRTOS 10.2.BTW: Is there any roadmap or plan where we can look it up?Best regards
Good evening,I had a problem using the HAL_SPI_Receive () function with the SPI configured in SPI_DIRECTION_1LINE in 8 bits mode.this function generated 16 dummy clock periods instead of 8.the SPI was configured like this:static void MX_SPI3_Init(void){ /* USER CODE BEGIN SPI3_Init 0 */ /* USER CODE END SPI3_Init 0 */ /* USER CODE BEGIN SPI3_Init 1 */ /* USER CODE END SPI3_Init 1 */ /* SPI3 parameter configuration*/ hspi3.Instance = SPI3; hspi3.Init.Mode = SPI_MODE_MASTER; hspi3.Init.Direction = SPI_DIRECTION_1LINE; hspi3.Init.DataSize = SPI_DATASIZE_8BIT; hspi3.Init.CLKPolarity = SPI_POLARITY_LOW; hspi3.Init.CLKPhase = SPI_PHASE_2EDGE; hspi3.Init.NSS = SPI_NSS_SOFT; hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi3.Init.TIMode = SPI_TIMODE_DISABLE; hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi3.Init.CRCPolynomial = 7; hspi3.Init
Dear all,the more I dig into the CANFD programming the more question marks I have concerning the CubeMX functionality.For instance you can select CANFD1 and CubeMX is proposing to use the pin PH14. However, according to DS12931 Rev 1 this pin is very likely just able to work in CAN mode but not in CANFD. On the other side quite a few pins are missing in the pinout view that should be able to offer CANFD functionality according to the above mentioned document but the tool is not offering to configure them accordingly. So if ST support is reading that message I would be really interested if I'm overlooking something or if CubeMX has its problems in the described way. Certainly in the latter case I would be interested when a new revision is expected.Best RegardsMarkus
I am trying to generate pulses using output compare mode for my stepper motor on my board STM32f103C8T6 and STM32F401CCU6 on various timers. For some reason I am not able to change the period i want the signal to toggle at i.esConfigOC.PulseHere is my config:Here is my output, it remains the same regardless of changing the pulse:Here is my code:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * *********************
I have a new NUCLEO-H743ZI2 board and STM32CubeIDE.I've made a Blinky project and seen it work - via led and debugger.I'd like to configure a timer - using MX gui or not - and see it working in the debugger.I tried this...I created a new STM32 project.Using MX, I setup TIM3 as below.Then, I pressed the debug icon.The debugger stops at HAL_Init().I open the live expression window and put a breakpoint in main.c - as shown below.Then, I press the 'Resume' button repeatedly.The code stops at my breakpoint each time.I assume the timer is running all the time.So, I'm expecting TIM3->CNT to have a different value each time I push the 'Resume' button.But TIM3->CNT is always zero.What am I doing wrong?Here's what I put in the MX configuration for TIM3... I didn't edit the MX-generated code - just added breakpoint.Here's TIM3 in the debugger expression window..
Hi.After an Update from V1.0.2 the V1.1.0 works fine, but when I restart the program, it never open. I try to restart the computer, re-install de SW (downloading directly from the web), if I re-install a previous version (the V1.0.2) the program open.Also I saw the task administrator, in details (in V1.1.0) the task STM32cubeide.exe (with 871492k of memory) apears but not the process.A little problem on V1.1.0 in CubeMx the configuration window doesn't fit correctly, and the scroll bar don't appear.My computer is a Lenovo Ideapad320 with an AMD A12 9720p and Windows 10 Home 64bitthanksEDIT:when I create a new project in V1.0.2 says "Java heap space" and close the IDE
I'm a relatively new user but am just about getting up to speed with STM32 family and STM32CubeIDE. I love that there is a gui that helps to generate code to configure peripherals, however I am learning to distrust some of the detals of the code generation :(One that just cost me a few hours of head scratching:I was setting up an STM32L4R5ZI (nucleo) board as a full duplex SPI slave, and had configured all the pins & settings correctly. Blocking mode HAL_SPI_TransmitReceive was working, but when I configured DMA and used the _DMA variant of the function, I could not get any of the DMA complete interrupts or callbacks to fire.I compared my code over and over again to an example, until I randomly looked at the initialization code that Cube had generated for me, which included this block: MX_GPIO_Init(); MX_LPUART1_UART_Init(); MX_USART3_UART_Init(); MX_USB_OTG_FS_PCD_Init(); MX_SPI1_Init(); MX_DMA_Init();I found that if I moved the DMA_Init line before t
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.