Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
This is for an STM32F303.I've reduced my MX configuration down as much as possible so that it only has SWD and a button on GPIO PA8 configured and the incorrect behaviour still occurs. The intent is for PA8 EXTI falling edge to start a timer, and for that timer to in turn interrupt on expiry. I do get an interrupt (for both EXTI and the timer), but the duration of the timer is always wrong (sometimes instant, sometimes quite slow), and when on interrupt I check instance->CNT it is always a random value.Following https://community.st.com/t5/stm32cubeide-mcus/hal-tim-periodelapsedcallback-firing-very-prematurely/m-p/588486 I am issuinghbuttonDebounceTimer->Instance->SR &= ~TIM_SR_UIF;during USER CODE 2 (after init, before the main loop), and it has no effect.My ISRs look likevoid HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { if (htim == buttonDebounceTimer) { HAL_TIM_Base_Stop_IT(htim); } } void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
I'm trying to use STM32CubeMX directly or via STM32CubeIDE, and I can't find a way to configure ThreadX + USBX Host for STM32WBA65 boards such as NUCLEO-WBA65RI or STM32WBA65I-DK1. Only Device classes show up.I've also tried to do it using the part directly instead of a board or example, and even then I only see Devices under X-CUBE-AZRTOS-WB > USB USBX > USBX from the Software Component view.I have noticed a few thingsThere is no X-CUBE-AZRTOS-WBA only WB under select Components, but they are both there under Manage Software PacksI must change HSE to Bypass to have USB_OTG_HS enabled under connectivty.Even after configuring USB_OTG_HS to Host Only there are no UX Host parts showing in the Compnents under X-CUBE-AZRTOS-WB > USB USBX > USBX.Pinout & Configuration there is a separate THREADX and USBX between i-CUBE-wolfTPM and X-CUBE-AI which looks like I can turn on at the same time as the normal ThreadX per MCU Line.Is there an example of USB Host on
This (DMA_STR0_IRQHandler) won't, but this (DMA1_Stream0_IRQHandler) is work-fine.Clearly, the naming and cases are different, but these two handlers are part of startup file, were generated from two different projects options (Empty and Cube MX) for the same MCU (STM32H723).Project-generated option: Cube MX.word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */.word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */.word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */.word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */.word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */.word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ Project-generated option: Empty.word DMA_STR0_IRQHandler /* DMA1 Stream0 */.word DMA_STR1_IRQHandler /* DMA1 Stream1 */.word DMA_STR2_IRQHandler /* DMA1 Stream2 */.word DMA_STR3_IRQHandler /* DMA1 Stream3 */.word DMA_STR4_IRQHandler /* DMA1 Stream4 */.word DMA_STR5_IRQHandler /* DMA1 Stream5 */.word DMA_STR6_IRQHandler /* DMA1 Stream6 */I encountered this in the past and solved it by unif
For background see: https://community.st.com/t5/stm32cubemx-mcus/stm32cubemx-6-2-1-for-nucleo-h745zi-q-doesn-t-generate/m-p/226159/highlight/true#M10675In many embedded systems most peripherals are off most of the time, for power saving, and they are enabled only when needed. When CubeMX moves peripheral clock configuration from the MSP file of the HAL peripheral to PeriphCommonClock_Config() it makes this behavior harder to achieve. Is there an option to tell CubeMX to leave clock configuration in the HAL MSPs rather than creating the shared function ?
Hi all,With STM32CubeMX 6.15 and STM32H723VGH, I try to configure the Quad SPI on OCTOSPI1 but it seems CubeMX does not autorize this functionnality. All modes are selectable (single, dual, dual-single, dual-dual...) but only the Quad SPI is not selectable.If I try with the release 6.14, the Quad SPI is selectable.Does anyone have the same issue ? Is there any solution ?
Cube MX does not allow LWIP to be configured without the Ethernet controller enabled - for some strange reason. Any assistance would be appreciated.
STM32H7 + SDIO + FATFS(use DMA template Disable) => works fine. I can read data from SD card without issue. STM32H7 + SDIO + FATFS(use DMA template Enable) => mount will fail The only difference is "use DMA template". Once this option is turned on, fatfs mount will fail...
Today, while using the CubeMX product, I upgraded to version 6.15.0 (previously 6.14.1). After upgrade, the CMake step when generating project code failed. Even when generating an empty project, CMake still did not succeed. I also tried previously working projects that had been successfully flashed before, but they also failed during the CMake step.The following error message was displayed: CMake Error at D:/Program Files/JetBrains/CLion/bin/cmake/win/x64/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "C:/Program Files/GNU-Arm-Toolchain-eabi/bin/arm-none-eabi-gcc.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'D:/project/keysking/P10_Clock/clock/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-q0iun1' Run Build Command(s): "D:/Program Files/JetBrains/CLion/bin/ninja/win/x64/ninja.exe" -v cmTC_47519 [1/2] C:\PROGRA~1\GNU-AR~1\bin\AR19DD~1.EXE -std=gnu11 -fdiagnostics-color=always -o
Comparing CMake projects with STM32CubeIDE projects shows many unused libraries added as source for CMake project:\Drivers\CMSIS\DSP (44.7MiB)\Drivers\CMSIS\Core (1.8MiB)\Drivers\CMSIS\NN (1.5MiB)\Drivers\CMSIS\RTOS2 (112.KiB)\Drivers\CMSIS\RTOS (40.0KiB)Total size of these extra unused files is 48.1MiB. I think this is because initially I selected "Copy all used libraries into the project folder" (I think this is the default option). But when I check "Copy only necessary library files" they won't be removed when regenerating. Despite "Delete previously generated files when not regenerating" being checked.If I delete them and generate again then they won't be added again and build works fine. So they clearly are not needed.I'm using the latest version: STM32CubeMX V6.15.0
Same problem here (Cube 6.15.0, Keil uVision Although HAL is selected, Cube installed both HAL and LL files for ADC and some other peripherals by mistake. which results in a compile error ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c(25): error: 'stm32_assert.h' file not found To get rid of this, I excluded the unnecessary file in the project as shown above and the error is gone. Edit: Moved from CUBE MX with Keil 5.39 Full Assert bug in stm32l0xx DFP
The first watchdog successfully generates /** Configure Analog WatchDog 1 */ AnalogWDGConfig.WatchdogNumber = ADC_ANALOGWATCHDOG_1; AnalogWDGConfig.WatchdogMode = ADC_ANALOGWATCHDOG_SINGLE_REG; AnalogWDGConfig.HighThreshold = 20; AnalogWDGConfig.LowThreshold = 4; AnalogWDGConfig.Channel = ADC_CHANNEL_1; AnalogWDGConfig.ITMode = ENABLE; if (HAL_ADC_AnalogWDGConfig(&hadc1, &AnalogWDGConfig) != HAL_OK) { Error_Handler(); }The second watchdog generates... nothing. When I write out similar code myself for the second watchdog then it starts working. The IOC interface looks like
For a project based on the STM32U585 I use the MDF in a specific configuration.Filter 0: receives input from SIT0Filter 1 receives input from SIT3Filter 3 receives input from SIT0So three filters are used and only two serial input streams. Serial input stream 1 is not needed and I cannot configure it since the pin of this serial input is used for another function.It appears that when for a filter a serial input is disabled, the code generation is wrong.The configuration for filter 1 is shown below:As said, for filter 1 the serial interface is disabled since this filter is configured to receive its data from serial input stream 3, this is ok.However, the code generated for MX_MDF1_Init does not specify the configuration setting to tell filter 1 to use stream 3. The generated code for filter 1 is shown below: /** MdfHandle1 structure initialization and HAL_MDF_Init function call */ MdfHandle1.Instance = MDF1_Filter1; MdfHandle1.Init.CommonParam.InterleavedFilters = 1; MdfHandle
I created a Boot/App/ExtMemLoader project for my NUCLEO-H7S3L8 via the STM32CubeMX for STM32CubeIDE, and ran into issues when running the application code from the external NOR Flash chip on the NUCLEO board (U18, P/N MX25UW25645GXDI00 on the schematic). The Boot and ExtMemLoader applications run just fine. However, the App would not run with the default config generated in STM32CubeMX. Screenshot here:After changing the FifoThresholdByte to `1`, setting the size to 256Mbit, and reducing the XSPI clock to 180MHz, I was able to get the application to run. I probably should double-check which of these settings are necessary. Although I can now have it execute the Application from the external FLASH, I am now running into issues when setting breakpoints and debugging the application. The debugger stops responding entirely, and I have to kill the GDB instances in order to recover.I wonder if something in the XSPI config is still off. Is there a way
We are migrating to a custom board and controller. Looking at the IOC generated by the Motor Control Workbench, there are some mystery variables that show up in the timer and we cannot track down where they are defined. See the attached snapshot and highlighted areas.Where are these defined? What is HTMIN?
MCU used : STM32H753ZITx LQFP144CubeMx version : 6.13.0Situtation: I have a IOC file with some configurations on ADC1, like "Left Bit Shift" set to "4 bits shift" and "Conversion Data Management" to "DMA One Shot Mode".Those modifications are not translated into the generation ADC init in main.cI need to edit this by myself by callingADC_REG_InitStruct.DataTransferMode = LL_ADC_REG_DMA_TRANSFER_LIMITED;ADC_InitStruct.LeftBitShift = LL_ADC_LEFT_BIT_SHIFT_4;
I found the following issues when generating code for an SAI peripheral using CubeMX6.14.0 for the STM32H73IIKx board. These issues are also present in 6.14.1 and 6.15.0. They are not present in 6.13.0.1. Displayed Real Audio Frequency in CubeMXTwo sub-issues:When a specific Audio Frequency is selected, the displayed Real Audio Frequency seems to be equal to the read audio frequency for a clock divider of 0, regardless of the Audio Frequency Selected.WhenUser set Master Clock Divider value is selected for Audio Frequency, the displayed Real Audio Frequency is 0.These issues are shown in the attached Real Audio Frequency.jpg.2. OVERSAMPING constants are used for the NoDivider field in the generated codee.g. hsai_BlockA1.Init.NoDivider = SAI_MCK_OVERSAMPLING_DISABLE;This is shown in the attached SAI Generated.jpg, which shows a diff between the code generated by 6.14.0 and previously generated code.3. OVERSAMPING constants for the MckOverSampling field are incorr
Setup:STM32CubeMX Version v6.14.0SMT32Cube FW_G4 V1.16.0Problem Description:When enabling RegisterCallback for EXTI Interrupts, the generated code still calls a predefined interrupt callback for EXTI interrupts and does not call the registered callback function./** * @brief Handle EXTI interrupt request. * @PAram GPIO_Pin Specifies the port pin connected to corresponding EXTI line. * @retval None */ void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin) { /* EXTI line interrupt detected */ if (__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != 0x00u) { __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); HAL_GPIO_EXTI_Callback(GPIO_Pin); } } /** * @brief EXTI line detection callback. * @PAram GPIO_Pin: Specifies the port pin connected to corresponding EXTI line. * @retval None */ __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { /* Prevent unused argument(s) compilation warning */ UNUSED(GPIO_Pin); /* NOTE: This function should not be modified, when the callback is needed, the HAL_GPIO_EXTI_
Hello ST team,I’m using an STM32F723 microcontroller with USB HS (High Speed) in Communication Device Class (CDC) mode.Everything worked perfectly using:STM32CubeMX v6.10.0STM32Cube FW_F7 v1.17.1However, after migrating the project to:STM32CubeMX v6.13.0STM32Cube FW_F7 v1.17.4the USB HS initialization fails due to what appears to be a missing clock enable definition and configuration in the generated code.Observed behaviorIn the generated usbd_conf.c file, inside:void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)Previously (working version) CubeMX generated:/* Peripheral clock enable */ __HAL_RCC_OTGPHYC_CLK_ENABLE(); __HAL_RCC_USB_OTG_HS_CLK_ENABLE(); __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE();After the update, the generated code only contains:__HAL_RCC_OTGPHYC_CLK_ENABLE();As a result, the USB HS peripheral never initializes properly, and the code hangs in a timeout during initialization, specifically here:stm32f7xx_ll_usb.c → function USB_CoreInit():ret = USB_CoreReset(USBx); /* Wait fo
I'd like to report one issue with DMA Linked List editor. I need to do PSSI reception with GPDMA using linked list on STM32H7R3L8H6H. CubeMX is version v6.15.0 and CubeIDE is v1.19.0.Based on reference manual (RM) and AN5593, the GPDMA ports 0 and 1 are both AHB ports, with port 0 being capable of direct access to APB peripherals. However, Linked list editor in CubeMX displays port options with wrong names:I guess it follows HPDMA port naming. Maybe it should avoid naming at all or decide it based on the DMA channel option in the List editor.It looks like a minor issue, but I happened to make opposite choice because memory is on AXI bus so for me it is yet another problem on the way of getting the whole thing working.
In Docs & Resources dialog, we have every docs except the datasheet.The only way to read datasheet is the icon during device selection, once the project is created there is no more link to datasheet.
I have a project with the STM32H753IIT6 with 9 free pins on it all of them labeled and many peripherals configured. I want to migrate to STM32H7R3I8T6 which I understand is the same family of MCU, it should be possible. I followed the steps in How to switch from one STM32 to another using STM3... - STMicroelectronics Communityand after selecting the document from where to import I get the "Project is successfully imported. Import RCC : PASS" dialog, but all the configuration remains in default state, nothing has changed. I also tried to create a new project with the same MCU as before (STM32H753IIT6) and it was really imported; all pins are there.Also tried to create a new project with the STM32H753IIT6, assign a few pins, save it and imported this one into the STM32H7R3I8T6 but the result is the same it says it was success, but nothing is changed. Should I do something different of is this some bug? how can we figure this out?
Hi,I'm configuring the CubeMX for an application with 5 capacitive sensors.I used G1_IO1 and G1_IO2 for two sensors, and G1_IO3 for the sampling capacitor of G1. The other three sensors are on G4_IO1, G4_IO2 and G4_IO3, with the sampling capacitor on G4_IO4.The active shield is configured on G3_IO2 with the sampling cap on G3_IO3.I would like to define banks to sample G1_IO1 at the same time as G4_IO1 (and shield), and G1_IO2 with G4_IO2 (and shield). The third bank will be a single channel (G4_IO3).I was actually able to set it in the tsl_user.h as#define CHANNEL_0_IO_MSK (TSC_GROUP1_IO1)#define CHANNEL_0_GRP_MSK (TSC_GROUP1)#define CHANNEL_0_SRC (TSC_GROUP1_IDX) /* Index in source register (TSC->IOGXCR[]) */#define CHANNEL_0_DEST (0) /* Index in destination result array */#define CHANNEL_1_IO_MSK (TSC_GROUP1_IO2)#define CHANNEL_1_GRP_MSK (TSC_GROUP1)#define CHANNEL_1_SRC (TSC_GROUP1_IDX)#define CHANNEL_1_DEST (1)#define CHANNEL_2_IO_MSK (TSC_GROUP4_IO1)#define CHANNEL_2_GRP_MSK (T
Hello,I'm new to Keil and want to port an existing project from STM/FreeRTOS/GNU to Keil toolchain. I've created a project for STM32F4 for Keil MDK using CubeMx V6.15.0.For RTOS, I use RTX5 / CMSIS-RTOS2 API.I get the following compile errorC:/Users/t3.loc.StJo/AppData/Local/Arm/Packs/ARM/CMSIS/6.2.0/CMSIS/RTOS2/Source/os_systick.c(70): error: no member named 'SHPR' in 'SCB_Type'; did you mean 'SHP'? SCB->SHPR[11] = SYSTICK_IRQ_PRIORITY; ^~~~ SHP ../Drivers/CMSIS/Include\core_cm4.h(453): note: 'SHP' declared here __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */According to this info Breaking changes in CMSIS-Core 6, there is a version mismatch between the CMSIS-RTOS and the STM HAL version. First is installed via Keil IDE, second by CubeMx.As a quick test I renamed SHP to SHPR in core_cm4.h but I'm quite sure that this is not the way to go.Here is my setup:Any suggestions are very appreciated.
Hi ST Community Team,I previously raised a concern regarding the STM32N657x0H3Q and the NetX Duo Ethernet stack where some driver files are not generated by STM32CubeMX (see original post):"https://community.st.com/t5/stm32cubemx-mcus/stm32n657x0h3q-netxduo-ethernet-some-drivers-files-not-generated/m-p/805201#M32333"This issue is still not resolved, and I haven’t seen any fix or update addressing the problem. It’s blocking development on my end. Could you please look into it.Thank you .
I use my own modified sct file in Keil, and when CubeMX generates project, it overwrites the sct file in the default location.Even ignore the default sct file and chang the Keil sct settings (using a modified sct file stored in a non-default location), CubeMX will reset this setting to the default file when cubemx generates the project. Keil 5.43.1CubeMX 6.15MCU Package F3 1.11.5
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.