Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello,Now, when configuring NPU with STM32CubeMX, the generated code has the following problemI don't know what causes this problem. Could you please help me solve this problemAttached is my simple code, thank you
..
Hello everyone,I wanted to check if there is any updated information regarding when STM32CubeMX will officially enable generation and support of C++ code. Currently, I'm still relying on various workarounds to implement projects in C++, which unnecessarily complicates the development process.Does anyone have new insights or know of an official roadmap from STMicroelectronics? Adding native C++ support would be a significant improvement, especially for higher performance STM32 microcontrollers like the STM32H7, STM32U5, etc. series. C++ enables better code organization through object-oriented programming, making it easier to manage complex projects.
In previous iterations of ST Cube IDE, the project creation wizzard included a tick box to create a project based on TrustZone. This option seems to have been removed. I am using an STM32H755.Is there another way in which TrustZone based projects should now be created, and if so, could someone direct me to the revised documentation? I searched but maybe I am missing something?
Using "Firmware Relative Path" currently have 2 problems:The path in the text field is displayed as absolute while the actual path is stored in the .ioc file as relativeThis is somewhat confusing to the user as CubeMX will display different (absolute paths) for different users with the same .ioc file.Targetting the MDK-ARM toolchain will generate/update an .uvprojx file with absolute paths and not relative pathsThis is an issue when the firmware is stored in a vcs repository and share among several developpers which don't have their local copy at the same location. For each developper re-generating code with CubeMX, absolute paths on its computer will be appended in the Keil file. Therefore we need to manually remove them in the .uvprojx file before commiting our changes to the repository.Would it be possible to use relative paths instead (or support them alongside absolute paths) in CubeMX and uVision project file ? Looking at other posts in the community, it seems CubeIDE has the sam
Hi, I am a software engineer from Macronix. Recently, we are meeting with ST to discuss the driver extension pack development. And I want to get some answers in advance, so I put some questions here.How to submit flash vendor's driver software extenstion pack we developed to ST for them test and validation? Where is the entry?The submission will finally make our extension pack available in ST CubeMX tool for all the users and our company name will show in the vendor list.Is there convention to follow?
Hello,I'm stuck with Cube MX to build a M33 project for the STM32CubeMP257 Eval board STM32MP257x-EV1I managed to run the projects in the firmware repository but I didn't find any ioc file to use.Then, I tried to start a project with CubeMXBut it says the RCC config is wrong and I don't understand what is going on.The flag on RCC is green but it doesn't generate RCC code for the main.cIs it possible to find the ioc of the demo projects present in the firmware repository ?Best regardsStéphane Mancini
It would be awesome if STM applications (in my case, STM32CubeMX) were available as packages for ease of installation and update. I believe this is even already the case for STM32CubeIDE. Software package managers are a precious tool for end users. It's always embarrassing when some app ships in other ways. I do understand that it might look daunting to maintain different packages for different operating systems (.deb, .rpm, homebrew, winget, ...), but almost every open source project manages to do that, so I believe it should be doable for any large company as well. It might allow to use the system JRE and eventually other dependencies directly as well, instead of shipping them together with each app. Bonus points would be if it was possible to download said packages from public repositories. But I understand this would remove the need to log in to an STM account to obtain the software, which you might not want. I've searched for appropriate place to post this, but couldn't be sure. I
Moved from this thread. I just start new project nucleo-H755zi, and default config is quite different to HSE bypassed. If hardware pre-set to STLink provided clock, than why StmCubeMX doesn't initiate project in right way? Have to navigate into system core, change to bypass. Than have to set manually all clock tree, do useless work that has to be fixed by Cube developers.
Hello Community,I am using STM32h745 dual-core to display the value of the data received based on FDCAN. First, I created a project on TouchGFX and then imported the project on stm32CubeIDE. I set the FDCAN1 and ADC1 both on CubeMX. But the workspace does not include 'stm32h7xx_hal_fdcan.c' and 'stm32h7xx_hal_adc.c' file. So, I add these the source.c files to the workspace under 'STM32H7XX_HAL_Driver' folder. and Actually, In the Project Folder, it has been generated automatically, but does not show up in the CubeIDE workspace. I try the ADC functionality to display the potentiometer's values, to see if this ADC function working successfully.However, the functionality does not work. I do not know why the symbols are shown below, and the functionality does not work properly... Does anyone have the same problem when importing the project from TouchGFX? Please let me know, Thank you!
Originally I had the project initialize all devices in main.c. Since the file was starting to get large, i went to the Code Generator in CubeMX and selected:The option to "Keep User Code when re-generating" just doesn't work reliably. It seems it did not keep the "User Code" for the FMC device, and possibly the RTC device.... I now have to check each and every device manually.Original FMC init code: /* FMC initialization function */ static void MX_FMC_Init(void) { /* USER CODE BEGIN FMC_Init 0 */ /* USER CODE END FMC_Init 0 */ FMC_SDRAM_TimingTypeDef SdramTiming = {0}; /* USER CODE BEGIN FMC_Init 1 */ /* USER CODE END FMC_Init 1 */ /** Perform the SDRAM1 memory initialization sequence */ hsdram1.Instance = FMC_SDRAM_DEVICE; /* hsdram1.Init */ hsdram1.Init.SDBank = FMC_SDRAM_BANK1; hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9; hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13; hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_
Environment: Intel Mac, 12.7.6, CubeIDE 1.18.0, Device firmware STM32Cube FW_F4 V1.28.1 and othersI noticed that when I converted my project to use .c/.h pairs for device initialization, all of the custom peripheral initialization code got stripped. This lead to a week of debugging of "what did I break?"When using TouchGFX, the designer tool modifies the peripheral setup code to add in a whole bunch of custom code to setup and start devices like external RAM, FLASH, display controllers, and I2C devices. But if you convert your project to use .c/.h pairs, all of this code gets stripped and you end up with a long series of hard faults (accessing memory that isn't enabled), and a black screen (display controller never got turned on).I noticed that other customers were complaining about similar symptoms in the context of FreeRTOS and TouchGFX back in 2022 and there was an internal ticket generated. Well, the issue it still there and it has nothing to do with the use of FreeRTOS or TouchGFX
Hi all,I just upgraded cubeIDE from 1.17.0 to 1.18.0. I had set up a project in 1.17.0 without any issues. I was reading here some posts and I read that there is a dedicated I2S_CLKIN pin that I had missed. I was trying to figure out a clock source that would give me the 44.1kHz sampling and I figure 11.2896 MHz would do but is an odd frequency for the rest of the system. Anyhow... I enabled the I2S_CLKIN pin and set it for 11.2896 MHz. But when I save the code I keep getting an error that there is something wrong with SAI1 ... but I don't see what? I'm probably missing something basic but I can't see it so in my frustration I erased all projects and made I new one ... I still get the same error. The zip file of the project is here but SAI1 is disabled. You need to set it to master or master with clock output and save it to see the error I get. There is no code from me just cubeMX (the version built-in cubeIDE 1.18.0). What am I missing? Thanks.
HiI developed a project (for Keil-MDK) using stm32cubemx v 6.13 and a h7r7l8h6 device. Everything Ok! When cubeMX was updated for the newest version (6.14) I no longer be able to generate any initialization code as the cubeMX hangs during code generation with the information "Search needed files for the project..."There is no way past this point! Apparently this behavior is related to h7r7x devices, because with others (e.g. h747x, f767x and some g series devices) everything seems to work.Has anyone had this weird problem? If so, is there any solution? Currently my only possible solution to keep working with h7r7x devices was to downgrade cubeMX to version 6.13!!!ThanksRegards
We are pleased to announce that the minor version 6.14.1 of STM32CubeMX is available. What is new in 6.14.1: SAI settings not displayed in the configuration tab of STM32H7Bxxx devices: After upgrading to STM32CubeMX 6.14.0, the SAI tab configuration is lost. DCMI building problems in STM32N6 projects: DCMI initialization instructions are not generated for both secure and nonsecure domains. Failure in generating the initialization instructions for projects using the DCMIPP feature in CSI mode. ULPI_Clock initialization issues for STM32F7 projects using the USB_OTG_HS feature: STM32CubeMX generated code omits the ULPI_Clock initialization or adds it when it is not needed. STM32WBA63xx project generation issues: STM32_WPAN advertising menu elements not updated correctly. Inaccurate warnings about non configured peripherals. IOC files failing to reopen, reverting to the home screen. stdio.h inclusion error for STM32U5 projects: A preprocessor error occurs in the compilation of S
Dear STMicroelectronics Support Team, I am writing to report a critical compatibility issue in STM32CubeMX related to user profile paths containing non-ASCII characters (e.g., Turkish characters like "Ö"). This issue prevents the software from functioning correctly after the first launch and causes persistent errors in subsequent sessions. Issue Details User Profile Path:My Windows username contains a non-ASCII character (Öxxx), resulting in the default profile path:C:\Users\Öxxx\.stmcufinderC:\Users\Öxxx\.stm32cubemx Observed Errors: STM32CubeMX fails to initialize properly on the second launch. Temporary Workaround:Creating a new Windows user with ASCII-only username (e.g., "Omer") resolves the issue, confirming that the problem stems from non-ASCII characters in the profile path. Requested Fixes/Improvements Unicode Path Support:Update STM32CubeMX to fully support Unicode/non-ASCII characters in file and directory paths. User-Defined Data Directory
@TDK wrote: They're not made using STM32CubeMX. There should be an internal reason of this decision but it does not seem reasonable for a customer viewpoint. An expert ST staff could easily done this for all of us. Anyway, at least we have an example. Thanks for your time... New question moved from this original thread.
Hello!I have generated and run a project for testing the serial communication via Serial-UART bridge on STM32f407G-Disc1, following this tutorial https://willfrank.co.uk/stm32-vcp.htmlIt works as expected, but when FreeRTOS is added from .ioc file and the project is rebuilt and run, the virtual port is not visible anymore in Device Manager on Windows 11, if the call to the default task is commented out. All the configurations from the tutorial remain the same in the .ioc file. If FreeRTOS is disabled, and the project is rebuilt, the Virtual Com is visible once more, and the application is communicating (through DocLight in my case) with the host PC.This seems to be because MX_USB_DEVICE_Init(); is now called into the default thread StartDefaultTask. What if one does not want to use the default task? Wouldn't it be better if MX_USB_DEVICE_Init(); were called after the initialization of configuration peripherals in the main function?
Hi,I'm encountering a couple of issues while using STM32CubeMX version 6.13.0 to generate code for a project involving an STM32G0B1 MCU. The project utilizes one ADC, DMA, and TIM6 as the trigger conversion source. I'm comparing the generated LL driver code with the HAL driver code generation.My first issue concerns the TIM6 configuration. When setting the Prescaler to 64-1 and the Counter Period to 125-1 in STM32CubeMX, the generated code includes something like "64 - DEFINE...". I had to manually modify the TIM6 configuration in the generated files to set the Prescaler to 63 and the Counter Period to 124 to resolve this.The second issue relates to a difference in runtime behavior. The same function, which is called after each ADC value conversion, takes approximately 30 microseconds to execute with the HAL driver generated code. However, with the LL driver generated code, the same function takes around 39 microseconds. I'm trying to understand why this function takes longer to
Dear all, I have encountered an strange issue. I set Usart1 Baud Rate to 115200, however, Usart1 BRR[15:4]==0x0082, which corresponds to 57600.(57600 == 120Mhz/(16*0x82)). I also noticed that HAL_RCC_GetPCLK2Freq() returns a wrong pclk value 0x0E4E1C00(240M), but it should be 120M. The Usart1 Config and Rcc config are as follows :
Hi,I am installing VS Code with the STM32 extension. In the settings I need to provide a path to the MX executable. But it is not anywhere on the C drive (where everything else ST is installed).I remember I installed it with/through CubeIDE, does it mean it is not an .EXE on the drive? And so perhaps I also need to install the CubeMX as standalone?Thank you
We are pleased to announce that the release 6.14.0 of STM32CubeMX is available. What is new in 6.14.0: Added the support for the STM32WBA6xxx microcontrollers and: Added the support for USBX multi-instance Added the support for the memory management tool (MMT) Added the support for the STM32WBA65I-DK1 Discovery kit and NUCLEO-WBA65RI Nucleo board Deployed the Start From Board feature on the NUCLEO-WBA65RI Improved the Power Delivery (USB PD) functionality for STM32H7Rx/7Sx and STM32N6 microcontrollers by upgrading the USB PD library core to v5.3.0 Adapted STM32CubeMX user interface to allow the user to: Access the Compare Projects utility from the home page and compare two existing projects Compare two existing projects without save down Improved the build process with CMake Update the RIF panels to indicate the peripherals that are not supported by STM32MP2 products. Removed the Secure Manager boot path Main fixed issues in 6.14.0: Refer to the STM32 microcontroller wiki at:http
Very late response, but I was having the same issue with cubemx v6.14.0 working with stm32h755zit3u on a nucleo-h755zi dev-board and using stm32cubeIDE v1.8.0. After some investigation, cubemx is not updating the links .project file in cubeIDE. The .project file is just xml, so manually edit it and add links to stm32h7xx_hal_adc.c and stm32h7xx_hal_adc_ex.c (substitute h7xx for correct uC version for your project). Possibly, I have set up something incorrectly in cubeMX - I'm just learning ADCs. But, re-hitting the "generating code" button in cubeMX did not wipe out the my .project edits. So, at least a temporary fix.
Hi, I'm working on an STM32U595 and there is a code generation problem in the function `void PWR_S3WU_IRQHandler(void)` where when you have multiple wake up pins and S3WU interrupt enabled : /* USER CODE END PWR_S3WU_IRQn 0 */ HAL_PWREx_S3WU_IRQHandler(PWR_WAKEUP_PIN2 || PWR_WAKEUP_PIN5 || PWR_WAKEUP_PIN6); /* USER CODE BEGIN PWR_S3WU_IRQn 1 */ But the generated code should be: /* USER CODE END PWR_S3WU_IRQn 0 */ HAL_PWREx_S3WU_IRQHandler(PWR_WAKEUP_PIN2 | PWR_WAKEUP_PIN5 | PWR_WAKEUP_PIN6); /* USER CODE BEGIN PWR_S3WU_IRQn 1 */ This creates a big problem because as soon as you define several wake up pins in stop mode 3, it no longer works. Best regards, Steven
The linker scripts generated by MX for the STM32U5G9xx devices are reporting 2528 Kbytes of RAM. These are 3MB devices so I would expect there to be 3008 Kbytes of RAM when ECC is disabled. MX output to STM32U5g9xx_FLASH.ld:/* ** Abstract : Linker script for STM32U5G9xJ Device from STM32U5 series ** 4096Kbytes FLASH ** 2528Kbytes RAM */ /* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2496K SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 4096K } See Table 2 and page 27 of https://www.st.com/resource/en/datasheet/stm32u5g9vj.pdf On a somewhat related note, MX in Linux wasn't generating the linker scripts so I had to use a Windows computer to generate them.
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.