Skip to content

Conversation

@001ProMax
Copy link

This PR optimizes the installation guide and fixes a critical issue for PlatformIO users. The changes include:

  1. Optimized PlatformIO Configuration:
    Provided a clear and concise configuration example for PlatformIO users, including necessary build_flags and lib_deps.
  2. Fixed Missing array.h Compilation Issue:
    Resolved the issue where array.h was missing during PlatformIO compilation by ensuring the correct include paths and dependencies are specified.

@github-actions github-actions bot changed the title Update Installation Guide: Add ESP-IDF Support Policy, Optimize PlatformIO Configuration, and Fix Missing array.h Compilation Issue Update Installation Guide: Add ESP-IDF Support Policy, Optimize PlatformIO Configuration, and Fix Missing array.h Compilation Issue (TFMIC-47) Jan 11, 2025
@vikramdattu
Copy link
Collaborator

@001ProMax thanks for the PR, let me try the steps and get back to you.
One comment: Ideally the array.h file should be automatically fetched with the code sync. Maybe the script here needs the fix too?

python3 tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py \

lib_deps =
https://github.com/espressif/esp-tflite-micro.git

; src_dir =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@001ProMax isn't src_dir a global option? Setting it under env just ignores it completely
You can instead create platformio.ini files for the examples, users can then directly run them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not using this approach right now. Just following the standard PlatformIO file structure.

@ShardulNalegave
Copy link
Contributor

Hey @001ProMax
Added a comment, please make the required changes.

@001ProMax
Copy link
Author

@001ProMax thanks for the PR, let me try the steps and get back to you. One comment: Ideally the array.h file should be automatically fetched with the code sync. Maybe the script here needs the fix too?

python3 tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py \

The array.h file can’t be automatically fetched in PlatformIO. Maybe this is related to the way PlatformIO handles library dependencies and syncing.

DantShanoff added a commit to DantShanoff/esp-tflite-micro that referenced this pull request Aug 25, 2025
@losper
Copy link

losper commented Sep 25, 2025

When will this PR be merged? Or, is there another way to automatically generate array.h in PlatformIO?

@@ -0,0 +1,123 @@
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @001ProMax is this file really needed here? Please remove it if not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is required for PlatformIO to work correctly, so it shouldn’t be removed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@001ProMax
Since our build is static, and rightly so, tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py script does not copy these files by itself.

  • I would suggest you to please check if this file include can be avoided.
  • If it is absolutely needed, I suggest you to modify the script esp-tflite-micro/scripts/sync_from_tflite_micro.sh
  • Copy this header from the tflite-micro clone right after it runs create_tflm_tree.py. This will make sure, it is copied with each sync. Do add a comment above the file copy that this is done so for a specific reason.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another problem I have with the file is it may conflict with the standard C++ header. But it may be okay, since we do not directly include this directory as direct path to compiler (Using -I)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants