cancel
Showing results for 
Search instead for 
Did you mean: 

ST Edge AI on STM32N6570-DK: Compilation Error (Unrecognized target)

diama13
Associate II

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!




9 REPLIES 9
Julian E.
ST Employee

Hello @diama13,

 

Thank you for posting the error.

 

First, this error is not critical, if you don't have any issue in your model, the generate will work.

 

Then, what's strange is that I have an older version than you and I don't get this error.

My version:  arm-none-eabi-gcc.exe (GNU Tools for STM32 12.3.rel1.20240926-1715) 12.3.1 20230626

 

We are looking at it internally, I'll let you know when we know more.

 

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

Hi Julian,

I have continued with the testing, but indeed I would like to understand more about what the earlier error really means.

Now, I ran the following command:

stedgeai validate -m test_model/mobilenet_v2_0.35_224_fft_int8.tflite --mode target --target stm32n6 --st-neural-art


The terminal output shows in the end:

 

Running the TFlite model...
PASS: 91%|███████████████████████████████████████████████████▏ | 149/163 [00:07<00:00, 17.86it/s]INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Running the ST.AI c-model (AI RUNNER)...(name=network, mode=TARGET)
INTERNAL ERROR: E801(HwIOError): Invalid firmware - /dev/ttyACM0:115200

 

I’m not sure what the problem is. I’ve been trying all day yesterday to install all the prerequisites for the board, and still, the same issue arises.

Any suggestions on what might be causing this?

Thanks again for your help!




@diama13 ,

 

In this case, I think you get this error because the DK board uses a baudrate of 921600.

You should run a validate with one more argumnent like:

 

stedgeai validate -m mobilenet_v2_0.35_224_fft_int8.tflite --target stm32n6 --mode target -d serial:921600

 

Please follow the steps to validate a model as described here:

https://stedgeai-dc.st.com/assets/embedded-docs/stneuralart_getting_started.html

 

The steps are to:

  1. Generate your model with stedgeai generate
  2. Build and load a validation firmware with the n6_loader.py script (or X Cube AI)
  3. run the validate command

 

Let me know if it solved this issue or if it is something else :)

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.

@Julian E. 

Even if I add the argument related with the baud rate the same error arises.

Julian E.
ST Employee

@diama13 

In the documentation I linked, 3 steps are described:

  1. Generate your model with stedgeai generate
  2. Build and load a validation firmware with the n6_loader.py script (or X Cube AI)
  3. run the validate command

 

I think you did not do the second one.

 

You can follow the document and do it with the n6_loader.py or do it in CubeMX.

To do it in CubeMX:

  1. Select the board
  2. Activate X Cube AI
  3. Select the validation template

JulianE_0-1743767196849.png

  1. Import your model
  2. Click validate on target
  3. Set the baudrate to 921600
  4. Enable the automatic compilation and select STM32CubeIDE

JulianE_1-1743767272586.png

Make sure to set the boot pin of the DK board to the right before plugging it with a usbC to usbC cable

 

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.

@Julian E. 

I think that most of my issues are related with the installation of the tools in linux. The rights, the paths and all this stuff. Is that possible?

Hello @diama13 ,

 

For the rights, yes, I am pretty sure that it is due to linux. For the rest, maybe.

Did you not succeed in doing a validate?

 

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.

Hello @Julian E. 

 

I installed all the tools on a Windows PC, and I followed your instructions for the mobilenet_v2_0.35_224_fft_int8.tflite model. The Analyze and Validate on Target using STM32CubeMX with X-CUBE-AI were successful.

Now, I'm trying to do the same for a custom pretrained ResNet8 model (using the CIFAR-10 dataset). The Analyze step also succeeds, but when I try to perform Validation on desktop, I would like to validate it using int8 values (since the model is quantized to int8). Is this possible?

Thanks in advance




@diama13 ,

 

I don't know if X Cube AI is doing automatically or not, but yes you can test your model with int8 values.

To do so you can add the following argument to the validate:  --input-data-type float32|int8|uint8 (int8 only in your case).

 

If you do it with the CLI it is straightforward.

If you use X Cube AI, you can click the options and add the argument here:

JulianE_0-1744033035695.png

 

You can also import your own testing data as a npy file containing the test data and labels.

To do so, click browse on the X Cube AI interface:

JulianE_1-1744033165900.png

 

Example of code that generate random npy:

from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy as np

test_data_gen = ImageDataGenerator(rescale=1. / 255)
test_generator = test_data_gen.flow_from_directory('./test',
                                                   target_size=(224, 224),
                                                   batch_size=nb_test_files,
                                                   class_mode='categorical')
test_data = next(test_generator)
x_test, y_test = test_data


# or to have a simple file
np.savez("mydata.npz",x_test=x_test,y_test=y_test)

 

You can test with and without the argument to see if it makes a difference.

 

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.