cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR DURING VALIDATION ON TARGET ON XcubeAI

Luca4
Associate II

Goodmorning, 

I have a problem with the validation on target of a CNN network on XcubeAI.

I tried to validate the networks on desktop, and it runs, but, when I try to validate on target it gives me that error, I ask you if someone has a solution or something else to try to fix this problem.

I'm using version 1.15.1 of STMCUBEIDE and v. 9.0.0 of cube AI

the board I try to validate is UFBGA144. 

Building project 
Generating project 
Temporary project loaded 
Temporary AI configuration done 
Generating temporary project code 
Building project 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c -o Debug/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.o 
C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard  -DDEBUG -DUSE_HAL_DRIVER -DSTM32L4R9xx  -IDrivers/CMSIS/Device/ST/STM32L4xx/Include -IDrivers/CMSIS/Include -IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy -IDrivers/STM32L4xx_HAL_Driver/Inc -IInc -O3  -Wall -fdata-sections -ffunction-sections Src/app_x-cube-ai.c -o Debug/Src/app_x-cube-ai.o 
In file included from Src/app_x-cube-ai.c:37: 
Inc/app_x-cube-ai.h:28:8: error: unknown type name 'ai_i8' 
   28 | extern ai_i8* data_ins[]; 
      |        ^~~~~ 
Inc/app_x-cube-ai.h:29:8: error: unknown type name 'ai_i8' 
   29 | extern ai_i8* data_outs[]; 
      |        ^~~~~ 
Inc/app_x-cube-ai.h:31:8: error: unknown type name 'ai_handle' 
   31 | extern ai_handle data_activations0[]; 
      |        ^~~~~~~~~ 
make: *** [Makefile:61: Debug/Src/app_x-cube-ai.o] Error 1 
Automatic build and run failed

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Luca4 

When doing validation on target, you have two solutions:

- Let X-CUBE-AI generate a project on its own in order to validate

- Flash it yourself on target

 

On these two cases, it will use STM32CubeProgrammer to flash both internal and external Flash.

However, based on your current board, it looks like it does not embed External Flash. As highlighted by @fauvarque.daniel you are short in internal flash. You could quantize your model to reduce memory footprint or select a ST board with external flash (ex: Discovery Kit STM32L4R9I-DISCO)

 

To enable External Flash on your target, please follow this documentation starting from page 21:

- https://www.st.com/resource/en/user_manual/dm00570145-getting-started-with-x-cube-ai-expansion-package-for-artificial-intelligence-ai-stmicroelectronics.pdf

 

You can perform benchmarks using https://stedgeai-dc.st.com in order to see inference time on multiple targets, and with your model automatically fitted in external flash/ram 

 

Best regards,

Yanis


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.

View solution in original post

6 REPLIES 6
fauvarque.daniel
ST Employee

I recommend using STM32CubeMX outside of STM32CubeIDE. I've seen sometime errors with automatic validation on the target with the integrated MX inside STM32CubeIDE, the project is not always generated correctly.

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.

Good evening,

I tried to validate the project also with STM32CubeMX (last version) but I found the same error during the validation on target (as in photo).

I share also the link to take views of the network:

https://drive.google.com/file/d/1nyhqqx__dSITxwM6UkXgGykBv-6hhqGK/view?usp=sharing

Thank you for your availability, waiting your response, greetings.

Luca4_0-1721926926956.png

 

 

Your model requires 1.97MB of Flash and on this device there is 2MB available.

We consider that we need at least 30K for the program so you are probably just over the limit.

You have this message because during the analysis we report an error that the model won't fit on the target

Your model is a float model, using quantization you'll be able to make it fit on the target

By the way, on the developer cloud you can run your model on boards with more flash internally or externally

https://stedgeai-dc.st.com/

Regards

Daniel


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

Good morning,

First of all thanks for the reply;

I take the opportunity to ask you about the external flash: do I have to program the external flash with the STM cube programmer, in order to use it to try to validate on target?

If so, is there any documentation that tells me how to do it?

Thank you for your availability, waiting your response, greetings.

 

Hello @Luca4 

When doing validation on target, you have two solutions:

- Let X-CUBE-AI generate a project on its own in order to validate

- Flash it yourself on target

 

On these two cases, it will use STM32CubeProgrammer to flash both internal and external Flash.

However, based on your current board, it looks like it does not embed External Flash. As highlighted by @fauvarque.daniel you are short in internal flash. You could quantize your model to reduce memory footprint or select a ST board with external flash (ex: Discovery Kit STM32L4R9I-DISCO)

 

To enable External Flash on your target, please follow this documentation starting from page 21:

- https://www.st.com/resource/en/user_manual/dm00570145-getting-started-with-x-cube-ai-expansion-package-for-artificial-intelligence-ai-stmicroelectronics.pdf

 

You can perform benchmarks using https://stedgeai-dc.st.com in order to see inference time on multiple targets, and with your model automatically fitted in external flash/ram 

 

Best regards,

Yanis


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.

Good afternoon,

thanks for the reply, I saw in my card (the steval-stwinkt1b) there is the possibility of adding the SD card.

I ask you, if possible, to let me know if I can use this SD card as an external flash, and how I can do it in the cube programmer.

Thanks again for your availability, best regards,

LUCA