TensorFlow Lite is not building on the nRF5340 DK.

Dear Technical Support Team,

I am trying to integrate and run TensorFlow Lite Micro on the nRF5340 Development Kit using the nRF Connect SDK. I have tested both SDK version 2.6.0 and 2.7.0, but the same issues persist in both. A recurring error I encounter is: CONFIG_TENSORFLOW_LITE_MICRO was assigned the value y, but got the value n. Missing dependencies: 0. Even though I explicitly set CONFIG_TENSORFLOW_LITE_MICRO=y in my prj.conf, it is still not enabled due to unresolved dependencies. Additionally, I receive other build errors such as fatal error: flatbuffers/flatbuffers.h: No such file or directory. I have manually placed the tflite-micro sources under modules/lib, but the build system still fails to recognize the required headers and link dependencies correctly. Even the official tensorflow_lite_micro example does not compile successfully on the nRF5340 DK. It seems that some dependencies are either broken or missing in the current integration, or the setup steps are not clearly documented. I would appreciate it if you could provide a working example or updated guidance on how to properly set up TensorFlow Lite Micro on the nRF5340 DK using the latest nRF Connect SDK.

console output:


C:/nordic/myApps/hello_world_9/src/main_functions.cpp:73: undefined reference to `tflite::MicroInterpreter::input(unsigned int)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:74: undefined reference to `tflite::MicroInterpreter::output(unsigned int)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:78: undefined reference to `tflite::MicroInterpreter::~MicroInterpreter()'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:78: undefined reference to `tflite::ParseFullyConnected(tflite::Operator const*, tflite::ErrorReporter*, tflite::BuiltinDataAllocator*, void**)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:48: undefined reference to `MicroPrintf(char const*, ...)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:68: undefined reference to `MicroPrintf(char const*, ...)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main_functions.cpp.obj): in function `loop':
C:/nordic/myApps/hello_world_9/src/main_functions.cpp:98: undefined reference to `tflite::MicroInterpreter::Invoke()'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/nordic/myApps/hello_world_9/src/main_functions.cpp:100: undefined reference to `MicroPrintf(char const*, ...)'
c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(output_handler.cpp.obj): in function `HandleOutput(float, float)':
C:/nordic/myApps/hello_world_9/src/output_handler.cpp:22: undefined reference to `MicroPrintf(char const*, ...)'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\ce3b5ff664\opt\bin\cmake.EXE' --build 'c:\nordic\myApps\hello_world_9\build'

Best regards,
yusuf üveyik

Related