Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,Code is generated using CubeMX, the attached screenshots may demonstrate the issue:CubeMX v 6.3.0CubeIDE v 1.8.0TouchGFX 4.18.0_M7Why 2 projrcts are created, one for CM4 and another for CM7?Thank you in advance for your help
I would like the Trigger Event of TIM2 to be generated when the Encoder count reach a specific position. #include "main.h" TIM_HandleTypeDef htim1; TIM_HandleTypeDef htim2; UART_HandleTypeDef huart3; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART3_UART_Init(void); static void MX_TIM2_Init(void); static void MX_TIM1_Init(void); uint32_t counter = 0; void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) { counter = __HAL_TIM_GET_COUNTER(htim); } int main(void) { /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USART3_UART_Init(); MX_TIM2_Init(); MX_TIM1_Init(); /* USER CODE BEGIN 2 */ uint8_t data[50] ={'\0'}; HAL_TIM_OnePulse_Start(&htim1,TIM_CHANNEL_1); HAL_TIM_Encoder_Start_IT(&htim2, TIM_CHANNEL_ALL);
..
hey there,I have a STM32G030C8t6 which I wish to configure. in CubeMX when I focus on PA11 or PA12, I can see a bracket where this is mentioned:PA11[PA9]PA12[PA10]what does it mean? does it mean they are somehow connected or related? can anyone explain it?thanks in advance
On an application board I'm developing using an STM32H750VB, I ran into problems with being unable to wake the device from STANDBY mode using WKUP2 on PC13. Measuring current consumption confirmed STANDBY was being entered, however the expected pull-up was not present, and the device did not wake.I decided to check the functionality using an evaluation board, an NUCLEO-H743ZI was the closest match I had to hand.I ran the provided sample STM32Cube_FW_H7_V1.5.0\Projects\NUCLEO-H743ZI\Examples\PWR\PWR_STANDBY, and observed the expected behaviour of the user button waking the device from sleep. However, on closer inspection I could see that the code references PWR_WAKEUP_PIN4, wheras the actual IO connected to the user button (PC13) is listed as WKUP2 in both the part datasheet & STM32CubeMX.From my quick investigations I looked at the two IO's of interest to me & found they both are incorrectly labelled. This probably applies to all WAKEUP sources, but these are the only two I hav
hi i have a custom pcb with lan8720 chip on it and i can't access or ping it also cubeMX doesnt support lan8720 it only support 8742 please help i'm using cubeIDE and cubeMX
My fellow student says TIM12 has 2 channels and PH9 is configured for TIM12 channel 2 as per the below datasheet.https://www.st.com/resource/en/datasheet/stm32h743vi.pdfNow I argue that the tim12 channel 2 is configured to PB15.And he stupidly configured this way.""" GPIO_InitStruct.gpio_port = GPIOH; GPIO_InitStruct.configure.Pin = GPIO_PIN_9; GPIO_InitStruct.configure.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.configure.Pull = GPIO_NOPULL; GPIO_InitStruct.configure.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.configure.Alternate = GPIO_AF2_TIM12;"""Who is right and who is wrong? is PH9 (my friends) or PB15 correct?
I have no console output for UART;I am using STM32F429ZI dev-kit CubeMX and STM32CubeIDEThe codes compiles and I can see the light blinking but when I connect to Serial terminal with PuttY, I observe no console output.What am I missing ?/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes
I am trying to setup SPI communication via DMA on the STM32L4S9AII6 MCU. It seems to be half working as you see in the image "SPI Bug". In this test I am sending a string of 6 bytes. As you can see, only the first half make it out of the MCU alive, but the MCU is obviously trying to send the full 6 bytes. This is over the SPI3 peripheral. Also note the PB12 signal at the bottom of the "SPI Bug" image attached. This is a GPO pin that I assert high when the "HAL_SPI_TxHalfCpltCallback" callback function is called. Likewise, I de-assert the same pin low when the "HAL_SPI_TxCpltCallback" callback function is called. Not sure why the half-transfer complete callback function is getting called at the beginning of the transfer. Maybe that is a hint as to what is wrong here.I am also successfully using UART1 + DMA where I am consistently able to send messages with many bytes.Yes, I have "MX_DMA_Init();" before all other peripherals that use DMA. By the way, when does ST plan to fix this bug, it
In the Linux version, the general Parameters Configuration window has settings for:Ethernet MAC AddressTx Descriptor LengthFirst Tx Descriptor AddressRx Descriptor LengthFirst Rx Descriptor AddressRx Buffers LengthIn the Windows version, the general Parameters Configuration window has the same setting with one addition for:RX Buffers AddressWhy is that?
Hello.I have a problem with USB working properly - USB CDC (Virtual Com Port) with CubeMX HAL after disconnecting the USB cable and connecting again.For the test I created a project similar to the one presented here - https://www.youtube.com/watch?v=AYICE0gU-Sg using STM32CubeIDE and STM32CubeMX.The program writes data in the while (1) loop to the USB port after uploading to STM32.while(1) { CDC_Transmit_FS(buffer, sizeof(buffer)); HAL_Delay(1000); }The data is written out, visible in Windows 7 (Tera Term).When I disconnect the USB cable (OTG FS port) and reconnect, Windows sends the message "USB device not recognized".Data is not received.In order for the data to be transferred and the cable to be recognized, I must do a Reset on the board.Hardware:MCU: STM32H743VITSoftware: STM32CubeIDE v1.2Firmware package: STM32Cube_FW_H7_V1.7.0How to make the USB device work all the time correctly (after disconnecting the cable and reconnecting it), so that it is recognized by Windows and data i
I'm using STM32H755ZIT6 MCU. And I want to choose SRAM in the FMC memory type option. However, it doesn't show up in the drop-down menu. What am I missing here?
I have two ADC channels that l am trying to configure to have their own ADC watchdog. Experimenting with the threshold values l can get the first watchdog to fire on each channel and it calls HAL_ADC_LevelOutOfWindowCallback() as needed. The second ADC watchdog does not fire at all. I didn't see it be initialized so l created some code that doesn't work. Can someone give insight on this? I eventually plan to use all three ADC watchdogs at once. configuration:static void MX_ADC3_Init(void) { /* USER CODE BEGIN ADC3_Init 0 */ /* USER CODE END ADC3_Init 0 */ ADC_AnalogWDGConfTypeDef AnalogWDGConfig = {0}; ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC3_Init 1 */ /* USER CODE END ADC3_Init 1 */ /** Common config */ hadc3.Instance = ADC3; hadc3.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4; hadc3.Init.Resolution = ADC_RESOLUTION_16B; hadc3.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc3.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc3.Ini
When adding a new DMA request to the ADC1 periphereal the only stream options available are DMA2 stream 0 and DMA2 stream 4. As I don't have any other DMA request enable I would expect to be able to select any stream from any DMA periphereal. Why is that I have this restriction?
Hello ST community, I recently bought a PLC01A1 expansion PLC board for my NUCLEO-F401RE and I am having trouble compiling the example code provided on the PLC01A1 website. After carefully integrating the code in STM32CubeIDE, I was prompted with the following error message "TIM6_DAC_IRQn' undeclared (first use in this function); did you mean 'TIM1_CC_IRQn". I checked the CubeMX (.ioc) file and TIM6 doesn't exist there. How can I run the example, and properly declare TIM6?I very much appreciate the community help in advance, looking forward to hear a response from you.
I to all,I have a project where an STM32F013RTC use an SD card.At run time the SD is share with FAT_FS or it is used as USB mass storage device, but not at the same time.I need to disable USB module.The configuration is made from CubeMX, so I have the function MX_USB_DEVICE_Init() to enable and configure USB.void MX_USB_DEVICE_Init(void) { /* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */ /* USER CODE END USB_DEVICE_Init_PreTreatment */ /* Init Device Library, add supported class and start the library. */ if (USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS) != USBD_OK) { Error_Handler(); } if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_MSC) != USBD_OK) { Error_Handler(); } if (USBD_MSC_RegisterStorage(&hUsbDeviceFS, &USBD_Storage_Interface_fops_FS) != USBD_OK) { Error_Handler(); } if (USBD_Start(&hUsbDeviceFS) != USBD_OK) { Error_Handler(); } /* USER CODE BEGIN USB_DEVICE_Init_PostTreatment */ /* USER CODE END USB_
Sorry it is not really a question.I am using STM32CubeMXIDE Version: 1.8.0Build: 11526_20211125_0815 (UTC)with the integrated CubeMX for managing .ioc filesI wanted to make in incremental change without disturbing the present code base.I used the project copy and paste, and used the automatically supplied new project name with a 2 added. I then renamed the .ioc file in the newly created project to follow the project renaming. I verified the code built and executed the same as the original.I then used the CubeMX to remove a feature in the Software Component Selection and regenerated the code. At that point the regeneration had removed almost all the Middlewares include paths which I had to manually add back in.I think this is a bug and if not it is certainly an undesirable feature.there is more detail in another link:https://community.st.com/s/question/0D53W00001MyjErSAJ/how-to-use-the-stm32h723nucleo-project-nxtcpechoserver-without-using-the-dhcp
Hi,I'm currently setting up ADC1/2 of STM32H725IGx, using STM32CubeMX 6.3.0 with FW_H7_V1.9.0. They are configured to run at async ADC clock, which is about 126 MHz defined in CubeMX Clock Configuration, divided by 4 => 31,5 MHz.However, sampling and conversion takes twice as long as expected!When stepping through HAL initialization, I found that it (in ADC_ConfigureBoostMode()) computes the actual ADC frequency for determining the BOOST bits setting. It starts with 31,5 Mhz but then concludes as follows:...#if defined(ADC_VER_V5_3) || defined(ADC_VER_V5_V90) freq /= 2U;...with freq==15.75 MHz?!?This would explain my observations. But what to do? CubeMX seems to calculate and check with wrong factors. It won't allow me to double the input frequency, telling me that fADC would be exceeded (but 31,5 MHz is below 50 MHz!)Thanks for your comments,Kolja
I am using below development toolsMCU: STM32H7B3IIT6IDE: STM32CubeIDE Version: 1.8.0GUI: TouchGFX Version: 4.18.1I am using IS45S16800F-7CTLA1-TR SDRAM. I added CubeIDE interface. External SDRAM size 128Mb==16MB but Built analyzer shows 1024KB. Why does it not true?
Hi ThereIn our project we would like to change the MCU Type from MCU Type NIHx to BGTx. As far as I can see there should not be any conflicts with exception of the Flash size. As we do not need more than the 1MB this is not a problem for us.Is it correct, that the exact same processor type is build in with different casing? Do I forget something or is it correct that I can leave all pins and cofiguration the same?Whats the easiest way to change the mcu type in CubeMXKind Regards
I could not figure out how I can connect a sine wave signal to the positive input of COMP1 or COMP2 comparators in STM32H747I-DISCO board. According to the STM32CubeMX the comparators positive inputs are on PB0 (COM1_INP) and PB9 (COM2_INP) GPIO, but I could not find PB0 and PB9 on any connector of the discovery board. Is there any trick how to use the internal comparators, or they are not accessible in this discovery board, which is pity.Thanks for any help!Louis
I'm putting the FreeRTOS heap in extended memory in an F469I-Disco board.Got the memory working properly (needs to be there for the LTDC display to work).FreeRTOS needs the configAPPLICATION_ALLOCATED_HEAP option to be set to 1. CubeMXIDE setup options (in version 1.8.0) do not give that option anywhere and default to a 0 for this parameter. Setting the variable in FreeRTOS.h works, but lasts until a change is made and code regenerated from the IOC file.In addition, the heap4c file needs to be modified to allow FreeRTOS (@line 58) to search a named block of extended memory.This gets wiped out when regenerating code as well.An easy fix would be to have the last section (static heap) be conditional only on the variable == 0.Then the user could add their own code in a user section with a preprocessor directive.An alternative to that would be to add a user code section with the existing structure when user heap is needed.Code needed to be added (apologies for lack of formatting, not availa
While setting up a project using cubeMx for a stm32G0, I stumbled across a possible error on the USB_device files. This error resulted in the usb reset handler stalling the machine. My project specifies the USB as full speed and looking in the generated usbd_conf.c, I found the following lines in HAL_PCD_ResetCallbackUSBD_SpeedTypeDef speed = USBD_SPEED_FULL; if (( hpcd->Init.speed != USB_DRD_SPEED_FS) || (hpcd->Init.speed != USB_DRD_SPEED_LS)) { Error_Handler(); } /* Set Speed. */ USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); /* Reset Device. */ USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData);In that case the line 2 test will always result in the Error_handler being called as we are indeed FS (and thus not LS). Using thins condition instead solved the usb issue :if( hpcd->Init.speed != USB_DRD_SPEED_FS){ Error_Handler(); }Could this be an oversight in the cubeMX generation or is it that I missed something blatantly obvious ?
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.