cancel
Showing results for 
Search instead for 
Did you mean: 

Linker garbage problem when deploying AI models on the STM32N6 development board

Levy-hy
Associate II

I'm trying to deploy my own simple AI model (Handwritten digit recognition) on my STM32N6570-DK board. I have already finished this project on STMF407 discovery board using Keil MDK. However, linker garbage problem popped up and I don't know how to solve it.

First I created the project following the example below using STM32CubeIDE:
https://community.st.com/t5/stm32-mcus/how-to-create-an-stm32n6-fsbl-load-and-run/ta-p/768206 and the led worked properly. Then I imported the pre-trained onnx model to X-CUEB-AI and generated the code. 

Here two problem occurred:

1. The folder X-CUBE-AI appeared under the FSBL project, which doesn't have enough flash and RAM to support the model. I think it should belong to the Application project.

2. When I tried to build the project (and I didn't change any of the generated code), linker garbage problem occurred as shown below. For project of STM32F407 in Keil MDK, I solved the problem by changing the C language compilation mode. 

Levyhy_0-1753178214859.png

Also, there were so many undefined references. In theory, problems like this should not occur when using X-CUBE-AI.

Levyhy_1-1753178316917.png

I'm so confused and I would be grateful if somebody could help me out!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Levy-hy,

 

You can ignore the first image errors.

 

For the second one, it happens that the AI libraries are not correctly set in your project.

  1. Right click on the project you are trying to build
  2. Click import...
  3. File system should be default option on the window appearing, click next
  4. Browse for your project directory
  5. Go to middleware>NPU, then check the box ll_aton and device
  6. Click on filter type and select .c
    JulianE_0-1753343178089.png

     

  7. Click ok, Finish, rebuild the index if not done and build again.

 

I think this should help you

 

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.

View solution in original post

3 REPLIES 3
Ozone
Principal

This has nothing to do with "garbage collection".

Concentrate on the second image, which lists a lot of "undefined references".
There are functions you call, but which are not implemented anywhere.
Either you forgot a source file, a library, or got the wrong library.

You can use the command 'objdump -t <libname.a>' to view all the symbols a library exports.
The 'objdump' command must of course correspond to the target architecture.

Hello @Levy-hy,

 

You can ignore the first image errors.

 

For the second one, it happens that the AI libraries are not correctly set in your project.

  1. Right click on the project you are trying to build
  2. Click import...
  3. File system should be default option on the window appearing, click next
  4. Browse for your project directory
  5. Go to middleware>NPU, then check the box ll_aton and device
  6. Click on filter type and select .c
    JulianE_0-1753343178089.png

     

  7. Click ok, Finish, rebuild the index if not done and build again.

 

I think this should help you

 

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.

THX! I forgot to import the ll_aton library and now it works out.