cancel
Showing results for 
Search instead for 
Did you mean: 

LSTM LiteRT Model Deployment Missing Function in Linker

RCM8
Associate

Hi there,

I am trying to deploy a quantized LiteRT (TF Lite) stateless LSTM model to a Nucelo-H723 using CubeMX, X-Cube-AI, and CubeIDE. 

However, when I go to compile the generated code in CubeIDE, I get the following linker errors (full console output at bottom of this post) related to undefined references to arm_vector_sum_s8, arm_nn_vec_mat_mul_result_acc_s8_s16, and arm_nn_activation_s16 from the NetworkRuntime1020_CM7_GCC.a static library.

 

Any suggestions on what the fix might be? 

 

Additional configuration information:

We configure CubeAI inside of CubeMX to flash the system performance variant, and can load and analyze our LSTM model within the Cube-AI window in CubeMX with no issues.

We also configure the H7 to use icache, dcache, CRC. We've been able to run other models (MLP) with no issues.

Console Error:

C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o): in function `forward_lite_lstm_is8os8ws8':
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x21c): undefined reference to `arm_vector_sum_s8'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x21c): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x236): undefined reference to `arm_vector_sum_s8'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x236): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x24a): undefined reference to `arm_vector_sum_s8'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x24a): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x25e): undefined reference to `arm_vector_sum_s8'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x25e): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x272): undefined reference to `arm_vector_sum_s8'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x272): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o):forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x284): more undefined references to `arm_vector_sum_s8' follow
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o): in function `forward_lite_lstm_is8os8ws8':
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x284): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x296): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_vector_sum_s8): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(forward_lite_lstm_is8os8ws8.o)
forward_lite_lstm_is8os8ws8.c:(.text.forward_lite_lstm_is8os8ws8+0x2a8): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(arm_nn_lstm_calculate_gate_s8_s16.o): in function `arm_nn_lstm_calculate_gate_s8_s16':
arm_nn_lstm_calculate_gate_s8_s16.c:(.text.arm_nn_lstm_calculate_gate_s8_s16+0x46): undefined reference to `arm_nn_vec_mat_mul_result_acc_s8_s16'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_nn_vec_mat_mul_result_acc_s8_s16): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(arm_nn_lstm_calculate_gate_s8_s16.o)
arm_nn_lstm_calculate_gate_s8_s16.c:(.text.arm_nn_lstm_calculate_gate_s8_s16+0x46): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: arm_nn_lstm_calculate_gate_s8_s16.c:(.text.arm_nn_lstm_calculate_gate_s8_s16+0x6a): undefined reference to `arm_nn_vec_mat_mul_result_acc_s8_s16'
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: (arm_nn_vec_mat_mul_result_acc_s8_s16): Unknown destination type (ARM/Thumb) in ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(arm_nn_lstm_calculate_gate_s8_s16.o)
arm_nn_lstm_calculate_gate_s8_s16.c:(.text.arm_nn_lstm_calculate_gate_s8_s16+0x6a): dangerous relocation: unsupported relocation
C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.14.3.rel1.win32_1.0.100.202602081740/tools/bin/../lib/gcc/arm-none-eabi/14.3.1/../../../../arm-none-eabi/bin/ld.exe: ../Middlewares/ST/AI/Lib\NetworkRuntime1020_CM7_GCC.a(arm_nn_activation_s16.o): in function `arm_nn_activation_s16':
arm_nn_activation_s16.c:(.text.arm_nn_activation_s16+0x10c): undefined reference to `sigmoid_table_uint16'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:66: STMaitest.elf] Error 1
"make -j22 all" terminated with exit code 2. Build might be incomplete.

 

1 REPLY 1
RCM8
Associate

We were able to avoid the issue by feeding a .h5 keras model into X-Cube-AI directly instead of using the LiteRT quantized model. However, the model size is far larger indicating that it's not being quantized (221KB flash LiteRT, 800KB k5), so not ideal.