cancel
Showing results for 
Search instead for 
Did you mean: 

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

Levy-hy
Visitor

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 REPLY 1
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.