2025-07-22 3:17 AM
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.
Also, there were so many undefined references. In theory, problems like this should not occur when using X-CUBE-AI.
I'm so confused and I would be grateful if somebody could help me out!
2025-07-22 3:34 AM
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.