Skip to content

Commit 752365b

Browse files
authored
Using most IDF Managed Components instead of git-clone (#145)
* Update CMakeLists.txt Removes RainMaker and replaces "all" to get it working with WSL Ubuntu * 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. * 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. * Adds Camera Component * DL component only for S3 * get Camera component from GH * Camera component for any Version + Public * Test for SR Models building in CI * add SR component to the CI * fix idf_component.yml format * Reverting not necessary change about ESP-SR component
1 parent c39e942 commit 752365b

File tree

5 files changed

+94
-80
lines changed

5 files changed

+94
-80
lines changed

CMakeLists.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# CMakeLists in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.5)
44

5-
set(RMAKER_PATH ${CMAKE_SOURCE_DIR}/components/esp-rainmaker)
6-
set(INSIGHTS_PATH ${RMAKER_PATH}/components/esp-insights)
7-
8-
set(EXTRA_COMPONENT_DIRS ${INSIGHTS_PATH}/components ${RMAKER_PATH}/components)
9-
105
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
116
project(arduino-lib-builder)
127

@@ -15,7 +10,7 @@ idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION)
1510
add_custom_command(
1611
OUTPUT "idf_libs"
1712
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}"
18-
DEPENDS all
13+
DEPENDS ${elf}
1914
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2015
VERBATIM
2116
)

build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,19 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
187187
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf_libs
188188
if [ $? -ne 0 ]; then exit 1; fi
189189

190+
if [ "$target" == "esp32s3" ]; then
191+
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" srmodels_bin
192+
if [ $? -ne 0 ]; then exit 1; fi
193+
AR_SDK="$AR_TOOLS/esp32-arduino-libs/$target"
194+
# sr model.bin
195+
if [ -f "build/srmodels/srmodels.bin" ]; then
196+
echo "$AR_SDK/esp_sr"
197+
mkdir -p "$AR_SDK/esp_sr"
198+
cp -f "build/srmodels/srmodels.bin" "$AR_SDK/esp_sr/"
199+
cp -f "partitions.csv" "$AR_SDK/esp_sr/"
200+
fi
201+
fi
202+
190203
# Build Bootloaders
191204
for boot_conf in `echo "$target_json" | jq -c '.bootloaders[]'`; do
192205
bootloader_configs="$main_configs"

main/idf_component.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
dependencies:
22
# Required IDF version
33
idf: ">=5.1"
4-
5-
mdns: "^1.1.0"
6-
chmorgan/esp-libhelix-mp3: "1.0.3"
7-
esp-dsp: "^1.3.4"
4+
espressif/esp32-camera:
5+
version: "*"
6+
git: https://github.com/espressif/esp32-camera.git
7+
require: public
8+
espressif/esp-tflite-micro:
9+
version: ">=1.2.0"
10+
require: public
11+
espressif/esp-dl:
12+
version: ">=2.0.0"
13+
path: ../components/esp-dl
14+
require: public
15+
rules:
16+
- if: "target in [esp32s3]"
17+
espressif/esp-sr:
18+
version: ">=1.4.2"
19+
rules:
20+
- if: "target in [esp32s3]"
821

922
# esp-sr: "^1.3.1"
1023
# esp32-camera: "^2.0.4"

tools/copy-libs.sh

-7
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,6 @@ echo -n "$LD_FLAGS" > "$FLAGS_DIR/ld_flags"
478478
echo -n "$LD_SCRIPTS" > "$FLAGS_DIR/ld_scripts"
479479
echo -n "$AR_LIBS" > "$FLAGS_DIR/ld_libs"
480480

481-
# sr model.bin
482-
if [ -f "build/srmodels/srmodels.bin" ]; then
483-
mkdir -p "$AR_SDK/esp_sr"
484-
cp -f "build/srmodels/srmodels.bin" "$AR_SDK/esp_sr/"
485-
cp -f "partitions.csv" "$AR_SDK/esp_sr/"
486-
fi
487-
488481
# sdkconfig
489482
cp -f "sdkconfig" "$AR_SDK/sdkconfig"
490483

tools/update-components.sh

