cancel
Showing results for 
Search instead for 
Did you mean: 

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

BCPH357
Associate II

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!



1 ACCEPTED SOLUTION

Accepted Solutions
BCPH357
Associate II

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.

View solution in original post

2 REPLIES 2

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.

BCPH357
Associate II

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.