Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello! I have STM32N6570-DK and i would like to disable or make Trust Zone transparent to me and develop the project without safety like your products with cortex M3,M4 and M7 cores with all resources available. I can find some video content on disabling Trust Zone on STM32L5 and STM32U5 but not for STM32N6. STM32CubeIDE offers me a Secure or Secure-Non Secure project generation. Any tips ? Thank you
Hello Support Team,Good day,For product development, we chose the STM32U585 family, a trust zone-based MCU. Consequently, we are having a problem when we generate projects using Cube Ide.I've listed the actions we're taking below.Selected IC STM32U585AII6Enabled TrustzoneEnabled X-CUBE-FREERTOS and active for non-secure regionGenerate a project codeCompile code as per generated toolWhen I compiled code we have seen below compilation error undefined reference to `SecureContext_SaveContext' portasm.c undefined reference to `SecureContext_AllocateContext' port.c undefined reference to `SecureContext_LoadContext' undefined reference to `SecureContext_Init'I've included a screenshot of the error for debugging.
Hey there community,As you can see I am trying to move the free Rtos and x-cube-st67w611 middle ware from the application context to the FSBL context, I am using the stm32n6 mcu series and MX 6.16.0 version.I failed to see the full message suggested by the MX tool, as to why this is, I also noticed that in the example projects the context is fixed to FSBL, hence doable. my intention is to develop in the FSBL content and latter migrate to the application content.Does any one have a idea of what I can do to?
Inside Cube config, i do not get the other internal connected pins on pin 14, only PA8... in older versions it was available. The chip is STM32U031F8... What do i do wrong.. i need to use the uart_tx function on pin 14... Thank you Old version from Cubeide... New version from Inet : 6.16.1
Hello, I created a complex project for a STM32H573 based custom board. That project is ThreadX based and it shall use the USPBD package. I generated to project with STM32CubeMX version 6.16.1 using STM32Cube MCU Package for STM32H5 Series 1.5.1 (see attached IOC file for reference) I create the code for the latest STM32CubeIDE 2.0.0. The project is imported successfully, but does not compile and the following errors are logged: Description Resource Path Location Type 'USBPD_CORE_PDO_TYPE_APDO' undeclared (first use in this function); did you mean 'USBPD_CORE_PDO_TYPE_FIXED'? usbpd_dpm_user.c /test03/USBPD/Target line 1100 C/C++ Problem 'USBPD_CORE_PDO_TYPE_APDO' undeclared (first use in this function); did you mean 'USBPD_CORE_PDO_TYPE_FIXED'? usbpd_dpm_user.c /test03/USBPD/Target line 1577 C/C++ Problem 'USBPD_ParamsTypeDef' has no member named 'PE_UnchunkSupport' usbpd_dpm_user.c /test03/USBPD/Target line 1507 C/C++ Problem 'USBPD_ParamsTypeDef' has no member named 'PE_UnchunkSupport
I've reported a STM32CubeMX bug, but I am afraid that there is no one to look at it. Is there any better place to report bugs/issues? Things I've reported are quite a blocker for me and I really need to know if there is anyone working on it, or I'll have to find a workaround.Thanks.
CubeMX does not generate sourcecode completely for the chosen STM32H723.Even for a minimum System, several CMSIS includes are not present.Please see my IOC file.CubeMX Version 6.16.1CubeIDE Version 2.0Firmware STM32Cube_FW_H7_V1.12.0 gepatched to 1.12.1A similar file which includes LwIP also has many LwIP files not included.Please help ....
1. Run StmCubeMX and then chose upgrade in Ubuntu2. After download it error with something alike it cannot unzip the file. Reason:1. it seems CubeMx uses the .installationinformation hidden file in its folder to find the installation folder.INSTALL_PATHt\00$.....<your patch>/STM32CubeMXt\These are settings in a binary format, so there are some weird character. Anyhow it cannot be changed by user.Solutions:1. Move CubeMX back to where is was installed (not desired) after upgrade, move it back where it is desired.2. Remove and Reinstall CubeMX Suggested fix:1. Make CubeMx upgrade process install folder agnostic.
Hi,this is a small but annoying little bug: Sometimes after running code generation, apparently the STM32CubeMX application keeps some files open in the "cmake" subdirectory. This then prevents me from modifying or deleting (to force re-generation on the next code generation run) the files. It also interferes with my Post Generation user script which modifies those files.This can be seen e.g. via ProcessExplorer:It would be helpful if STM32CubeMX would close all file handles after code generation, ideally before calling the post generation user scripts.Thanks!
I'm using "STM32CubeIDE for Visual Studio Code" on Ubuntu 22.04. I have a situation where I'm making a driver for a chip where it very much benefits me to make the driver into a class and instantiate several instances of it.Generally speaking, what are the best practices here, if I still want to use the CubeMX code generation?At the moment, here's what I'm doing:Add `CXX` to the languages in the `./CMakeLists.txt` file. Also add the driver.cpp file to the target_sources() directive in `./CmakeLists.txt`. Change the file extension of main.c to main.cppChange the ./cmake/stm32cubemx/CMakeLists.txt to reference the main.cpp fileI was planning on automating this with a pre and post script which would do a `mv main.cpp main.c` and `mv main.c main.cpp`. And then also changing the generated CMakeLists.txt to reference the main.cpp.However, it seems that a simple bash script isn't being run. Is there a less hacky way to do this?Does the Before Code Generation and Af
Hello STM Community,I'm encountering persistent UART Overrun (ORE) errors on the STM32H573RIT6 when using code generated from a fresh STM32CubeMX project (.ioc file).Setup and Reproduction:Created new STM32CubeMX project for STM32H573RIT6Generated code and tested UART reception with:HAL_UART_Receive_IT()HAL_UARTEx_ReceiveToIdle_IT()Result: Continuous ORE errors in both interrupt and IDLE modesKey Observations:Issue persists even at:Reduced system clock frequenciesLower baud ratesWith non-blocking ISR implementationDMA Mode Works Perfectly:HAL_UART_Receive_DMA()HAL_UARTEx_ReceiveToIdle_DMA()No ORE errors observedComparative Testing:Regenerated multiple fresh CubeMX projects for STM32H573RIT6 → ORE persistsUsed older .ioc file with UART configuration → No ORECreated new CubeMX project for NUCLEO-G071RB → UART interrupt/IDLE works perfectly, no OREQuestion:Could this indicate a CubeMX configuration issue specific to STM32H573RIT6 UART peripheral initialization?Any insights from ST en
Hi,This is for STM32U5 and STM32H7 series MCUs.I was starting to use ThreadX because it looked like it was preferred over FreeRTOS. Now it looks like it is going the other way FreeRTOS is preferred over ThreadX ... or so I read/watched.I liked ThreadX with FileX because they seemed better integrated than FreeRTOS and say FATfs. But I don't have a lot of experience with RTOS in general. I've used a bit of FreeRTOS before but it looked like ThreadX was a better option for STM32U5 series MCU (in cubeMX).The video I watched and info on going back to FreeRTOS with separate FileX (from STM) said that it was going to happen by the end of 2025. I prefer to stay with one RTOS, whichever is going to make my life easier but I also need a file system.We're at the end of 2025 so I wonder if this switch from ThreadX to FreeRTOS with separate FileX has already been implemented in the new STM32cubeIDE v 2.0? BTW I'm currently using STM32CubeIDE v1.19.0 with Windows 11.Comments/suggestions w
The X-CUBE-AZRTOS-H7RS middleware is missing the setting to change the USBX System Stack Size which in turn means that the USBX_MEMORY_STACK_SIZE define in the app_usbx.h file can not be changed from its default of 1024. And because the define is not in a USER CODE section, any manual change will be overridden when re-generating code in CubeMX.Here is an example when using USBX host stack, but it's the same for the device stack.STM32H7RSxx:STM32H7A3ZIT:
Hi everyone,I'm currently porting the App of STM32U5 SBSFU example to CubeMX and "smooth" is not the word I would use to describe the process.Namely, the SBSFU example includes Bootloader, Loader and App projects with memory map being in separate centralized header files included by all these projects. These files (region_defs and flash_layout) are not fully polished (some bugginess and inconsistencies) but they do ease the memory management a lot by using defines and not hardcoding; these defines are then used in projects' linker files in order to define memory regions.In contrast, CubeMX just provides a UI representation of the memory space where users can input all the memory bounds, be it flash or RAM. The trouble is, we can only enter numbers and not constants, so generated code is full of hardcoded address bounds.This does not play well with SBSFU Example - since these address bounds are not only used in LD files, but rather for defining FLASH areas, SAU regions etc etc, it is an
Hi, I am using CubeMX 6.16.1 to work on a STM32F777ZIT6 target. However, the generated code does not have the Macro definitions of the GPIO pins in main.h. The GPIO init part IN MX_GPIO_Init() is also empty, as follows:/** * @brief GPIO Initialization Function * None * @retval None */ static void MX_GPIO_Init(void) { /* USER CODE BEGIN MX_GPIO_Init_1 */ /* USER CODE END MX_GPIO_Init_1 */ /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /* USER CODE BEGIN MX_GPIO_Init_2 */ /* USER CODE END MX_GPIO_Init_2 */ } I also tried CubeIDE 1.19.0, have the same issue.Did I do anything wrong? I think it is really important to get this function work, as it would be cumbersome to manually init the GPIO pins. I attached the .ioc file, thanks in advance for your help.Thanks,Xiankun
I generated a project using STM32CubeMX for the STM32N6570-DK board.Steps performed:Generated code using CubeMX (default configuration)Imported project into STM32CubeIDEBuilt the project successfully (no build errors)Attempted to run/debug the applicationDuring programming / start of execution, the debugger stops with the following message:Break at address “0x18003A1A” with no debug information available, or outside of program code
Hi,I encountered a strange problem while using stm32cubeMX in a new project.Everytime i saved the code files and then regenerated the code using stm32cubeMX,the user code will gone.A example,"#include "led.h" " have been insert in the user code zone,then i saved the project,and regenerated code using stm32cubeMX.then "#include "led.h" " is missing..."Keep User Code When re-generating" already been checked as shown in the figure。stm32cubeMX version 6.16.1.any advise will be appreciated,thx.
I have just installed STM32 cubeMX v6.16.1 on my Windows 10 machine have the following issue:In the Pinout&Configuration step we can hover mouse over items in the left tree view and eventually we can click on links to Related Documents. However those documents open in Acrobat Reader on my machine, even tough I have configured PDF-XChange Editor as default PDF viewer (Windows Settings, Apps, by ending, .PDF -> PDF XChange Editor).When I double-click PDF files in Windows Explorer they properly open in PDF Xchange, not Acrobat Reader. Having PDFs open in Acrobat is really annoying due to the constant popups and waste of screen space with useless tabs.
I am developing a product using the NUCLEO-N657X0-Q dev board and have generated the configuration setup from CubeMX and developed the code in the CubeIDE. When I need to layout my own circuit board I will want to use the STM32N657A0 variant which has 169 pins and I was wondering if I am able to use CubeMX to change the existing configuration done for the Nucleo board to the STM32N657A0 169 pin device without destroying the code I have already developed? I have written the code using resources and pin outs available on the STM32N657A0 device but the actual pins are different on the two devices so need to know if I can make the transition using CubeMX or whether it will have to be done manually?
I'm trying to generate code using CubeMX for the Nucleo-U031R8 demo board to output a clock signal to the MCO2 pin. But the generated MX_GPIO_Init function makes the following assignment:GPIO_InitStruct.Alternate = GPIO_AF0_TRACE;Naturally, the compiler throws an error: "GPIO_AF0_TRACE undeclared".If I manually change the code to the following:GPIO_InitStruct.Alternate = GPIO_AF0_MCO2;...the code compiles without errors.Is it possible to fix this bug in the next CubeMX release?
Hi! I am working on creating a new build system for my for a software platform using CMake to help with management of different targets and toolchains. I have an .ioc file that is currently in use with the existing build system based on CubeIDE that contains all middleware (FreeRTOS, LwIP, TouchGFX) additions and configurations, so I am not changing anything. I am trying to make the build as modular as possible so I am trying to link the stm32cubemx and touchgfx CMake targets directly. I am using build presets to manage configuration. Creating the build system works fine, but when I try to run the build I get compilation errors because the TouchGFX related files can't find the user constants defined in CubeMX for TouchGFX, as shown below: This can be expected because these symbols are created in defines on main.h and the TouchGFX file being referred there does not include main.h. I could add it manually, but I'd like to try to get the system to work directly from autogen
Hi, I'm developing a project for STM32N657X0HxQ MCU and I need to run a NN model on it. I installed the 10.2.0 package for X-CUBE-AI and I've selected Core for Artificial Intelligence X-CUBE-AI in the Software Packs component selector. However, whatever Device Application I select, I always get when I'm on the Configuration Tab in Pinout & Configuration "Warning: This peripheral has no parameters to be configured" and I cannot upload my NN model, even when Artificial Intelligence X-CUCE-AI checkbox has been selected.I'm using the 6.16.1 Version of STM32CubeMX.Thank you for the cooperation
When creating a new CMake-based project in STM32CubeMX, the "Toolchain Folder Location" field is auto-populated with the project folder path upon entering a project name. This behaviour is misleading because the field is intended (at least by its description) to specify the location of the actual toolchain binaries (e.g., GCC ARM) and it is unlikely that a toolchain is installed in a specific project folder.I have tried to understand what this is by consulting the User Manual UM1718 Revision 49, and there were two references that matched the text "toolchain folder", both of which provided no helpful guidance on what this is actually used for.This is pretty much the only reference that describes what this option is for, which basically tells you nothing but confirms the toolchain is located in the project folder by default.Steps to Reproduce:Launch STM32CubeMX.Select a target MCU (e.g., STM32C011F6Px).Choose CMake as the project type.Attempt to change the field before setting a valid pr
After generating C code for a CMake project, I'd like to use some existing code that I've developed elsewhere.Is there good information or guidance on how to do this properly?For example, should compile my code as a static library and bring it into my project? If so, what is the recommended way to do this (how do I ensure compatibility, etc)? Or should I just copy-paste the source code files and headers into the project?
Split from IDE Version 2.0.0 - why remove MX ? as this has nothing to do with that topicPinout view is bad also.In center of window useless hole with ST logo. Wastefull use of GUI area. 80% of area is gray hole in center or white hole at the borders.Much better to use table with pins info. In the table can be shown some usefull information in addition to pin name (type of pin, for example). Current design can be used as additional presentation.CubeMX design is created by managers wich have no undestanding of developer needs.
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.