Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Why/why not would I use one IDE over the other ?
Hello everyone! I want to use a TCP/IP stack with my Nucleo STM32F207ZG over FreeRTOS, so I went ahead and created an stm32 project with STM32CubeIDE and initialized the project with cubeMX. (see linked file).So far so good! My problem begins when I try to read incoming packets, I use the function lwip_read() (alose tried read()) to read from the input buffer sequentially. It works a couple of times then the thread crashes. see code snipet below :CodeSo I have a single thread, that I pasted below. In it I use an MQTT library. All the function I use from this library only write to CHAR buffers and do not interact with the TCP/IP Stack.The code here is simple and it's purpose is to demonstrate read and write capabilities to the network. The code crashes at line 70. I don't know why. (I know that it's weird to have a couple of read like that, but it is only to better show the symptoms of the problem).void StartDefaultTask(void *argument) { /* init code for LWIP */ MX_LWIP_Init(); /* US
The packs we can download contain entire STM32Fx series with include files for everything.When we select a specific MCU in CubeMX we should be able to use this to export a "clean" set of HAL and CMSIS files as well as potential low level boot/init files without generating the init code etc with placeholders for usercode. Many users just need the updated libraries as the flexibility of the init with CubeMX is very limited and static.
After creating a new project STM32CubeMX it automatically generates code. If I want to change any setting using STM32CubeMX how can it be restarted from within STM32CubeIDE ?I ran STM32CubeMX by double-clicking the .ioc file, but STM32CubeMX does not show the configuration tabs. What is the proper way to rerun and reconfigure STM32CubeMX ?
Hello! I was looking at the datasheet for the STM32L4R5ZI chip and it shows the limitation of the SPI (for the 2.7V to 3.6V range). I set this in the *.ioc file and tried to select a prescaler of 2 on a 120 MHz block to get a frequency of 60 MHz. Unfortunately, it seems to be limiting me to 40 MHz and I'm not entirely sure why that is. I'm not sure if this is a software limitation/bug or if I'm missing something obvious. Any idea why it might be limiting me to 40 MHz rather than 60?Any help you can give me would be appreciated. Thanks!
Hi guys!I'm trying to do a simple blinking led using interrupts but they never get fired.I'm using 84 MHz clock frequency and the following options: /* 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 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 * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" &nbs
Hello sir, CPU : stm32f407VGTI just set ETH and LWiP and generate file using stm32cubemx. The file is generate succefully. But the file has error with IAR version7. =========================================================file name : mpu_armv7.h __STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len){uint32_t i;for(i=0U;i<len;++i){dst[i] = src[i];}}error : expected a ")"error : identifier "len" is undefinederror : identifier "src" is undefined error : too many arguments in function call error : too many arguments in functin call Why is this error make and how to fix it?
I am trying to use USB port on a Nucleo-F303ZE board as CDC. I am using the latest CubeMX IDE. To get the PC to recognize USB device, I had to modify the HAL_PCDEx_SetConnectionState function as follows to get PC to recognize the USB device:void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state){ /* USER CODE BEGIN 6 */ HAL_GPIO_WritePin(USB_PowerSwitchOn_GPIO_Port,USB_PowerSwitchOn_Pin,state); /* USER CODE END 6 */}However, the USB CDC_DeInit_FS is not getting called when the USB cable is disconnected. It is getting called when the cable is re-inserted. Re-inserting the USB cable triggers the USB_LP_CAN_RX0_IRQ which eventually calls the CDC DeInit.void USB_LP_CAN_RX0_IRQHandler(void){ /* USER CODE BEGIN USB_LP_CAN_RX0_IRQn 0 */ /* USER CODE END USB_LP_CAN_RX0_IRQn 0 */ HAL_PCD_IRQHandler(&hpcd_USB_FS); /* USER CODE BEGIN USB_LP_CAN_RX0_IRQn 1 */ /* USER CODE END USB_LP_CAN_RX0_IRQn 1 */}After re-inserting
..
Hi,I tried to I2C Loopback test on STM32F401.I added two I2C Ports and checked NVIC Setting.Following some of tutorials, below function is craete automatically.but when i generated codes, this function was not crated.this function is wrote by user?
I'm trying to generate the code on the STM32F407G-DISC1 evaluation board for the TrueStudio project environment.The code generation just freezes.Has anyone else seen this?I'm running on Windows 7 Pro, 64 bitI've tried different combinations of projects and processors but the result is the same.
I am using a Nucleo F091RC.When I create a new project, the .../Inc/usart.h .../Src/usart.c .../Inc/gpio.h.../Src/gpio.c files are missing.The button on the board is declared as GPIO_InputThe LED on the board is declared as GPIO_OutputPA2 is declared as USART2_TX PA3 is declared as USART2_TXWhen will the files appear in the folders?
For a simple LED Blink program using interrupts, TIM2 is counting correctly, but its IRQs are not happening. As expected, there are about 1440 TIM2 "count-outs" per 1.0 seconds.Over the past few years several CubeMX timer IRQ bugs have surfaced, but I'd expect they would have been fixed by now. Are there any left to be resolved ?Most probably I have missed some MX configuration, but I have no idea where that would be. Any ideas and pertinent experience will be appreciated.Here are the two MX TIM2 configuration screen shots:(I hope you see the full-size images and not the tumbnails I see.) This message editor's file-attachment button is grayed-out!) Here's the entire program code:/* 2020-12-30 10:50:07 PM main.c C:\Users\HTPC\STM32CubeIDE\workspace_1.5.0\BluePill_Timer_NonBlocking\Core\Src "STM32 Timers and Timer Interrupts" https://www.digikey.be/en/maker/projects/getting-started-with-stm32-timers-and-timer-interrupts/d08e6493cefa486fb1e79c43c0b08cc6 Example 3: Interrupt-drive
Hi, so I'm new to ARM and got a STM32H755 Nucleo board. Using the STM32cubeIDE to auto generate code, I spent hours trying to follow tutorials and get the blink code working until someone mentioned to me that the auto generated MX_GPIO_Init code is a lot shorter than other boards code. The STM32745 is also like this but checking out the 723 and l4 series from youtube videos, they all contain extra instantiation code mine doesn't. This seems like a bug to me and looks like what's causing me not to get a blinking LED with the usual HAL calls, unless there's some other main.c file I'm missing since it's a dual core MCU.This is the only code generated for my MX_GPIO_Init():static void MX_GPIO_Init(void){ /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();}Thanks for your help.
Hii,While configuring STM32F446RE on CubeMX version 5.0.1 for using the board for reading and writing data on an SD card using SDIO mode (1 bit mode), after enabling this mode and then enabling SD Card option in the FATFS Middleware, it asks me to resolve clock issues and I run the auto-clock resolver, the clock issue gets resolved but when I click on generate code, I get this error message "These IPs still have some not configured or wrong parameter values : [FATFS]". When I try to check what is wrong with the IPs, there is just one option available and I cannot find a way to resolve this error. I click on generate the code anyway. Kindly helpWith regardsSiddharth Soni
I use stm32cubemx 5.5, and there is a problem bothering me.when i enable FATFS in stmcubemx, i got an warning: verify the platform settings tabI know i should add a sd detect pin this warning, but actually, the board don't have the detect pin.although i can ignore this warning, i would like to cancel this warning.So How to cancel FATFS verify the platform settings tab
Newbie here and quite fortunate and unfortunate to use STM32H747-DISCO.For a newbie like me, it is quite overwhelming.I mostly rely on CubeMX to generate code and combine with firmware examples.For STM32H747-DISCO, the generated code is emptly.In CM4 src:{ /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOI_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE(); __HAL_RCC_GPIOK_CLK_ENABLE(); __HAL_RCC_GPIOJ_CLK_ENABLE(); }and in CM7 src:static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); /*Configure GPIO pin : CEC_CK_MCO1_Pin */ GPIO_InitStruct.Pin = CEC_CK_MCO1_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO
What is new in STM32CubeMX V6.1.0? VideosA new thread has been created to gather your requests for Video Tutorials.If you need to add A Video tutorial or have and idea about a tutorial, don't hesitate to visit the thread below and add your request in a comment.https://community.st.com/s/question/0D53W00000NBXi5SAH/tutorial-videos-in-stm32cubemx-your-ideas-are-welcomedAdded support• Added the support for new part numbers in the STM32G0 Series: STM32G0B0CETx, STM32G0B0KETx, STM32G0B0RETx, STM32G0B0VETx, STM32G0B1C(C-E)Tx, STM32G0B1C(C-E)Ux, STM32G0B1K(C-E)Tx, STM32G0B1K(C-E)TxN, STM32G0B1K(C-E)Ux, STM32G0B1K(C-E)UxN, STM32G0B1M(C-E)Tx, STM32G0B1R(C-E)Ix, STM32G0B1R(C-E)Tx, STM32G0B1V(C-E)Ix, STM32G0B1V(C-E)Tx, STM32G0C1C(C-E)Tx, STM32G0C1C(C-E)Ux, STM32G0C1K(C-E)Tx, STM32G0C1K(C-E)TxN, STM32G0C1K(C-E)Ux, STM32G0C1K(C-E)UxN, STM32G0C1M(C-E)Tx, STM32G0C1R(C-E)Ix, STM32G0C1R(C-E)Tx, STM32G0C1V(C-E)Ix, STM32G0C1V(C-E)Tx • Added the support for two new STM32G0 boards: NUCLEO-G0B1RE and STM32G
Hello everyone, During the last few days I have been trying to set the USB Peripheral from STM32L151CC microcontroller as a Virtual COM Port from STM32CubeIDE. Unfortunately no matter what I've tried the USB is not recognized. (Tested both in Linux and Windows 10). In the attachments you can find the settings I've used in STCubeMX for the particular device. Edit: I use the Multitech xDot and that's why I've configured an HSE clock source.Any help would be much appreciated.Best regards,Nick
Hello, I recently migrated from old 5.4.0 CubeMX to the STM32CubeMX version 6.0.1. I did not have this binding issue with Firmware Package STM32Cube FW_F7 V1.15.0 in CubeIDE. Now that I am using STM32Cube FW_F7 V1.16.0 the error occurs in the below block of code on the line: if (bind(socket_fd, (struct sockaddr *)&sa, sizeof(struct sockaddr_in)) == -1):void UdpStreamTask() { int socket_fd; struct sockaddr_in sa, ra; int sent_data; struct udp_pcb *rxPcbPtr; app_assert(0 != m_streamPtr); // RX setup - create a new UDP control block rxPcbPtr = udp_new(); app_assert(NULL != rxPcbPtr); // set a receive callback for the rxPcbPtr udp_recv(rxPcbPtr, udpRxCallback, this); // set the remote port rxPcbPtr->remote_port = m_remoteUdpPort; // bind using the rxPcbPtr to the local port port if (udp_bind(rxPcbPtr, IP4_ADDR_ANY, m_localUdpPort) != ERR_OK) { app_assert(false); } // TX setup - creat
Hello everybody,i have a motor control application and try to trigger a ADC in injected conversion mode with the Output Compare (OC4REF) trigger of TIM1. With my configuration the ADC convert only once and then never reach the HAL_ADCEx_InjectedConvCpltCallback again.Here is my Init configuration:/** * @brief ADC2 Initialization Function * @param None * @retval None */ static void MX_ADC2_Init(void) { /* USER CODE BEGIN ADC2_Init 0 */ /* USER CODE END ADC2_Init 0 */ ADC_InjectionConfTypeDef sConfigInjected = {0}; /* USER CODE BEGIN ADC2_Init 1 */ /* USER CODE END ADC2_Init 1 */ /** Common config */ hadc2.Instance = ADC2; hadc2.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV1; hadc2.Init.Resolution = ADC_RESOLUTION_12B; hadc2.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc2.Init.ContinuousConvMode = DISABLE; hadc2.Init.DiscontinuousConvMode = DISABLE; hadc2.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc2.Init.NbrOfConversion = 1; hadc2.Init.D
I changed one (1) pin in CubeMX and then it updated to ver 6.1.1 while generating code. Now CubeIDE does not work. I cannot clear the many errors (see attached screen print) and the debugger is locked out generating even more errors. How do I fix this?
STM32CubeMX requires a Java™ Runtime Environment (JRE) to execute and In April 2019, Oracle decided to change their economic model around Java. Since this date the Oracle JVM beyond version 1.8u211 becomes non-free for professional usage STMicroelectronics promotes the use of the following JREs: • Oracle®(a) JRE, subject to license fee. • Amazon Corretto™(b) (c) JRE, no-cost solution based on OpenJDK, JDK installer recommended. The JRE version constraints are: • 64-bit version mandatory; 32-bit version not supported • The STM32PackCreator companion tool requires JRE supporting JavaFX™ • Minimum JRE version is 1.8_45 (known limitation with 1.8_251) • Version 11 is supported • Versions 7, 9, 10, 12 and upper are not supported STM32CubeMX operation is not guaranteed with other JREs.What's Next?Development team is working on bundling the JRE with CubeMX installer", there will be no more need to install a JRE to use STM32CubeMX
Hello, I'm using the STM32G031J6M6 8-pin Cortex-M0+ chip.I'm trying to use the ADC channel 16 however, I cannot select the channel.I confirmed which channel can select that I can select channel 0 to 11.Channel 11, 15 to 18 cannot select in the latest version of the Cube MX.If I use channel 11, 15 to 18, do I need something operation?Do you have any solutions? Thank you for watching.
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.