Skip to content

Commit f77bb37

Browse files
authored
Merge branch 'master' into master
2 parents 8a41f22 + 8129486 commit f77bb37

7 files changed

+170
-80
lines changed

CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +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-
set(TFLITE_PATH ${CMAKE_SOURCE_DIR}/components/tflite-micro)
8-
9-
set(EXTRA_COMPONENT_DIRS ${INSIGHTS_PATH}/components ${RMAKER_PATH}/components ${TFLITE_PATH}/components)
10-
115
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
126
project(arduino-lib-builder)
137

@@ -16,7 +10,7 @@ idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION)
1610
add_custom_command(
1711
OUTPUT "idf_libs"
1812
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}"
19-
DEPENDS all
13+
DEPENDS ${elf}
2014
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2115
VERBATIM
2216
)

build.sh

Lines changed: 13 additions & 0 deletions
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

Lines changed: 17 additions & 4 deletions
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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,13 @@ 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/"
481+
# copy zigbee + zboss lib
482+
if [ -d "managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET/" ]; then
483+
cp -r "managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET"/* "$AR_SDK/lib/"
484+
fi
485+
486+
if [ -d "managed_components/espressif__esp-zboss-lib/lib/$IDF_TARGET/" ]; then
487+
cp -r "managed_components/espressif__esp-zboss-lib/lib/$IDF_TARGET"/* "$AR_SDK/lib/"
486488
fi
487489

488490
# sdkconfig

tools/gen_tools_json.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,76 @@
1515
import sys
1616
import stat
1717
import argparse
18+
import re
19+
import requests
1820

1921
if sys.version_info[0] == 3:
2022
unicode = lambda s: str(s)
2123

24+
release_manifests = []
25+
26+
def replace_if_xz(system):
27+
if not system['url'].endswith(".tar.xz"):
28+
return system
29+
30+
new_url = system['url'].replace(".tar.xz", ".tar.gz")
31+
new_name = system['archiveFileName'].replace(".tar.xz", ".tar.gz")
32+
new_checksum = ""
33+
new_size = 0
34+
35+
# let's get the checksum file from the release
36+
release_manifest_url = ""
37+
# parse the download url to extract all info needed for the checksum file url
38+
urlx = re.findall("^https://github.com/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/releases/download/([a-zA-Z0-9_\-.]+)/([a-zA-Z0-9_\-.]+)$", new_url)
39+
if urlx and len(urlx) > 0:
40+
(owner, proj, version, filename) = urlx[0]
41+
release_manifest_url = "https://github.com/%s/%s/releases/download/%s/%s-%s-checksum.sha256" % (owner, proj, version, proj, version)
42+
else:
43+
print("No manifest match")
44+
return system
45+
46+
# check if we have already downloaded and parsed that manifest
47+
manifest_index = 0
48+
manifest_found = False
49+
for manifest in release_manifests:
50+
if manifest['url'] == release_manifest_url:
51+
manifest_found = True
52+
break
53+
manifest_index = manifest_index + 1
54+
55+
# download and parse manifest
56+
if not manifest_found:
57+
manifest = {
58+
"url": release_manifest_url,
59+
"files": []
60+
}
61+
release_manifest_contents = requests.get(release_manifest_url).text
62+
x = re.findall("\s([a-zA-Z0-9_\-.]+):\s([0-9]+)\s[a-z]+\\n([a-f0-9]+)\s\*.*", release_manifest_contents)
63+
if x and len(x) > 0:
64+
for line in x:
65+
(filename, size, checksum) = line
66+
file = {
67+
"name":filename,
68+
"checksum":checksum,
69+
"size":size
70+
}
71+
manifest["files"].append(file)
72+
else:
73+
print("No line match")
74+
return system
75+
76+
release_manifests.append(manifest)
77+
78+
# find the new file in the list and get it's size and checksum
79+
for file in release_manifests[manifest_index]['files']:
80+
if file['name'] == new_name:
81+
system['url'] = new_url
82+
system['archiveFileName'] = new_name
83+
system["checksum"] = "SHA-256:"+file['checksum']
84+
system["size"] = file['size']
85+
break
86+
return system
87+
2288
if __name__ == '__main__':
2389

2490
parser = argparse.ArgumentParser(
@@ -127,6 +193,8 @@
127193
else :
128194
continue
129195

196+
system = replace_if_xz(system)
197+
130198
systems.append(system)
131199

132200
if simple_output == False:

tools/install-esp-idf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if [ ! -x $idf_was_installed ] || [ ! -x $commit_predefined ]; then
3737

3838
# Temporarily patch the ETH driver to support custom SPI
3939
cd $IDF_PATH
40-
patch -p1 -i ../patches/spi_eth.diff
40+
patch -p1 -N -i ../patches/spi_eth.diff
4141
cd -
4242
fi
4343

tools/update-components.sh

Lines changed: 63 additions & 63 deletions
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)