2025-09-17 8:34 AM
Hello,
I am creating a new project on an STM32F4 nucleo board. I configured the X-CUBE-AI library as shown below and specified a TFLite model:
When generating code on a fresh project, the "Middlewares" folder is not generated. The project fails to build because the "ai_platform.h" file is missing (it should be in the Middlewares folder). The problem occurs with a fresh STMCubeIDE project and with a fresh STMCubeMX project.
I noticed that the "Middlewares" folder is generated correctly once I add additional libraries, such as FreeRTOS. In this case, both the FreeRTOS and the X-CUBE-AI code is generated correctly in the "Middlewares" folder. However, I don't want an RTOS for my application.
How can I only generate the code for X-CUBE-AI?
Best regards,
kahuna
2025-09-18 5:53 AM
I made some additional observations:
2025-09-18 6:42 AM
Hello @kahuna,
Thank you for this information.
We will look at it on our side.
I can point you to these documents that may help you:
https://stedgeai-dc.st.com/assets/embedded-docs/stm32_command_line_interface.html#update_c_files
and
https://stedgeai-dc.st.com/assets/embedded-docs/stm32_how_to_run_a_model_locally.html
To give you context, X Cube AI is just a GUI in CubeMX to use the ST Edge AI Core, but you can directly use the ST Edge AI Core CLI if you want, to bypass the bug.
As you already installed X Cube AI, you have the ST Edge AI Core installed on your PC at this location:
C:\Users\USER\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.2.0\2.2\Utilities\windows
Have a good day,
Julian
2025-09-19 3:13 AM - edited 2025-09-19 3:16 AM
I have a similar issue where the middlewares folder isn't deleted but the paths to them are so I just replace my .cproject file with an older version which seems to fix the issue
2025-09-19 3:20 AM - edited 2025-09-19 3:30 AM
Sorry, I replied in the wrong place. Please ignore it.