Error building the sample esp-idf project

Question/Issue:
I am trying to build on edp-idf, based on the example here:

But it is always giving me errors similar to this:

/var/folders/n3/35y73h5x2ydfgn0r5dx9ycpm0000gn/T//ccNP94sN.s: Assembler messages:
/var/folders/n3/35y73h5x2ydfgn0r5dx9ycpm0000gn/T//ccNP94sN.s:11: Error: file not found: tflite-model/tflite_learn_815924_6.tflite

I tried cleaning via idf.py fullclean, deleting etc, nothing works.

Project ID:
815924

Context/Use case:
Building on mac, via edp-idf 5.5, python 3.12

Summary:

Steps to Reproduce:

  1. Clone the example repo: GitHub - edgeimpulse/example-standalone-inferencing-espressif-esp32: Builds and runs an exported impulse locally (ESP IDF)
  2. Download the classification mode, c++ build, copy only 3 directories to the root of the project
  3. idf.py build

Expected Results:
Builds without any errors

Actual Results:

/var/folders/n3/35y73h5x2ydfgn0r5dx9ycpm0000gn/T//ccNP94sN.s: Assembler messages:
/var/folders/n3/35y73h5x2ydfgn0r5dx9ycpm0000gn/T//ccNP94sN.s:11: Error: file not found: tflite-model/tflite_learn_815924_6.tflite

Reproducibility:

  • [ x ] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: ESP32
  • Build Environment Details: esp-idf 5.5
  • OS Version: macos 26
  • Edge Impulse Version (Firmware): -
    To find out Edge Impulse Version:
  • if you have pre-compiled firmware: run edge-impulse-run-impulse --raw and type AT+INFO. Look for Edge Impulse version in the output.
  • if you have a library deployment: inside the unarchived deployment, open model-parameters/model_metadata.h and look for EI_STUDIO_VERSION_MAJOR, EI_STUDIO_VERSION_MINOR, EI_STUDIO_VERSION_PATCH
  • Edge Impulse CLI Version: -
  • Project Version:
  • Custom Blocks / Impulse Configuration: [Describe custom blocks used or impulse configuration]
    Logs/Attachments:
    [Include any logs or screenshots that may help in diagnosing the issue]

Logs/Attachments:
[Include any logs or screenshots that may help in diagnosing the issue]

Additional Information:
[Any other information that might be relevant to the issue]

Hi, @mahdi_perfect !
It’s hard to see what is going wrong exactly from this data, but it looks like there are issues with either your ESP IDF installation or the way you have copied files to the project folder. Perhaps you can paster more of the build log? Even better complete output, from idf.py fullclean && idf.py build.

Sure. For reproducing (Although it wasn’t my initial setup), I found it easy to just use Docker to get the exact same error:

# Download the "C++ library", "TensorFlow Lite", "Quantized 8-bit" version. Mine is downloaded to ~/Downloads/myprject-cpp-mcu-v7.zip
git clone git@github.com:edgeimpulse/example-standalone-inferencing-espressif-esp32.git
cd example-standalone-inferencing-espressif-esp32
unzip ~/Downloads/myprject-cpp-mcu-v7.zip -d myprject-cpp-mcu-v7
mv myprject-cpp-mcu-v7/edge-impulse-sdk .
mv myprject-cpp-mcu-v7/tflite-model .
mv myprject-cpp-mcu-v7/model-parameters .
rm -r myprject-cpp-mcu-v7
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v5.5 /bin/bash -c "idf.py set-target esp32s3 && idf.py build"

Rest of the logs is actually a bunch of warnings/info, not sure how I can share it here…

Oh, wait a minute… It seems like adding this line to the main/CMakeLists.txt fixed the error :blush:


file(COPY ${CMAKE_CURRENT_LIST_DIR}/../tflite-model
        DESTINATION ${CMAKE_CURRENT_BINARY_DIR})


Right before idf_component_register(... line.