cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to build the generated c code from developer zone in Cube IDE

VinaySankar
Associate II

I am Working with the board NUCLEO-N657X0-Q, I need to generate a c code of the Ai model Run in the Board, for that I generated a c code for the STM32N6570-DK to run in my board from St developer zone. Unfortunately i cant build the project file in CUBE IDE i cant figure out what is the problem. 

4 REPLIES 4
Julian E.
ST Employee

Hello @VinaySankar,

 

As you probably know, we have AI application examples for the DK board but not the Nucleo.

I would suggest you use the example application of the DK: STM32N6-AI - AI software ecosystem for STM32N6 with Neural-ART accelerator - STMicroelectronics

And the basic application example for the nucleo: STM32CubeN6 - STM32Cube MCU Package for STM32N6 series (HAL, CMSIS devices, and examples running on ST boards) - STMicroelectronics

(in STM32Cube_FW_N6_V1.1.0\Projects\NUCLEO-N657X0-Q)

 

There are currently bugs in X Cube AI for the Nucleo, the new version should drop around end of April

 

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.
VinaySankar
Associate II

Hi @Julian E. 

I am generating an AI model in C through CubeMX and Xcube AI. As I was having trouble generating only the model, So I converted it by selecting an example code. I chose the example code of GPIO LED, enabled Xcube AI, uploaded the models, and generated the project file. While building the project file in Cube IDE, I encountered errors. The errors are listed below.

ERRORS:

../Src/aiValidation_ATON.c:48:10: fatal error: ai_io_buffers.h: No such file or directory
make: *** [Src/subdir.mk:79: Src/aiValidation_ATON.o] Error 1
make: *** Waiting for unfinished jobs....
../Src/app_x-cube-ai.c:89:43: error: 'RIF_RISC_PERIPH_INDEX_NPU' undeclared (first use in this function)
../Src/app_x-cube-ai.c:89:70: error: 'RIF_ATTRIBUTE_PRIV' undeclared (first use in this function)
../Src/app_x-cube-ai.c:89:91: error: 'RIF_ATTRIBUTE_SEC' undeclared (first use in this function)
make: *** [Src/subdir.mk:79: Src/app_x-cube-ai.o] Error 1

SlothGrill
ST Employee

Hello @VinaySankar ,

I am not sure to understand your whole process for generating your final project that does not compile.

You say you use the example code of GPIO LED, but maybe a correct project to build would be a validation project for ai models.

Could you share your initial errors (from the message dated ‎2025-04-16 10:42 PM), this may be an easier way to start with.

Just in case you are interested, if you download STEdgeAI-Core - Artificial intelligence (AI) optimizer technology for STMicroelectronics products - STMicroelectronics, you can find extra "examples" and "documentation" related to ai (in particular, there is an "hello world" example that just does an inference, based on the "network.c" you generated.

 

If you want to fix your errors (which may be a bit more complex) The errors you have are related to the fact that:

  • ai_io_buffers.h is missing: this file is specific to the validation project (try to generate a validation project first to see what it looks like)

  • Missing macros related to RIF/RISAF (on some versions of MX, it seems that the HAL config file generated does not include rif-related includes, this is what causes the issue): manually change the hal_conf.h file and be sure it defines the HAL_RIF_MODULE_ENABLED macro + be sure to add hal-files related to that.
  • (the app_x-cube-ai.c tries to automatically open all the risaf that can be used during inference)

 

Let us know if it helps,

cheers.

 

 

Hi @Julian E. , @SlothGrill ,

As mentioned in the message 

#There are currently bugs in X Cube AI for the Nucleo, the new version should drop around end of April
Is the release out for use.

Thanks,

Vinay