cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-AI - Middlewares Folder is not Generated

kahuna
Associate II

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:

kahuna_0-1758122433978.png

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

4 REPLIES 4
kahuna
Associate II

I made some additional observations:

  • The "Middlewares" folder was generated but only on the first code gen of a project - if code is generated again, then the "Middlewares" folder is deleted, even though the project code depends on it. (I only checked for STCubeMX standalone + CMake build system).
  • My current workaround is this: I generate the code once and immediately save it to git. When the model is changed and code is generated again, then I keep the updated model code and restore the now deleted "Middlewares" folder. Not the best solution though ...

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


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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 

 

Sorry, I replied in the wrong place. Please ignore it.