From 79598ee56717dba58b37757f7865ba692745abd6 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 6 Nov 2023 17:41:34 -0300 Subject: [PATCH 01/11] Update CMakeLists.txt Removes RainMaker and replaces "all" to get it working with WSL Ubuntu --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23c34b4d2..88cede199 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,11 +2,6 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(RMAKER_PATH ${CMAKE_SOURCE_DIR}/components/esp-rainmaker) -set(INSIGHTS_PATH ${RMAKER_PATH}/components/esp-insights) - -set(EXTRA_COMPONENT_DIRS ${INSIGHTS_PATH}/components ${RMAKER_PATH}/components) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(arduino-lib-builder) @@ -15,7 +10,7 @@ idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION) add_custom_command( OUTPUT "idf_libs" COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}" - DEPENDS all + DEPENDS ${elf} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} VERBATIM ) From 3a5b40cd85fda773b7df75350467ed461745c939 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 6 Nov 2023 17:52:51 -0300 Subject: [PATCH 02/11] Tool fix Moving SR files copy from tools/copy-libs.sh to /build.sh :: WSL fix Commenting out all cloned components that are now part of the Managed Components. --- build.sh | 13 ++++ tools/copy-libs.sh | 7 --- tools/update-components.sh | 126 ++++++++++++++++++------------------- 3 files changed, 76 insertions(+), 70 deletions(-) diff --git a/build.sh b/build.sh index 5987b78b3..2564da44b 100755 --- a/build.sh +++ b/build.sh @@ -187,6 +187,19 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf_libs if [ $? -ne 0 ]; then exit 1; fi + if [ "$target" == "esp32s3" ]; then + idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" srmodels_bin + if [ $? -ne 0 ]; then exit 1; fi + AR_SDK="$AR_TOOLS/esp32-arduino-libs/$target" + # sr model.bin + if [ -f "build/srmodels/srmodels.bin" ]; then + echo "$AR_SDK/esp_sr" + mkdir -p "$AR_SDK/esp_sr" + cp -f "build/srmodels/srmodels.bin" "$AR_SDK/esp_sr/" + cp -f "partitions.csv" "$AR_SDK/esp_sr/" + fi + fi + # Build Bootloaders for boot_conf in `echo "$target_json" | jq -c '.bootloaders[]'`; do bootloader_configs="$main_configs" diff --git a/tools/copy-libs.sh b/tools/copy-libs.sh index 9cec8e5ab..a8c601a84 100755 --- a/tools/copy-libs.sh +++ b/tools/copy-libs.sh @@ -478,13 +478,6 @@ echo -n "$LD_FLAGS" > "$FLAGS_DIR/ld_flags" echo -n "$LD_SCRIPTS" > "$FLAGS_DIR/ld_scripts" echo -n "$AR_LIBS" > "$FLAGS_DIR/ld_libs" -# sr model.bin -if [ -f "build/srmodels/srmodels.bin" ]; then - mkdir -p "$AR_SDK/esp_sr" - cp -f "build/srmodels/srmodels.bin" "$AR_SDK/esp_sr/" - cp -f "partitions.csv" "$AR_SDK/esp_sr/" -fi - # sdkconfig cp -f "sdkconfig" "$AR_SDK/sdkconfig" diff --git a/tools/update-components.sh b/tools/update-components.sh index 13bdd183f..39f5920a3 100755 --- a/tools/update-components.sh +++ b/tools/update-components.sh @@ -13,107 +13,107 @@ TFLITE_REPO_URL="https://github.com/espressif/tflite-micro-esp-examples.git" # # CLONE/UPDATE ESP32-CAMERA # -echo "Updating ESP32 Camera..." -if [ ! -d "$AR_COMPS/esp32-camera" ]; then - git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera" -else - git -C "$AR_COMPS/esp32-camera" fetch && \ - git -C "$AR_COMPS/esp32-camera" pull --ff-only -fi -if [ $? -ne 0 ]; then exit 1; fi +#echo "Updating ESP32 Camera..." +#if [ ! -d "$AR_COMPS/esp32-camera" ]; then +# git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera" +#else +# git -C "$AR_COMPS/esp32-camera" fetch && \ +# git -C "$AR_COMPS/esp32-camera" pull --ff-only +#fi +#if [ $? -ne 0 ]; then exit 1; fi # # CLONE/UPDATE ESP-DL # echo "Updating ESP-DL..." if [ ! -d "$AR_COMPS/esp-dl" ]; then - git clone $DL_REPO_URL "$AR_COMPS/esp-dl" - #this is a temp measure to fix build issue - mv "$AR_COMPS/esp-dl/CMakeLists.txt" "$AR_COMPS/esp-dl/CMakeListsOld.txt" - echo "idf_build_get_property(target IDF_TARGET)" > "$AR_COMPS/esp-dl/CMakeLists.txt" - echo "if(NOT \${IDF_TARGET} STREQUAL \"esp32c6\" AND NOT \${IDF_TARGET} STREQUAL \"esp32h2\")" >> "$AR_COMPS/esp-dl/CMakeLists.txt" - cat "$AR_COMPS/esp-dl/CMakeListsOld.txt" >> "$AR_COMPS/esp-dl/CMakeLists.txt" - echo "endif()" >> "$AR_COMPS/esp-dl/CMakeLists.txt" - rm -rf "$AR_COMPS/esp-dl/CMakeListsOld.txt" + git clone $DL_REPO_URL "$AR_COMPS/esp-dl" + #this is a temp measure to fix build issue + mv "$AR_COMPS/esp-dl/CMakeLists.txt" "$AR_COMPS/esp-dl/CMakeListsOld.txt" + echo "idf_build_get_property(target IDF_TARGET)" > "$AR_COMPS/esp-dl/CMakeLists.txt" + echo "if(NOT \${IDF_TARGET} STREQUAL \"esp32c6\" AND NOT \${IDF_TARGET} STREQUAL \"esp32h2\")" >> "$AR_COMPS/esp-dl/CMakeLists.txt" + cat "$AR_COMPS/esp-dl/CMakeListsOld.txt" >> "$AR_COMPS/esp-dl/CMakeLists.txt" + echo "endif()" >> "$AR_COMPS/esp-dl/CMakeLists.txt" + rm -rf "$AR_COMPS/esp-dl/CMakeListsOld.txt" else - git -C "$AR_COMPS/esp-dl" fetch && \ - git -C "$AR_COMPS/esp-dl" pull --ff-only + git -C "$AR_COMPS/esp-dl" fetch && \ + git -C "$AR_COMPS/esp-dl" pull --ff-only fi if [ $? -ne 0 ]; then exit 1; fi #this is a temp measure to fix build issue if [ -f "$AR_COMPS/esp-dl/idf_component.yml" ]; then - rm -rf "$AR_COMPS/esp-dl/idf_component.yml" + rm -rf "$AR_COMPS/esp-dl/idf_component.yml" fi # # CLONE/UPDATE ESP-SR # -echo "Updating ESP-SR..." -if [ ! -d "$AR_COMPS/esp-sr" ]; then - git clone $SR_REPO_URL "$AR_COMPS/esp-sr" -else - git -C "$AR_COMPS/esp-sr" fetch && \ - git -C "$AR_COMPS/esp-sr" pull --ff-only -fi -if [ $? -ne 0 ]; then exit 1; fi +#echo "Updating ESP-SR..." +#if [ ! -d "$AR_COMPS/esp-sr" ]; then +# git clone $SR_REPO_URL "$AR_COMPS/esp-sr" +#else +# git -C "$AR_COMPS/esp-sr" fetch && \ +# git -C "$AR_COMPS/esp-sr" pull --ff-only +#fi +#if [ $? -ne 0 ]; then exit 1; fi # # CLONE/UPDATE ESP-RAINMAKER # -echo "Updating ESP-RainMaker..." -if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then - git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \ - git -C "$AR_COMPS/esp-rainmaker" reset --hard d8e93454f495bd8a414829ec5e86842b373ff555 && \ - git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive +#echo "Updating ESP-RainMaker..." +#if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then +# git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \ +# git -C "$AR_COMPS/esp-rainmaker" reset --hard d8e93454f495bd8a414829ec5e86842b373ff555 && \ +# git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive # else -# git -C "$AR_COMPS/esp-rainmaker" fetch && \ -# git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \ +# git -C "$AR_COMPS/esp-rainmaker" fetch && \ +# git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \ # git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive -fi -if [ $? -ne 0 ]; then exit 1; fi +#fi +#if [ $? -ne 0 ]; then exit 1; fi #this is a temp measure to fix build issue -if [ -f "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" ] && [ `cat "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" | grep esp32c6 | wc -l` == "0" ]; then - echo "Overwriting 'get_projbuild_gitconfig.py'" - cp -f "tools/get_projbuild_gitconfig.py" "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" -fi +#if [ -f "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" ] && [ `cat "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" | grep esp32c6 | wc -l` == "0" ]; then +# echo "Overwriting 'get_projbuild_gitconfig.py'" +# cp -f "tools/get_projbuild_gitconfig.py" "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" +#fi # # CLONE/UPDATE ESP-LITTLEFS # -echo "Updating ESP-LITTLEFS..." -if [ ! -d "$AR_COMPS/esp_littlefs" ]; then - git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \ - git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive -else - git -C "$AR_COMPS/esp_littlefs" fetch && \ - git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \ - git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive -fi -if [ $? -ne 0 ]; then exit 1; fi +#echo "Updating ESP-LITTLEFS..." +#if [ ! -d "$AR_COMPS/esp_littlefs" ]; then +# git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \ +# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive +#else +# git -C "$AR_COMPS/esp_littlefs" fetch && \ +# git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \ +# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive +#fi +#if [ $? -ne 0 ]; then exit 1; fi # # CLONE/UPDATE TINYUSB # echo "Updating TinyUSB..." if [ ! -d "$AR_COMPS/arduino_tinyusb/tinyusb" ]; then - git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb" + git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb" else - git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \ - git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only + git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \ + git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only fi if [ $? -ne 0 ]; then exit 1; fi # # CLONE/UPDATE TFLITE MICRO # -echo "Updating TFLite Micro..." -if [ ! -d "$AR_COMPS/tflite-micro" ]; then - git clone $TFLITE_REPO_URL "$AR_COMPS/tflite-micro" - git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive -else - git -C "$AR_COMPS/tflite-micro" fetch && \ - git -C "$AR_COMPS/tflite-micro" pull --ff-only - git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive -fi -if [ $? -ne 0 ]; then exit 1; fi +#echo "Updating TFLite Micro..." +#if [ ! -d "$AR_COMPS/tflite-micro" ]; then +# git clone $TFLITE_REPO_URL "$AR_COMPS/tflite-micro" +# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive +#else +# git -C "$AR_COMPS/tflite-micro" fetch && \ +# git -C "$AR_COMPS/tflite-micro" pull --ff-only +# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive +#fi +#if [ $? -ne 0 ]; then exit 1; fi From 5ceed1d4ebcc30c3ed1937210fc6352d1b237f4e Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 6 Nov 2023 17:56:29 -0300 Subject: [PATCH 03/11] Update idf_component.yml Lib builder Managed Components for the top level (not in Arduino as IDF Component level). Includes only Tensor Flow and Deep Learning. All other managed component will be added to ESP32-Arduino repository. --- main/idf_component.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main/idf_component.yml b/main/idf_component.yml index 2ba047577..78124d6d5 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,10 +1,15 @@ dependencies: # Required IDF version idf: ">=5.1" - - mdns: "^1.1.0" - chmorgan/esp-libhelix-mp3: "1.0.3" - esp-dsp: "^1.3.4" + espressif/esp-tflite-micro: + version: ">=1.2.0" + require: public + espressif/esp-dl: + version: ">=2.0.0" + path: ../components/esp-dl + require: public + rules: + - if: "target in [esp32, esp32s3]" # esp-sr: "^1.3.1" # esp32-camera: "^2.0.4" From 597754f9d82a7da57f09b090ee77d51a58329e4c Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 08:34:56 -0300 Subject: [PATCH 04/11] Adds Camera Component --- main/idf_component.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/main/idf_component.yml b/main/idf_component.yml index 78124d6d5..862cf27a3 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,6 +1,7 @@ dependencies: # Required IDF version idf: ">=5.1" + espressif/esp32-camera: "^2.0.5" espressif/esp-tflite-micro: version: ">=1.2.0" require: public From dbea3d4f8eed9569d4beed0f393bacc860c15a47 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 09:04:14 -0300 Subject: [PATCH 05/11] DL component only for S3 --- main/idf_component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/idf_component.yml b/main/idf_component.yml index 862cf27a3..23ce765c8 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -10,7 +10,7 @@ dependencies: path: ../components/esp-dl require: public rules: - - if: "target in [esp32, esp32s3]" + - if: "target in [esp32s3]" # esp-sr: "^1.3.1" # esp32-camera: "^2.0.4" From 9eb7aeaf662d560f2e2be3d836f0d4ce92c19340 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 09:12:39 -0300 Subject: [PATCH 06/11] get Camera component from GH --- main/idf_component.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/idf_component.yml b/main/idf_component.yml index 23ce765c8..2988cbbe9 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,7 +1,8 @@ dependencies: # Required IDF version idf: ">=5.1" - espressif/esp32-camera: "^2.0.5" + espressif/esp32-camera: + git: https://github.com/espressif/esp32-camera.git espressif/esp-tflite-micro: version: ">=1.2.0" require: public From ddec8a003838567400584a73239820c36dac5d48 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 09:15:36 -0300 Subject: [PATCH 07/11] Camera component for any Version + Public --- main/idf_component.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/idf_component.yml b/main/idf_component.yml index 2988cbbe9..c991e6924 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -2,7 +2,9 @@ dependencies: # Required IDF version idf: ">=5.1" espressif/esp32-camera: + version: "*" git: https://github.com/espressif/esp32-camera.git + require: public espressif/esp-tflite-micro: version: ">=1.2.0" require: public From 07b90dde45bb850e3072c16699a5d20b0ffa1572 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 09:45:38 -0300 Subject: [PATCH 08/11] Test for SR Models building in CI --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88cede199..8e55efe2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,3 +33,9 @@ add_custom_command( VERBATIM ) add_custom_target(mem-variant DEPENDS "mem_variant") + +if(IDF_TARGET MATCHES "esp32s3") + set(SR_MODELS_PATH ${CMAKE_SOURCE_DIR}/managed_components/espressif__esp-sr) + set(EXTRA_COMPONENT_DIRS ${SR_MODELS_PATH}) +endif() + From 6ea0c5762adc4b535f0349e5bacae6340eb5f03b Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 12:43:32 -0300 Subject: [PATCH 09/11] add SR component to the CI --- main/idf_component.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/idf_component.yml b/main/idf_component.yml index c991e6924..fa6bda57a 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -14,6 +14,10 @@ dependencies: require: public rules: - if: "target in [esp32s3]" + espressif/esp-sr: + version: "^1.4.2" + rules: + - if: "target in [esp32, esp32s3]" # esp-sr: "^1.3.1" # esp32-camera: "^2.0.4" From 7b4ea7c9e60ec43871f59844690ba15ec8943490 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 12:52:54 -0300 Subject: [PATCH 10/11] fix idf_component.yml format --- main/idf_component.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/idf_component.yml b/main/idf_component.yml index fa6bda57a..de094821a 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -14,10 +14,10 @@ dependencies: require: public rules: - if: "target in [esp32s3]" - espressif/esp-sr: - version: "^1.4.2" + espressif/esp-sr: + version: ">=1.4.2" rules: - - if: "target in [esp32, esp32s3]" + - if: "target in [esp32s3]" # esp-sr: "^1.3.1" # esp32-camera: "^2.0.4" From cbeb9697836a1d29eec115e3cd9724c6208e7446 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Wed, 8 Nov 2023 13:57:21 -0300 Subject: [PATCH 11/11] Reverting not necessary change about ESP-SR component --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e55efe2b..88cede199 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,9 +33,3 @@ add_custom_command( VERBATIM ) add_custom_target(mem-variant DEPENDS "mem_variant") - -if(IDF_TARGET MATCHES "esp32s3") - set(SR_MODELS_PATH ${CMAKE_SOURCE_DIR}/managed_components/espressif__esp-sr) - set(EXTRA_COMPONENT_DIRS ${SR_MODELS_PATH}) -endif() -