Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi everyone,I am working on the STM32MP257DAI3 and using the SAI peripheral on the M33 core with an ADAU1772 audio codec.On the STM32MP157, the DMA configuration provides a Circular DMA option, which is useful for continuous audio streaming. However, on the STM32MP257DAI3, I cannot find an equivalent Circular DMA option in STM32CubeMX or the generated configuration.I would like to implement continuous audio transmit/receive for the SAI interface, similar to the circular DMA operation available on STM32MP157.Could anyone clarify the following?Is the traditional Circular DMA mode no longer available on STM32MP257? Does STM32MP257 use GPDMA Linked-List mode instead of the legacy circular DMA? If so, what is the recommended configuration for continuous SAI audio streaming on the M33 core? Are there any additional configurations required (such as queue, node, circular linked-list, cache settings, etc.) to achieve uninterrupted audio transfer with the ADAU1772 codec?If anyone has a working e
We used to define STM32 pinout in STM32CubeMx since it's aware of all the possiblilities of the MCU.Then we manually need to transfer the pnout into Altium Designer Schematic. And to keep those in sync when design changes.So we want to automate that step if possible.Thus the question: How can I Import pinout generated from STM32CubeMx into Altium Designer Schematic.
Why after last update the pins PD7 , PD6 are only with USB_OTG_HS functions:
The chip is STM32G473VET6. When enabling opamp1 in independent mode, I found that the VINM pin can switch between PA3 and PC5. But if you enable independent mode and also connect Vout to the internal ADC channel, you'll find that VINM can only be used on PA3. How should I understand this phenomenon?From AN5306 Figure 18, you can see that you can switch using VM_SEL[1:0] and OPAINOTEN[0]. Does this mode have any limitations?
I have created a new project based on the STM32G491 and have used ADC1 to create eight ADC inputs.The only option I have presented for ADC Scan Mode is Disabled. What do I need to do to enable Scan Mode please?Kind regards,Al
Hello!I attempted running a basic FreeRTOS example on a STM32F407VET6 board using CMSIS v2 following some tutorials, replacing systick for either TIM 6 or 7 as HAL Timebase as many tutorials suggest. The code only blinks and LED on the pre-generated task.I could never get the program to work and by pausing execution I noticed it went straight to the default handler infinite loop. After reading a few posts it seems that the CubeIDE still does not generate the appropriate timer IRQ Handler within the stm32xxxx_it.c file and has to be added manually, as suggested by @Curtis B. on the posts attached bellow. void TIM7_IRQHandler(void) { /* USER CODE BEGIN TIM7_IRQn 0 */ /* USER CODE END TIM7_IRQn 0 */ HAL_TIM_IRQHandler(&htim7); /* USER CODE BEGIN TIM7_IRQn 1 */ /* USER CODE END TIM7_IRQn 1 */ } Adding the IRQHandler fixes the issue but it is a bit frustrating that many tutorials follow the same steps and rarely mention this, since it usually works fine with other MCU
Hi,after Update to v6.18.0 we get the following warning: Our configuration: Mouse hover: Obviously, you don't have a single source. Otherwise, it wouldn't be possible for the “240 MHz” label below the text field and for the “225 MHz” label to appear when hover over that same text field.Please, ST, conduct more integration tests! Attached our .ioc file.
Hello CommunityThis is my first post here, and I have started learning about the STM32G4xx processors. So I might very well have got something wrong here. I like to ask about a detail in the pin-out picture of the STM32G431 Nucleo64 board in STM32CubeMX software. When I look at the schematics for this Nucleo board, it seems that the PA5 pin can activate the LD2 LED and not the LD1. I guess, that for the typical beginner start blink software, you normally use LD2. When I look at the same picture for the NUCLEO64 STM32G474 board, this PA5 pin activate LD2.The same pin is used for input to an OP-AMP. Would it be possible to use it if you disconnect the SB6 jumper?
Thank you for your replies. Good for me to know, that this marking should have been LD2. I wondered that, I may had got something else wrong about this. It seems to me, that CubeMX assumes, that the SB6 jumper is installed, so you cannot use CubeMX to set the PA5 as input for OPAMP2. But I guess, that you can use some HAL function to do it. Am I right? CubeMx doesn’t care if SB6 is soldered or not. So remove SB6 and configure PA5 for OPAMP function either in CubeMx or using directly the HAL. When I look the PIN-out view, PA5 is marked red. When I look the reference manual about OPAMPS:Then it seems possible to have OPAM2 use PA5. In CubeMX I look at OPMP2 mode pull down menu, you got “Standalone Internally connected_IO”. But it is marked red and cannot be selected.Post split from this thread for a newer question.
why while creating new project in stm32cubemx, it show like this error downloading the following files crdb.zip?download has failed ,some data may not be updated,please retry later. how to solve it?
Hello,I downloaded the latest version of STM32CubeMX, but I am still facing this issue. Sometimes it shows "Connected to HTTP server", but after that I get the following error:Error downloading the following files:stm32cube_fw_f1_v187.zipCould you please help me resolve this issue?
This is a followup to the question: How to organize the folder structure in CubeMX-generated codeThere, the solution was by @Ghofrane GSOURI and the added comment by @Andrew Neil to keep your application code outside of CubeMX generated folders in structure like so:Project/├─ Core/ # CubeMX-owned│ ├─ Inc/│ └─ Src/├─ Drivers/ # ST/CMSIS├─ Middlewares/ # Optional (FreeRTOS, USB, etc.)├─ App/ # Your application logic│ ├─ Inc/│ └─ Src/└─ Framework/ # Your reusable firmware framework ├─ Inc/ └─ Src/Which make a ton of sense, but I am stuck at how to actually implement this in CMake. I let CubeMX generate a folder for CMake toolchain. That directory has these additional files/folder:Project/├── Application ## directories where my code would exist│ └── blinky│ └── blinky.c│ ├── blinky.h│ └── uart/│ └── ...├── cmake│ ├── gcc-arm-none-eabi.cmake│ ├── starm-clang.cmake│ └── stm32cubemx│ └── CMakeLists.txt├── CMakeLists.txt├── CMakePresets.json└── Core/...,
Dear all, I found an interesting effect using the CubeL4 and CubeMX generated files for a STM32L496 and use ADC1 and ADC3 (not simultaneously): What we do: We turn the ADCs on only when we sample data, otherwise they are turned off. To turn the ADC off, we use HAL_ADC_DeInit which calls HAL_ADC_MspDeInit. Issue: HAL_ADC_MspInit and HAL_ADC_MspDeInit keep track of active ADCs through static variable HAL_RCC_ADC_CLK_ENABLED. Init increases the count, deinit decreases it. If, however, init and fails but we still call deinit the count wraps around to 0xFFFF FFFF - upon next init it wraps around to 0, but then the ADC clock is not turned on and initialization fails again. See the code snippets below: HAL_ADC_MspInit HAL_RCC_ADC_CLK_ENABLED++; if(HAL_RCC_ADC_CLK_ENABLED==1){ __HAL_RCC_ADC_CLK_ENABLE(); } HAL_ADC_MspDeInit HAL_RCC_ADC_CLK_ENABLED--; if(HAL_RCC_ADC_CLK_ENABLED==0){ __HAL_RCC_ADC_CLK_DISABLE(); } Suggestion: Check for underflow of 
I'm trying to configure and generate a project with STM32CubeMX for the STM32WBA5MMGHx BLE module.When enabling the STM32_WPAN middleware, the ADV_TRACE module gets automatically enabled under Utilities. This in turn requires to enable at least one UART/LPUART peripheral, otherwise type UART_HandleTypeDef is undefined and compiler throws and error:../../Core/Inc/app_conf.h:304:8: error: unknown type name 'UART_HandleTypeDef'; did you mean 'RTC_HandleTypeDef'? [build] 304 | extern UART_HandleTypeDef huart1; [build] | ^~~~~~~~~~~~~~~~~~ [build] | RTC_HandleTypeDefThe STM32_WPAN throws a warning about not configured/wrong Platform Settings.Is there any possibility to configure STM32_WPAN without ADV_TRACE enabled?Used STM32CubeMX version is 6.17.0 and WBA firmware v1.19.0 and cmake project is generated.
STM32CubeMX generates inconsistent indentation in MX_Recieve_Q_Build:/** * @brief CLIP application Data scenario Receive queue build * @param None * @retval None */static void MX_Receive_Q_Build(void){ /* LPBAM build variable */ LPBAM_DMAListInfo_t pDMAListInfo_LPGPIO = {0}; LPBAM_GPIO_PinSeqFullAdvConf_t pReadPinSeqFull_LPGPIO = {0}; LPBAM_COMMON_TrigAdvConf_t pTrigConfig_LPGPIO = {0}; LPBAM_COMMON_DataAdvConf_t pDataConfig_LPGPIO = {0}; /** * Receive queue CLPReceiveBits build */ pDMAListInfo_LPGPIO.QueueType= LPBAM_LINEAR_ADDRESSING_Q; pDMAListInfo_LPGPIO.pInstance= LPDMA1; pReadPinSeqFull_LPGPIO.Pin = LPBAM_GPIO_PIN_0; pReadPinSeqFull_LPGPIO.Size = 13; pReadPinSeqFull_LPGPIO.pData = (uint32_t*)&receivedBits[0]; if (ADV_LPBAM_GPIO_ReadPinSequence_SetFullQ (LPGPIO1, &pDMAListInfo_LPGPIO, &pReadPinSeqFull_LPGPIO, &Receive_Q_CLPReceiveBits_Desc, &Receive_Q) != LPBAM_OK) { Error_Handler(); } pTrigConfig_LPGPIO.TriggerConfig.TriggerM
STM32CubeMX 6.18.0MCU: STM32H563RIT6To my understanding, this uses STM32CubeH5 1.7.0 Start a new project and enable ThreadX and NetX Duo.In “NETXDUO Mode and Configuration”, enable “NX Core”, “Crypto” and “TLS”In configuration, parameter column “NetXDuo” there are check-boxes for:TLS CORENX_SECURE_TLS_ENABLE_TLS_1_1NX_SECURE_TLS_ENABLE_TLS_1_3NX_SECURE_TLS_TLS_1_2_ENABLEDNX_SECURE_TLS_TLS_1_3_ENABLED This is a bug.According to https://github.com/eclipse-threadx/rtos-docs/blob/1e36a62618de3771c973196e7648cba50d19cf1f/rtos-docs/netx-duo/netx-duo-secure-tls/chapter2.md#configuration-options the proper configuration options areNX_SECURE_TLS_ENABLE_TLS_1_3 Defined, this option enables TLSv1.3 mode. TLS 1.3 is the newest version of TLS and is disabled by default. NX_SECURE_TLS_ENABLE_TLS_1_0 Defined, this option enables the legacy TLSv1.0 mode. TLSv1.0 is considered obsolete so it should only be enabled for backward-compatibility with older applications. NX_SECURE_TLS_ENABLE_TLS_1_1
We took cue from the ADC_Downsampling example from MX to write our Vbat measurement code. We are getting very small values of raw adc data - somewhere always between 0x160 and 0x200. We are using a coin cell with 3.3V nominal and are naturally expecting codes in the range of 3000 - 4000 (decimal format). I have attached our code and the MX configuration here. Can you please help us understand where we are going wrong? int32_t Get_Battery_Voltage_mV(void) { uint32_t adc_val = 0; uint32_t vbat_mv = 0; // 1. Start ADC, poll for conversion, and get value /* Start ADC group regular conversion */ if (HAL_ADC_Start(&hadc1) != HAL_OK) { /* ADC conversion start error */ Error_Handler(); } /* Wait for ADC conversion completed */ if (HAL_ADC_PollForConversion(&hadc1, 10) != HAL_OK) { /* End Of Conversion flag not set on time */ Error_Handler(); } adc_val = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1); // 2. Convert
STM32CubeMX v6.17.0STM32CubeIDE v2.1.1With STM32Cube MCU Package for STM32H7 v1.12.1, STM32CubeMX does not copy USART files to Drivers project folder, when I deactivated BSP and activated one USART.I had to import them manually from STM32Cube\Repository\STM32Cube_FW_H7_V1.12.1/Drivers/STM32H7xx_HAL_Driver in Src and Inc, respectively: stm32h7xx_hal_usart_ex.c, stm32h7xx_hal_usart.c; and stm32h7xx_hal_usart.h, stm32h7xx_hal_usart_ex.h.(Even though I only want to use UART capabilities, so they are not imported to CM7 Drivers folder.)Also, I reverted MCU Package back to version v1.12.1, because, with MCU Package for STM32H7 v1.13.0, STM32CubeMX v6.17.0 did not create the dual core project structure correctly and so was not interpreted correctly by STM32CubeIDE v2.1.1. It didn't create the subproject files and were displayed like usual folders, while on creation, I explicitly used STM32CubeIDE project and on import used the new import for STM32CubeIDE v2
Using project setup from NUCLEO-U3C5ZI-Q, when ADC1>ADCs_Common_Settings>Mode is set to `Dual regular simultaneous mode only` CubeMX fails to generate the HAL_ADCEx_MultiModeConfigChannel() call to configure the ADCs for dual mode. This must be manually added by the user, otherwise the slave ADC does not trigger conversions. I believe this call was supposed to generate in MX_ADC1_Init. Am I missing something here?Here is my ioc file:#MicroXplorer Configuration settings - do not modifyADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_3ADC1.ConversionDataManagement=ADC_CONVERSIONDATA_DMA_CIRCULARADC1.DMAAccessModeView=ENABLEADC1.EOCSelection=ADC_EOC_SINGLE_CONVADC1.EnableInjectedConversion=DISABLEADC1.ExternalTrigConv=ADC_EXTERNALTRIG_T1_TRGOADC1.IPParameters=Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,MonitoredBy-2\#ChannelRegularConversion,NbrOfConversionFlag,NbrOfConvers
MCU: STM32H743VIHx / STM32H743VIHPower: PWR_LDO_SUPPLYVoltage scale: Power Regulator Voltage Scale 0 / VOS0Clock setting:SYSCLK = 480 MHzD1CPRE = /1HPRE = /2HCLK = 240 MHzD2PPRE/D3PPRE = /2, PCLK = 120 MHzActual result:STM32CubeMX marks HCLK 240 MHz as error:"240 MHz max frequency must be <= 225 MHz"Expected result:According to STM32H743 datasheet, with VOS0 and LDO enabled,fCPU max is 480 MHz and fHCLK max is 240 MHz.This configuration was accepted before updating STM32CubeMX / STM32H7 MCU package.
We are pleased to announce that version 6.18.0 of STM32CubeMX is now available. What is new in 6.18.0: Added support for new microcontrollers in the STM32U3 series with 256 Kbytes and 512 Kbytes flash memory. Added support for new microcontrollers in the STM32H5 series with 1 Mbyte flash memory. Added support for new boards: NUCLEO-U345RC-Q, NUCLEO-U366RE-Q, STM32U366E-DK and NUCLEO-H553ZG. Added Start From Board feature for NUCLEO-U345RC-Q, NUCLEO-U366REQ, NUCLEO-H553ZG, NUCLEO-F446RE, NUCLEO-L432KC, and NUCLEO-L476RG. Released the following new features: Added support for PLAY for STM32H5 devices with 1 Mbyte of flash memory. Add support for the MP25-DK board in the M33-TD flavor Renamed all STM32CubeMX installers. Added DMA comparison to the "Compare projects" feature. Removed the JxBrowser dependency. Upgraded the OpenSTLinux version to OpenSTLinux (OSTL) 6.2.1. Main fixed issues in 6.18.0: Refer to the STM32 microcontroller online documen
Hello,I’m using CubeMX 6.18.0. I’m trying to implement a USBX standalone (bare-metal, no RTOS) CDC application. Code within user code sections is overwritten when re-generating the project. As far as I can see this is not a new problem, there are already some older topics about it. @ST: will this ever be fixed?Regards
After updating CubeMX to version 6.16.2, we are seeing HRtimer E and F problems which cause our product to fail. Reverting back to 6.15 and regenerating the code allows our device to work. I believe the issue is due to the change in the code database version: MxDb.Version=DB.6.0.161 but I can't be sure as the new version of cubeMX forces values into the HRtimer E and F configurations.Hoping for commiseration and resolution!ThanksRauk
I attempted to convert a CubeMX project to start using the “Generate peripheral initialization as a pair of ‘.c/.h’ files per peripheral” option and CubeMX left three peripheral handle declarations in main.c which conflict with the declarations in their individual files: handle_LPDMA1_Channel0, hlptim1 and hlptim3. Many other peripheral handles were correctly removed from main.c, including other LPDMA channel handles.Can anyone help me figure out what’s going wrong and how to fix it? I suspect that this may be because they are used in our LPBAM setup.
I updated to the newest STM32CubeMx 6.18.0Now i miss X-CUBE-AZRTOS-H5 support.I can see only an empty display after loading my .ioc file.
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.