2025-04-03 11:51 PM - last edited on 2025-04-04 1:19 AM by Andrew Neil
Hello everyone,
I am currently testing STEdgeAI on the STM32N6570-DK and encountered an issue when running the following command:
stedgeai generate -m test_model/mobilenet_v2_0.35_224_fft_int8.tflite --target stm32n6 --st-neural-art
While the network_generate_report.txt is generated, the terminal prints an error message:
>>> Shell execution has FAILED (returned code = 1)
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m55 -mtune=cortex-m55 -mfloat-abi=hard -Wall -Wextra -Wundef -Wstrict-prototypes -g3 -gdwarf-3 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -falign-functions=16 -Os -DUSE_FULL_LL_DRIVER -DLL_ATON_PLATFORM=LL_ATON_PLAT_SWEMUL -DLL_ATON_OSAL=LL_ATON_OSAL_BARE_METAL -DLL_ATON_RT_MODE=LL_ATON_RT_POLLING -DLL_ATON_SW_FALLBACK -I /usr/local/STMicroelectronics/STEdgeAI/2.0/Utilities/linux/st_ai_output -I /usr/local/STMicroelectronics/STEdgeAI/2.0/Middlewares/ST/AI/Inc -I /usr/local/STMicroelectronics/STEdgeAI/2.0/Middlewares/ST/AI/Npu/ll_aton -I /usr/local/STMicroelectronics/STEdgeAI/2.0/Middlewares/ST/AI/Npu/Devices/STM32N6XX -c /usr/local/STMicroelectronics/STEdgeAI/2.0/Utilities/linux/st_ai_output/network.c
arm-none-eabi-gcc: error: unrecognized -mcpu target: cortex-m55
arm-none-eabi-gcc: note: valid arguments are: arm8 arm810 strongarm strongarm110 fa526 fa626 arm7tdmi arm7tdmi-s arm710t arm720t arm740t arm9 arm9tdmi arm920t arm920 arm922t arm940t ep9312 arm10tdmi arm1020t arm9e arm946e-s arm966e-s arm968e-s arm10e arm1020e arm1022e xscale iwmmxt iwmmxt2 fa606te fa626te fmp626 fa726te arm926ej-s arm1026ej-s arm1136j-s arm1136jf-s arm1176jz-s arm1176jzf-s mpcorenovfp mpcore arm1156t2-s arm1156t2f-s cortex-m1 cortex-m0 cortex-m0plus cortex-m1.small-multiply cortex-m0.small-multiply cortex-m0plus.small-multiply generic-armv7-a cortex-a5 cortex-a7 cortex-a8 cortex-a9 cortex-a12 cortex-a15 cortex-a17 cortex-r4 cortex-r4f cortex-r5 cortex-r7 cortex-r8 cortex-m7 cortex-m4 cortex-m3 marvell-pj4 cortex-a15.cortex-a7 cortex-a17.cortex-a7 cortex-a32 cortex-a35 cortex-a53 cortex-a57 cortex-a72 cortex-a73 exynos-m1 xgene1 cortex-a57.cortex-a53 cortex-a72.cortex-a53 cortex-a73.cortex-a35 cortex-a73.cortex-a53 cortex-a55 cortex-a75 cortex-a76 neoverse-n1 cortex-a75.cortex-a55 cortex-a76.cortex-a55 cortex-m23 cortex-m33 cortex-r52; did you mean 'cortex-a55'?
arm-none-eabi-gcc: error: missing argument to '-march='
<<<
It seems that cortex-m55 is not recognized as a valid -mpcu argument by arm-none-eabi-gcc.
To check my toolchain, I ran:
arm-none-eabi-gcc --version
and the output is :
arm-none-eabi-gcc (GNU Tools for STM32 13.3.rel1.20240926-1715) 13.3.1 20240614
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Has anyone encountered this issue before?
Could it be a version incompatibility with the toolchain, or am I missing a configuration step?
Any guidance would be greatly appreciated!
Thanks in advance!
2025-04-10 5:55 AM - edited 2025-04-10 5:56 AM
Hi @Julian E.
I managed to Validate on Target the resnet_v1_8_32_tfs_int8.tflite from ST Model zoo.
Now i have a custom f32 resnet8 onnx model (not quantized) and when i run the command
./stedgeai.exe generate --target stm32n6 --type onnx --name network -m C:/MyData/MyWork/ST/upat_model/resnet8_opt.onnx --classifier --st-neural-art n6-noextmem@C:/ST/STEdgeAI/2.0/scripts/N6_scripts/user_neuralart.json --workspace C:/MyData/st_output/workspace --output C:/MyData/st_output/model_output --valoutput C:/MyData/test/m_outputs_1_upat.npy --mode target --valinput C:/MyData/test/m_inputs_1_upat.npy --desc serial:921600
The outputs gives the warnings:
ST Edge AI Core v2.0.0-20049
WARNING: _conv1_Conv_output_0 is not quantized
WARNING: _Relu_output_0 is not quantized
WARNING: _layer1_layer1_0_conv1_Conv_output_0 is not quantized
WARNING: _layer1_layer1_0_Relu_output_0 is not quantized
WARNING: _layer1_layer1_0_conv2_Conv_output_0 is not quantized
WARNING: _layer1_layer1_0_Add_output_0 is not quantized
WARNING: _layer1_layer1_0_Relu_1_output_0 is not quantized
WARNING: _layer2_layer2_0_conv1_Conv_output_0 is not quantized
WARNING: _layer2_layer2_0_Relu_output_0 is not quantized
WARNING: _layer2_layer2_0_conv2_Conv_output_0 is not quantized
WARNING: _layer2_layer2_0_shortcut_shortcut_0_Conv_output_0 is not quantized
WARNING: _layer2_layer2_0_Add_output_0 is not quantized
WARNING: _layer2_layer2_0_Relu_1_output_0 is not quantized
WARNING: _layer3_layer3_0_conv1_Conv_output_0 is not quantized
WARNING: _layer3_layer3_0_Relu_output_0 is not quantized
WARNING: _layer3_layer3_0_conv2_Conv_output_0 is not quantized
WARNING: _layer3_layer3_0_shortcut_shortcut_0_Conv_output_0 is not quantized
WARNING: _layer3_layer3_0_Add_output_0 is not quantized
WARNING: _layer3_layer3_0_Relu_1_output_0 is not quantized
WARNING: _avgpool_AveragePool_output_0 is not quantized
WARNING: _Reshape_output_0 is not quantized
WARNING: output is not quantized.
As far as I understand the tool didnt succeed to quantize the .onnx model. Why?
Thanks in advance
2025-04-10 6:12 AM
Hello @diama13 ,
Doing a generate only generate your C code model; it does not quantize it.
While using a f32 model with the N6, you get warnings because it won't be able to use the NPU as it only works with int8.
In your case you need to quantize it first then do a generate.
You can upload your model to the ST Dev cloud up to the quantize step, quantize and download it then do a generate
Home - ST Edge AI Developer Cloud
Have a good day,
Julian
2025-04-11 4:16 AM
Hi @Julian E.
I used a custom resnet8 quantized model and succeed to validate on target.
The accuracy report for both the inference and the generated C-target models were approximately 90%.
Now I generate the code through Cube MX but when i build the project in Cube IDE the build fails as you can see :
Could you please help me?
2025-04-11 7:41 AM
Hello @diama13,
When activating X Cube AI, please select the application template, not validation.
I think it should solve your issue.
Have a good day;
Julian