2024-06-06 09:04 AM
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
Solved! Go to Solution.
2024-07-31 06:19 AM - edited 2024-07-31 06:21 AM
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:
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
2024-07-17 02:08 AM
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
2024-07-25 10:12 AM
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.
2024-07-26 01:45 AM - edited 2024-07-26 01:47 AM
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
Regards
Daniel
2024-07-31 05:38 AM
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.
2024-07-31 06:19 AM - edited 2024-07-31 06:21 AM
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:
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
2024-08-07 04:50 AM
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