Skip to main content
Associate II
September 28, 2025
Solved

[Bug?] Undefined reference errors in TUTO_N6_MINIMAL_AI example (missing implementation of forward_xxx functions)

  • September 28, 2025
  • 2 replies
  • 414 views

Hello,

I am following this tutorial:
https://community.st.com/t5/stm32-mcus/how-to-build-an-ai-application-from-scratch-on-the-nucleo-n657x0/ta-p/828502

After completing step 4.3 Build, I encountered linker errors when compiling the TUTO_N6_MINIMAL_AI_Appli project.

Here is part of the build log:

./Middlewares/ST/AI/Npu/ll_aton/ll_sw_integer.o: in function `ll_sw_forward_dequantizelinear':
... undefined reference to `node_convert'
./Middlewares/ST/AI/Npu/ll_aton/ll_sw_integer.o: in function `ll_sw_forward_softmax_integer':
... undefined reference to `forward_sm_integer'
./Middlewares/ST/AI/Npu/ll_aton/ll_sw_integer.o: in function `ll_sw_forward_resize_integer':
... undefined reference to `forward_resize_nearest_is8os8'
... undefined reference to `forward_resize_bilinear_is8os8'
... undefined reference to `forward_upsample_zeros'

My environment:

  • STM32CubeIDE 1.19.0

  • CubeMX 6.15.0

  • X-CUBE-AI package (latest, bundled with CubeMX)

  • Board: NUCLEO-N657X0

  • Example: TUTO_N6_MINIMAL_AI (as in tutorial)

Question:
Is this a known bug in the latest CubeMX/X-CUBE-AI release?
Should there be additional source files or libraries providing the implementations of these forward_* functions?

Any guidance would be appreciated.

Thanks!



Best answer by BCPH357

I found a solution myself, sharing here as a note for others who might face the same issue:

The problem is that in CubeMX 6.15.0, the generated project does not automatically include the AI Runtime .a library (static archive) as before, which causes linker errors (undefined symbols).

Solution:

  1. Locate the AI Runtime .a file in your project. For example:

     
    Middlewares/ST/AI/Lib/NetworkRuntime1020_CM55_GCC.a
  2. In CubeIDE, go to:
    Project → Properties → C/C++ Build → Settings → MCU GCC Linker → Libraries

  3. Under Libraries (-l), add the library name (for example:

     
    :NetworkRuntime1020_CM55_GCC.a

    )
    Then under Library search path (-L), add the folder path where the .a file is located, for example:

     
    ${ProjDirPath}/Middlewares/ST/AI/Lib
  4. Save the settings and rebuild. The linker will now correctly include the AI Runtime library.

This solved the missing AI Runtime symbol errors in my case.

2 replies

September 28, 2025

Hey, I ran into a similar issue before — those “undefined reference” errors usually mean the linker isn’t including the necessary libraries or object files. Here are a few checks you can try:

 

Verify that all required .o or .a files are being compiled and linked. Sometimes the build script skips some files.

 

Check the Makefile or build configuration to ensure the paths to the AI library and its dependencies are correctly set.

 

If you’re using a library (e.g. TensorFlow Lite or ST’s AI stack), make sure the header and compiled library versions match (architecture, toolchain).

 

Clean the build (remove build/, obj/ directories) and recompile — stale object files often cause these references to persist.

 

Also inspect the build logs: sometimes the order of linker flags matters (put your AI library flags after your object files).

BCPH357Author
Associate II
September 28, 2025

Thanks for the tips! 

I tried a full clean/rebuild and also checked the Makefile — all the AI-related object files under Middlewares/ST/AI/Npu/ll_aton/ are being compiled and linked.

The issue seems different though:

  • The functions (e.g. forward_resize_nearest_is8os8) are declared in the headers generated by CubeMX,

  • but there are no definitions of these functions in any of the generated .c files or libraries.

So the linker errors look like they come from missing implementations in the generated code itself, rather than a missing library path or build flag.

That’s why I’m wondering if this might be a bug or an incomplete codegen in the current CubeMX/X-CUBE-AI release.

BCPH357AuthorBest answer
Associate II
September 30, 2025

I found a solution myself, sharing here as a note for others who might face the same issue:

The problem is that in CubeMX 6.15.0, the generated project does not automatically include the AI Runtime .a library (static archive) as before, which causes linker errors (undefined symbols).

Solution:

  1. Locate the AI Runtime .a file in your project. For example:

     
    Middlewares/ST/AI/Lib/NetworkRuntime1020_CM55_GCC.a
  2. In CubeIDE, go to:
    Project → Properties → C/C++ Build → Settings → MCU GCC Linker → Libraries

  3. Under Libraries (-l), add the library name (for example:

     
    :NetworkRuntime1020_CM55_GCC.a

    )
    Then under Library search path (-L), add the folder path where the .a file is located, for example:

     
    ${ProjDirPath}/Middlewares/ST/AI/Lib
  4. Save the settings and rebuild. The linker will now correctly include the AI Runtime library.

This solved the missing AI Runtime symbol errors in my case.