+63-63
Original file line numberDiff line numberDiff line change
@@ -13,107 +13,107 @@ TFLITE_REPO_URL="https://github.com/espressif/tflite-micro-esp-examples.git"
1313
#
1414
# CLONE/UPDATE ESP32-CAMERA
1515
#
16-
echo "Updating ESP32 Camera..."
17-
if [ ! -d "$AR_COMPS/esp32-camera" ]; then
18-
git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera"
19-
else
20-
git -C "$AR_COMPS/esp32-camera" fetch && \
21-
git -C "$AR_COMPS/esp32-camera" pull --ff-only
22-
fi
23-
if [ $? -ne 0 ]; then exit 1; fi
16+
#echo "Updating ESP32 Camera..."
17+
#if [ ! -d "$AR_COMPS/esp32-camera" ]; then
18+
# git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera"
19+
#else
20+
# git -C "$AR_COMPS/esp32-camera" fetch && \
21+
# git -C "$AR_COMPS/esp32-camera" pull --ff-only
22+
#fi
23+
#if [ $? -ne 0 ]; then exit 1; fi
2424

2525
#
2626
# CLONE/UPDATE ESP-DL
2727
#
2828
echo "Updating ESP-DL..."
2929
if [ ! -d "$AR_COMPS/esp-dl" ]; then
30-
git clone $DL_REPO_URL "$AR_COMPS/esp-dl"
31-
#this is a temp measure to fix build issue
32-
mv "$AR_COMPS/esp-dl/CMakeLists.txt" "$AR_COMPS/esp-dl/CMakeListsOld.txt"
33-
echo "idf_build_get_property(target IDF_TARGET)" > "$AR_COMPS/esp-dl/CMakeLists.txt"
34-
echo "if(NOT \${IDF_TARGET} STREQUAL \"esp32c6\" AND NOT \${IDF_TARGET} STREQUAL \"esp32h2\")" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
35-
cat "$AR_COMPS/esp-dl/CMakeListsOld.txt" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
36-
echo "endif()" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
37-
rm -rf "$AR_COMPS/esp-dl/CMakeListsOld.txt"
30+
git clone $DL_REPO_URL "$AR_COMPS/esp-dl"
31+
#this is a temp measure to fix build issue
32+
mv "$AR_COMPS/esp-dl/CMakeLists.txt" "$AR_COMPS/esp-dl/CMakeListsOld.txt"
33+
echo "idf_build_get_property(target IDF_TARGET)" > "$AR_COMPS/esp-dl/CMakeLists.txt"
34+
echo "if(NOT \${IDF_TARGET} STREQUAL \"esp32c6\" AND NOT \${IDF_TARGET} STREQUAL \"esp32h2\")" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
35+
cat "$AR_COMPS/esp-dl/CMakeListsOld.txt" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
36+
echo "endif()" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
37+
rm -rf "$AR_COMPS/esp-dl/CMakeListsOld.txt"
3838
else
39-
git -C "$AR_COMPS/esp-dl" fetch && \
40-
git -C "$AR_COMPS/esp-dl" pull --ff-only
39+
git -C "$AR_COMPS/esp-dl" fetch && \
40+
git -C "$AR_COMPS/esp-dl" pull --ff-only
4141
fi
4242
if [ $? -ne 0 ]; then exit 1; fi
4343
#this is a temp measure to fix build issue
4444
if [ -f "$AR_COMPS/esp-dl/idf_component.yml" ]; then
45-
rm -rf "$AR_COMPS/esp-dl/idf_component.yml"
45+
rm -rf "$AR_COMPS/esp-dl/idf_component.yml"
4646
fi
4747

4848
#
4949
# CLONE/UPDATE ESP-SR
5050
#
51-
echo "Updating ESP-SR..."
52-
if [ ! -d "$AR_COMPS/esp-sr" ]; then
53-
git clone $SR_REPO_URL "$AR_COMPS/esp-sr"
54-
else
55-
git -C "$AR_COMPS/esp-sr" fetch && \
56-
git -C "$AR_COMPS/esp-sr" pull --ff-only
57-
fi
58-
if [ $? -ne 0 ]; then exit 1; fi
51+
#echo "Updating ESP-SR..."
52+
#if [ ! -d "$AR_COMPS/esp-sr" ]; then
53+
# git clone $SR_REPO_URL "$AR_COMPS/esp-sr"
54+
#else
55+
# git -C "$AR_COMPS/esp-sr" fetch && \
56+
# git -C "$AR_COMPS/esp-sr" pull --ff-only
57+
#fi
58+
#if [ $? -ne 0 ]; then exit 1; fi
5959

