cancel
Showing results for 
Search instead for 
Did you mean: 

AzureRTOS with X-Cube-AI 7.1.0 connectivity missing header file

JTedot
Associate II

Compiling generated code in the CubeIDE 1.7.0 with AzureRTOS enabled under tab "Middleware" and a neural network enabled under tab "Software Packs" on an STM32U5 nucleo board exits with error message:

../AZURE_RTOS/App/app_azure_rtos.c:24:10: fatal error: app_x-cube-ai.h: No such file or directory

No file `app_x-cube-ai.h` exists within my project, i suspect that a renaming between versions might be the cause of this issue. Sadly, i can't know the contents of the missing file, since i can't find information about it anywhere. Has it been renamed to something else or has the dependency moved?

EDIT:

Seems that the file should be generated in `project/Inc/`, as seen here on page 42. Which is not happening in my case.

Additionally, code generation generates a line

if (MX_X-CUBE-AI_Init(memory_ptr) != TX_SUCCESS)
    {
      /* USER CODE BEGIN  MX_X-CUBE-AI_Init_Error */
 
      /* USER CODE END  MX_X-CUBE-AI_Init_Error */
    }

which is not valid syntax in the function name, as it contains a "-" sign twice and gives me all sorts of funny errors like

'MX_X' undeclared (first use in this function)
'CUBE' undeclared (first use in this function)

3 REPLIES 3
fauvarque.daniel
ST Employee

In order to have the app_x-cube-ai.h and app_x-cube-ai.c files generated you have to select in STM32CubeMX one appliction (Template, Validation or System Performance)

That said the generated code for the app_azure_rtos.c is wrong (I'll report the bug to the STM32CubeMX team) it should be a simple call to

MX_X_CUBE_AI_Init();

The prototype of the function is

void MX_X_CUBE_AI_Init(void);

Regards


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.

Thank you for your reply.

It didn't occur to me that a pre-made application had to be built for the AI framework to properly generate code, since a few embedded AI tests that i conducted in the past didn't need them and ran without a problem (however, these were without the use of an RTOS)

fauvarque.daniel
ST Employee

You're right it is not mandatory but you need at least to select Template for those files to be generated and for the call to the init and process functions to be added in the main (in case of no RTOS) or in the RTOS file.

Also, from what I can see the AI process function is not called, I guess because you need to create a special Azure thread to call it.

There is still a bug in the generated azure file


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.