Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello,I download the STM32CubL4 that are the follow,why everytime the files size are different and unzip says the file is not completed? Thanks!
Hi everyone,I'm currently working on validating my model on the STM32F746NGHx board. I've added all the necessary extensions, but I'm encountering an error. It appears that the call hierarchy only includes a single function when I generate a c code. Could anyone help me understand what's going wrong?I've attached screenshots for reference. Any insights or suggestions would be greatly appreciated!
I think it's a common scenario to have (at least some) peripherals which are not enabled until needed?Or, perhaps, just configured at start-up, but not enabled until actually needed.eg, an RTC alarm.But CubeMX doesn't seem to support this:If you don't enable the peripheral/feature, it won't let you configure it;If you do enable it, it will be enabled at startup - no option to leave it til "later"Or have I missed something/?(none of the available tags seems appropriate, so 'Bug Report' chosen as least inappropriate. I'm using F0, but this seems to be general Cube MX behaviour - not specific to any series)
Hello, i am using netxduo in one of my projects and need to use TFTP addon. I am wondering how to activate / install this addon in software selection. There are also some other addons missing. How is it supposed to install and use such missing addons? best regards Alexander
Hello,I create my project for the Nucleo STM32G474 board in CubeMX using an output CMake file and now I want to enable exception handling. I noticed the CXX compiler flag had -fno-exceptions, I removed this. However, when I try something as simple as try { throw std::exception(); } catch (const std::exception &e) { log_blocking("Caught exception:"); } I see that the program throws the exception and then falls into std::terminate(). What am I missing here? Are there any other special things I need to do in order to enable exception handling?
I am using an STM32F405RGT6 and USB3300 to implement a USB Host for a keyboard. When I set hid_min_poll to 1, the keyboard is recognized but key presses are not detected. However, when I set hid_min_poll to 2 or higher, the keyboard works fine, and key presses are detected. What could be the reason for this?
Using: Windows, cubeMX 6.13, STM32H7S7, UM1718 rev 46I get the following error when I load a project that successfully generated code:"""Cannot invoke "java.util.Map.get(Object)" because "this.resrvedMemRegionMap" is null."""I did follow the UM1718 chapter 5.5.6, but found no relevant information about valid configuration vs invalid configurations.I am using FMC and XPI to get access to external memory.If I memory map those into the memory manager, I get an error, same if I remove it.Is there any suggestion on how to correct the IOC file?
Steps to reproduce: Start a new STM32 Project in STM32CubeIDE v1.17.0Select NUCLEO-F746ZG board, and initailize all peripherals.Now in the IOC editor, under Middleware select LwIP and enable it.Set the PHY to LAN8742 in the "Platform Settings" tab.On the Key Options tab set NO_SYS to OS Not Used.In General Settings tab, disable DHCP, disable the TCP module and enable UDP.Go back to Key Options tab and note that the "LWIP_RAM_HEAP_POINTER" is set to 0x30004000Save, Build an run the project in debug mode. The code will hard-fault during MX_LWiP_Init() because the RAM HEAP POINTER is wrong. Now open the file at LWIP/Target/lwipopts.hNote that at approximately line 58/59 there is: /*----- Default Value for F7/H7 devices: 0x30044000 -----*/ #define LWIP_RAM_HEAP_POINTER 0x30004000 FIrst of all the comment doesn't match the value given, and even if you change the value given to the same as the comment (this is an F7 device after all) th
Hi I am currently working on a project where I need to use internal Voltage reference as reference for ADCs inside STM32G4 Nucleo board (STM32G431KB). I can write to bits of VREFBUF registes (Confirmed by Debug Session). After enabling the VREF I wait for VRR bit of CSR register to set. However, it never does thus my code stucks in while loop. You can see the code below.#include "main.h" #include "SysClock_Config.h" void DummyDelay(int x) { int temp = x; while(temp) { temp--; } } void Initialization(void) { RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN | RCC_AHB2ENR_ADC12EN; //Enable GPIOA and ADC Clock GPIOA->MODER |= GPIO_MODER_MODER0; //Set PA0 as Analog VREFBUF->CSR |= (0b01<<VREFBUF_CSR_VRS_Pos); //Set Internal Reference as 2.5V VREFBUF->CSR &= ~(VREFBUF_CSR_HIZ); //Disable High-Impedance VREFBUF->CSR |= VREFBUF_CSR_ENVR; //Enable Voltage reference while(!(VREFBUF->CSR & VREFBUF_CSR_VRR)); //Wait until Ref
Hello After some work with STM32CubeMX CMake generation and discussions with good CMake user, I really think that, when generating a projet with STM32CubeMX, it should not be an INTERFACE library (or at least not only that)As a CMake user said to me, the purpose of INTERFACE library is the following:When a target represents some collection of requirements that doesn’t involve an actual library file. For example, a collection of flags or includes.The main problems I have when using the current CMake generation:I'm linking several libs to the project. They have to be linked to the stm32cubemx lib to have µC and #define defined. Every lib compilation involve a stm32cubemx lib compilation.I want to change some compilation flag in my lib. For example, level up somes warnings to errors such as implicit conversion or unused parameters. As the stm32cubemx is an interface, when it is compiled, it "takes" the compilation flag of the linking lib. As a result, errors compilation rise because
I have NUCLEO-F767ZI 216Mhz and a SD card breakout board. I am using cube mx 5.2.0 and FW_F7_V1.15.0 for code generation. I want to read/write in a file on a sd card. I have enabled SDMMC1 (SD 4 bit wide bus) in cube mx and also enabled FATFS middleware for sd card. SDIO CLK divide factor 3MAX_SS 4096and all other parameters are defaultI have connected SDIO pin correctly (double checked) . When I use 1 bit SDIO bus it works perfectly for same code.Code: FATFS SDFatFS ;FIL SDFile ;res =f_mount ( &SDFatFS , SDPath,1);char myFileName[]= "abc.txt"; // create new fileif (res == FR_OK){res=f_open ( &SDFile , myFileName, FA_WRITE | FA_CREATE_ALWAYS); // open in write mode}char myData[] = "xyx,ghj,acceleration,target position\n 1000,231.25,10,500.5";if (res == FR_OK){res=f_write ( &SDFile, myData , sizeof(myData), &myBytes);}f_close(&SDFile);
Hey, I'm working on a project to connect my UHF RFID reader with ProfiNet via the NSHIELD 52-RE extension board. I chose the NUCLEO-F767ZI board for the development because it has an Ethernet interface, which I'm using for the web interface. The content for the web interface is stored on an SD Card connected to the SDMMC1 port of the F7 board. The issue I found is rooted in how the STM32CubeMX generates the code for the project, particularly for the SD card driver. The generated code contains a HAL_SD_Init with an SDMMC_BUS_WIDE_4B setting in the SD_HandleTypeDef.Init structure, which is OK so far. In the next step, the code calls the HAL_SD_ConfigWideBusOperation, which is when the issue appears. The SD_WideBus_Enable routine, which the HAL_SD_ConfigWideBusOperation calls, is reading the SCR register of the SD-Card, and this will fail because the card is initialized in 4-bit bus mode. I have this little workaround, which is somewhat annoying, but it
SPI with NSSNSS Signal Type Output Software is missing in the pulldown.What did I wrong?I attached the ios file.Of course I can edit the source and never let STM32CubeMX touch the project again, but that wasn't the goal, right? hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT;hspi1.Init.NSS = SPI_NSS_SOFT;
Hello, I would like to have advice, I see this video about SD Card :https://www.youtube.com/watch?v=I9KDN1o6924&t=359sAnd in the video (5:30) I can see DMA tab via CubeMXBut with me I don't have this tab, do you know why ?I have STM32L552E-EV Evaluation Board with STM32L552ZET6QU microcontroller, after me It's possible to have the DMA with SD Card.I have this Version: 1.13.1 for STM32CubeIDEThank you for your helps.Regards
I am trying to setup offline functionality of STM32CubeMX. I currently have version 6.4 installed and am trying to install MCU packages, specifically one for STM32L4 so I can configure code for the NUCLEO-L433RC-P. I have tried downloading the software from github at https://github.com/STMicroelectronics/STM32CubeL4/releases/tag/v1.17.0 and using that zip file "STM32CubeL4-1.17.0.zip" as the local source to attempt an install in CubeMX under Help -> Manage embedded software packages -> STM32Cube MCU Package for STM32L4 Series 1.17.0. It checks the file type, searches "pdsc within CMSIS Pack" and then gives me an error saying "This file is either corrupted or not a recognized package."One thing I notice is that the file size is different. The downloaded zip file is 495 MB while the file size indicated in Cube MX is 723 MB. This makes me think I need to get the STM32Cube MCU package from some other source. Could someone point me to the location where I can download the necessary fi
I add CMSIS DSP over MX ioc in CubeIDE 1.7:0, but now in latest ARM software dont exist. Why?
Hi everyone,I'm encountering an issue with the STM32 Device Configuration Tool: it doesn't properly generate the global interrupt handler function for one of the UARTs in my project: The generated interrupt handlers for USART1 and USART2 include call of the default HAL interrupt handler (HAL_UART_IRQHandler(&huartX);) but the handler for USART6 is missing this line. /** * @brief This function handles USART1 global interrupt. */ void USART1_IRQHandler(void) { /* USER CODE BEGIN USART1_IRQn 0 */ /* USER CODE END USART1_IRQn 0 */ HAL_UART_IRQHandler(&huart1); /* USER CODE BEGIN USART1_IRQn 1 */ /* USER CODE END USART1_IRQn 1 */ } /** * @brief This function handles USART2 global interrupt. */ void USART2_IRQHandler(void) { /* USER CODE BEGIN USART2_IRQn 0 */ /* USER CODE END USART2_IRQn 0 */ HAL_UART_IRQHandler(&huart2); /* USER CODE BEGIN USART2_IRQn 1 */ /* USER CODE END USART2_IRQn 1 */ } /** * @brief This function handles USART6 global in
Hello, I have downloaded en.x-cube-eeprom_v4.0.0.zip but I do not know how to install it on STM32Cube. It should have been a package installed "from local" and selected the zip in STM32Cube MX? Or what I need to do is copy all the files for my project of for a specific directory in STM32 cube installation? Is there any tutorial describing all the steps to install it?Thanks,
I'm missing the FATFS supporting library files after adding SDIO SD card support and FATFS support in the CubeMX code generation tool within STM32CubeIDE. The funny thing is that those files are present in the project folder, just not in my project's folder structure in STM32CubeIDE.What I am doing wrong here? I was under the impression that the CubeMX tool was supposed to add/link these files to the project automatically.
I have tried to install the latest CubeMX software 6.13 in silent mode. Unfortunately the installation fails with the following error code in debug mode: 'ProcessBuilder.start(): pid: 95163, dir: null, cmd: “net”'I have executed the installation with the following command: 'java -jar SetupSTM32CubeMX-6.13.0 -debug'The installation runs with version 6.12.1.I used debian bullseyeAm I doing something wrong?Kind regards
Hello,I am working on a custom board with stm32h7r3z8t6. After the definition of the USB HS in Cube MX, the USB initialization is stuck on USB_TIMEOUT: USB HS connection on the board: Here is the clock config: void SystemClock_Config(void){RCC_OscInitTypeDef RCC_OscInitStruct = {0};RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};/** Configure the main internal regulator output voltage*/if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE0) != HAL_OK){Error_Handler();}/** Initializes the RCC Oscillators according to the specified parameters* in the RCC_OscInitTypeDef structure.*/RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;RCC_OscInitStruct.HSEState = RCC_HSE_ON;RCC_OscInitStruct.HSIState = RCC_HSI_ON;RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1;RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;RCC_OscInitStruct.PLL1.PLLState = RCC_PLL_ON;RCC_OscInitStruct.PLL1.PLLSource = RCC_PLLSOURCE_HSE;RCC_OscInitStruc
I've been struggling for a while now to start the SPI1 protocol on the Nucleo-401RE. According to the datasheet, SPI1 is connected as follows, I generated the code in CubeMX and without adding a single line of code, compiled it without any failures and uploaded it on the board. What i expected is at-least the SCK pin to generate some clock pulse when connected to a Logic analyzer or an oscilloscope. Instead i get no response. As in a straight line on both indicating 0 volts. my generated code looks as follows. main.h#ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif #include "stm32f4xx_hal.h" void Error_Handler(void); #ifdef __cplusplus } #endif #endif main.c#include "main.h" SPI_HandleTypeDef hspi1; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_SPI1_Init(void); int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_SPI1_Init(); wh
Hi everyone!I've migrated my STM32H753 project to the new CubeMX version, and after that, something went wrong with the CAN bus communication (everything worked fine before the update). The CAN functions return no errors, and messages are being sent, but they are incorrect — I'm getting a Stuff Error on the receiver side (A Stuff Error occurs when 6 consecutive bits of the same value are detected on the bus).I wonder if anyone else has encountered this issue and found a solution.
I am using the STM32H745i_DISCO board. I can't seem to get TIM8 to output on PK0. I sure the GPIO is be setup correctly, but there must be something in one of the TIM8 registers. I am attempting to use TIM8 to adjust the brightness on the LCD screen, but again can't seem make the timer output anything. I can see activity within the Timer8 upon debug. The counter register is working.static void MX_TIM8_Init(void){ /* USER CODE BEGIN TIM8_Init 0 */ /* USER CODE END TIM8_Init 0 */ TIM_ClockConfigTypeDef sClockSourceConfig = {0};TIM_MasterConfigTypeDef sMasterConfig = {0};TIM_OC_InitTypeDef sConfigOC = {0};TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; /* USER CODE BEGIN TIM8_Init 1 */ /* USER CODE END TIM8_Init 1 */htim8.Instance = TIM8;htim8.Init.Prescaler = 1199;htim8.Init.CounterMode = TIM_COUNTERMODE_UP;htim8.Init.Period = 65535;htim8.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;htim8.Init.RepetitionCounter = 0;htim8.Init.AutoReloadPreload = TIM_AUT
Hi,I am working on USB Device Middleware on STM32F469NI using STM32CubeMX. For our use case we have to modify the PRODUCT_STRING descriptor value (default is "STM32 Virtual ComPort"). Is it recommended to perform this, or are there any STM standards for these values? Thanks,Himanshu
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.