6060
#
6161
# CLONE/UPDATE ESP-RAINMAKER
6262
#
63-
echo "Updating ESP-RainMaker..."
64-
if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
65-
git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \
66-
git -C "$AR_COMPS/esp-rainmaker" reset --hard d8e93454f495bd8a414829ec5e86842b373ff555 && \
67-
git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
63+
#echo "Updating ESP-RainMaker..."
64+
#if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
65+
# git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \
66+
# git -C "$AR_COMPS/esp-rainmaker" reset --hard d8e93454f495bd8a414829ec5e86842b373ff555 && \
67+
# git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
6868
# else
69-
# git -C "$AR_COMPS/esp-rainmaker" fetch && \
70-
# git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \
69+
# git -C "$AR_COMPS/esp-rainmaker" fetch && \
70+
# git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \
7171
# git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
72-
fi
73-
if [ $? -ne 0 ]; then exit 1; fi
72+
#fi
73+
#if [ $? -ne 0 ]; then exit 1; fi
7474

7575
#this is a temp measure to fix build issue
76-
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
77-
echo "Overwriting 'get_projbuild_gitconfig.py'"
78-
cp -f "tools/get_projbuild_gitconfig.py" "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py"
79-
fi
76+
#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
77+
# echo "Overwriting 'get_projbuild_gitconfig.py'"
78+
# cp -f "tools/get_projbuild_gitconfig.py" "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py"
79+
#fi
8080

8181
#
8282
# CLONE/UPDATE ESP-LITTLEFS
8383
#
84-
echo "Updating ESP-LITTLEFS..."
85-
if [ ! -d "$AR_COMPS/esp_littlefs" ]; then
86-
git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \
87-
git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
88-
else
89-
git -C "$AR_COMPS/esp_littlefs" fetch && \
90-
git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \
91-
git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
92-
fi
93-
if [ $? -ne 0 ]; then exit 1; fi
84+
#echo "Updating ESP-LITTLEFS..."
85+
#if [ ! -d "$AR_COMPS/esp_littlefs" ]; then
86+
# git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \
87+
# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
88+
#else
89+
# git -C "$AR_COMPS/esp_littlefs" fetch && \
90+
# git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \
91+
# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
92+
#fi
93+
#if [ $? -ne 0 ]; then exit 1; fi
9494

9595
#
9696
# CLONE/UPDATE TINYUSB
9797
#
9898
echo "Updating TinyUSB..."
9999
if [ ! -d "$AR_COMPS/arduino_tinyusb/tinyusb" ]; then
100-
git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb"
100+
git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb"
101101
else
102-
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \
103-
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only
102+
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \
103+
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only
104104
fi
105105
if [ $? -ne 0 ]; then exit 1; fi
106106

107107
#
108108
# CLONE/UPDATE TFLITE MICRO
109109
#
110-
echo "Updating TFLite Micro..."
111-
if [ ! -d "$AR_COMPS/tflite-micro" ]; then
112-
git clone $TFLITE_REPO_URL "$AR_COMPS/tflite-micro"
113-
git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
114-
else
115-
git -C "$AR_COMPS/tflite-micro" fetch && \
116-
git -C "$AR_COMPS/tflite-micro" pull --ff-only
117-
git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
118-
fi
119-
if [ $? -ne 0 ]; then exit 1; fi
110+
#echo "Updating TFLite Micro..."
111+
#if [ ! -d "$AR_COMPS/tflite-micro" ]; then
112+
# git clone $TFLITE_REPO_URL "$AR_COMPS/tflite-micro"
113+
# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
114+
#else
115+
# git -C "$AR_COMPS/tflite-micro" fetch && \
116+
# git -C "$AR_COMPS/tflite-micro" pull --ff-only
117+
# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
118+
#fi
119+
#if [ $? -ne 0 ]; then exit 1; fi

0 commit comments

Comments
 (0)