2026-01-26 6:04 AM
Hello,
I'm having trouble getting the CubeMX code generation to work reliably with X-CUBE-AI package.
After first adding X-CUBE-AI to the project, and adding one of the models from the ST model zoo, i get this warning:
If i click Yes, the code generation takes about 5 minutes and works.
Note that in the above picture, X-CUBE-AI ExtMemLoader is selected. This is also where the warning comes from. AFAIK, i don't need X-CUBE-AI ExtMemLoader, just the Application. If i remove the checks from the checkboxes "Artificial Inteligence X-Cube-Ai" and "Device Appliccation", and then reopen MX, the X-CUBE-AI ExtMemLoader will disappear, and just the X-CUBE-AI Application remains. However, after trying to generate code with that setup, the code generation hangs to the below phase of code generation:
At that state, the OpenJDK Platform binary uses over 6000 MB of RAM, and about 10% of my CPU but seemingly nothing happens. I waited over the weekend to see if the generation would finish but it did not, then I retried multiple times, waiting about 20 minutes each time and it always hangs there.
Also there are some paths in the mx-generated.cmake which are wrong i think, as the code fails to build:
[0/1] Re-running CMake...Build type: Debug
-- Configuring done (0.4s)
CMake Error at mx-generated.cmake:147 (target_sources):
Cannot find source file:
C:/Users/tuoma/STM32Cube/helium_test/Src/audio_network.c
Call Stack (most recent call first):
CMakeLists.txt:40 (include)
CMake Error at mx-generated.cmake:137 (target_sources):
Cannot find source file:
C:/Users/tuoma/STM32Cube/helium_test/Middlewares/ST/AI/Npu/ll_aton/ecloader.c
Call Stack (most recent call first):
CMakeLists.txt:40 (include)
CMake Error at mx-generated.cmake:136 (add_library):
No SOURCES given to target: ST
Call Stack (most recent call first):
CMakeLists.txt:40 (include)
CMake Generate step failed. Build files cannot be regenerated correctly.
but builds after adjusting the paths:
and fixing missing include in generated app_x-cube-ai.c file
C:/Users/tuoma/STM32Cube/helium_test/CORTEX_HELIUM/Appli/Src/app_x-cube-ai.c:50:1: warning: return type defaults to 'int' [-Wimplicit-int]
50 | LL_ATON_DECLARE_NAMED_NN_INSTANCE_AND_INTERFACE()
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/tuoma/STM32Cube/helium_test/CORTEX_HELIUM/Appli/Src/app_x-cube-ai.c: In function 'LL_ATON_DECLARE_NAMED_NN_INSTANCE_AND_INTERFACE':
C:/Users/tuoma/STM32Cube/helium_test/CORTEX_HELIUM/Appli/Src/app_x-cube-ai.c:55:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
55 | {
| ^
The issue is that LL_ATON_DECLARE_NAMED_NN_INSTANCE_AND_INTERFACE is not found, but after adding
Here is the X-CUBE-AI Application config:
The model is from here https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/audio_event_detection/yamnet/README.md
Thanks!
2026-01-26 6:09 AM
Hello @Tuomas95
Could you please add your ioc in order to investigate the issue?
KR, Souhaib
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.
2026-01-28 7:23 AM - edited 2026-01-28 8:30 AM
Hello @Tuomas95
In the Software pack Selector, it is mentioned that the External Memory Loader does not support Software pack, How did you enable the X-CUBE-AI ExtMemLoader?
Otherwise, let's try disable and re-enable X-Cube-AI and check please. Or can you try delete .stm32cubemx folder under \Users\<username> and check if the issue persists?
BR, Souhaib
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.
2026-01-28 9:10 AM
Hello @Souhaib MAZHOUD ,
I'm not sure how it got enabled, i did not enable it with intention to do so at least. Now i cannot disable it from MX.
I removed everything related to X-CUBE-AI_ExtMemLoader from the .ioc file, but the generation still gets stuck to "Saving project settings...", even after deleting the .stm32cubemx folder under \Users\<username>.
I can see that a TMPAILIB folder is created under the working directory, i assume it should be deleted after the generation?
BR, Tuomas
2026-01-30 8:50 AM
Hello @Tuomas95
Thanks for your feedback ,
The issue has been reported to the dedicated team for internal investigation and resolution. (Ticket 226216 This is an internal tracking number and is not accessible or usable by customers.)
BR, Souhaib
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.