Skip to content

Commit 79f7b0e

Browse files
committed
Script improvements, rainmaker and esp-sr
1 parent 78b3992 commit 79f7b0e

14 files changed

+87
-31
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.DS_Store
22
.vscode
33
components/arduino/
4-
components/esp-face/
4+
components/esp-dl/
5+
components/esp-sr/
56
components/esp32-camera/
67
components/esp_littlefs/
78
components/esp-rainmaker/

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# CMakeLists in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.5)
44

5-
if(IDF_TARGET STREQUAL "esp32")
6-
set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components)
7-
endif()
5+
set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components)
86

97
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
108
project(arduino-lib-builder)

build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,22 @@ if [ "$BUILD_TYPE" != "all" ]; then
9797
print_help
9898
fi
9999
configs="configs/defconfig.common;configs/defconfig.$TARGET"
100+
101+
# Target Features Configs
102+
for target_json in `jq -c '.targets[]' configs/builds.json`; do
103+
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
104+
if [ "$TARGET" == "$target" ]; then
105+
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
106+
configs="$configs;configs/defconfig.$defconf"
107+
done
108+
fi
109+
done
110+
111+
# Configs From Arguments
100112
for conf in $CONFIGS; do
101113
configs="$configs;configs/defconfig.$conf"
102114
done
115+
103116
echo "idf.py -DIDF_TARGET=\"$TARGET\" -DSDKCONFIG_DEFAULTS=\"$configs\" $BUILD_TYPE"
104117
rm -rf build sdkconfig
105118
idf.py -DIDF_TARGET="$TARGET" -DSDKCONFIG_DEFAULTS="$configs" $BUILD_TYPE
@@ -121,7 +134,12 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
121134
fi
122135

123136
echo "* Target: $target"
137+
138+
# Build Main Configs List
124139
main_configs="configs/defconfig.common;configs/defconfig.$target"
140+
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
141+
main_configs="$main_configs;configs/defconfig.$defconf"
142+
done
125143

126144
# Build IDF Libs
127145
idf_libs_configs="$main_configs"

configs/builds.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,23 @@
3434
"targets":[
3535
{
3636
"target": "esp32s3",
37-
"idf_libs":["qio","80m"],
37+
"features":[],
38+
"idf_libs":["qio","80m","qio_ram"],
3839
"bootloaders":[
39-
["qio","120m"],
40-
["qio","80m"],
41-
["dio","80m"],
42-
["opi_flash","opi_ram","80m"]
40+
["qio","120m","qio_ram"],
41+
["qio","80m","qio_ram"],
42+
["dio","80m","qio_ram"],
43+
["opi","80m","opi_ram"]
4344
],
4445
"mem_variants":[
45-
["opi_ram","80m"],
46-
["opi_flash","opi_ram","80m"]
46+
["qio","80m","opi_ram"],
47+
["opi","80m","opi_ram"],
48+
["opi","80m","qio_ram"]
4749
]
4850
},
4951
{
5052
"target": "esp32s2",
53+
"features":["qio_ram"],
5154
"idf_libs":["qio","80m"],
5255
"bootloaders":[
5356
["qio","80m"],
@@ -63,6 +66,7 @@
6366
},
6467
{
6568
"target": "esp32c3",
69+
"features":[],
6670
"idf_libs":["qio","80m"],
6771
"bootloaders":[
6872
["qio","80m"],
@@ -78,6 +82,7 @@
7882
},
7983
{
8084
"target": "esp32",
85+
"features":["qio_ram"],
8186
"idf_libs":["dio","40m"],
8287
"bootloaders":[
8388
["qio","80m"],

configs/defconfig.common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CONFIG_AUTOSTART_ARDUINO=y
22
CONFIG_ARDUINO_UDP_RUN_CORE0=y
3+
# CONFIG_WS2812_LED_ENABLE is not set

configs/defconfig.esp32

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ CONFIG_BT_STACK_NO_LOG=y
1717
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
1818
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
1919
CONFIG_ESP32_SPIRAM_SUPPORT=y
20-
# CONFIG_SPIRAM_BOOT_INIT is not set
2120
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
2221
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
2322
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
@@ -72,3 +71,5 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048
7271
CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10
7372
CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2
7473
CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096
74+
# CONFIG_USE_WAKENET is not set
75+
# CONFIG_USE_MULTINET is not set

configs/defconfig.esp32s2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ CONFIG_COMPILER_WARN_WRITE_STRINGS=y
1414
# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set
1515
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y
1616
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
17-
# CONFIG_SPIRAM_BOOT_INIT is not set
1817
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
1918
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
2019
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
@@ -74,3 +73,5 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048
7473
CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10
7574
CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2
7675
CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096
76+
# CONFIG_USE_WAKENET is not set
77+
# CONFIG_USE_MULTINET is not set

configs/defconfig.esp32s3

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ CONFIG_BLE_MESH=y
1414
# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set
1515
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y
1616
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
17-
# CONFIG_SPIRAM_BOOT_INIT is not set
1817
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
1918
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
2019
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
@@ -76,3 +75,7 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048
7675
CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10
7776
CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2
7877
CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096
78+
CONFIG_SR_WN_MODEL_WN8_QUANT=y
79+
CONFIG_SR_WN_WN8_HIESP=y
80+
CONFIG_SR_MN_ENGLISH=y
81+
CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8=y
File renamed without changes.

configs/defconfig.opi_ram

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
CONFIG_SPIRAM_MODE_OCT=y
1+
CONFIG_SPIRAM_MODE_OCT=y
2+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
3+
# CONFIG_SPIRAM_MEMTEST is not set

configs/defconfig.qio_ram

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# CONFIG_SPIRAM_BOOT_INIT is not set

tools/copy-libs.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ for item; do
196196
add_next=0
197197
is_script=0
198198
is_dir=0
199-
elif [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" ]]; then
199+
elif [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" && "${item:0:17}" != "-Wl,--start-group" && "${item:0:15}" != "-Wl,--end-group" ]]; then
200200
LD_FLAGS+="$item "
201201
PIO_LD_FLAGS+="$item "
202202
fi
@@ -359,6 +359,7 @@ for item; do
359359
done
360360
fi
361361
done
362+
echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", env.BoardConfig().get(\"build.arduino.memory_type\", \"$MEMCONF\"), \"include\")," >> "$AR_PLATFORMIO_PY"
362363
echo " join(FRAMEWORK_DIR, \"cores\", env.BoardConfig().get(\"build.core\"))" >> "$AR_PLATFORMIO_PY"
363364
echo " ]," >> "$AR_PLATFORMIO_PY"
364365
echo "" >> "$AR_PLATFORMIO_PY"
@@ -383,7 +384,7 @@ done
383384
echo " LIBPATH=[" >> "$AR_PLATFORMIO_PY"
384385
echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"lib\")," >> "$AR_PLATFORMIO_PY"
385386
echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"ld\")," >> "$AR_PLATFORMIO_PY"
386-
echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"$MEMCONF\")" >> "$AR_PLATFORMIO_PY"
387+
echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", env.BoardConfig().get(\"build.arduino.memory_type\", \"$MEMCONF\"))" >> "$AR_PLATFORMIO_PY"
387388
echo " ]," >> "$AR_PLATFORMIO_PY"
388389
echo "" >> "$AR_PLATFORMIO_PY"
389390

@@ -473,7 +474,8 @@ echo "#define CONFIG_ARDUINO_IDF_COMMIT \"$IDF_COMMIT\"" >> "$AR_SDK/include/con
473474
echo "#define CONFIG_ARDUINO_IDF_BRANCH \"$IDF_BRANCH\"" >> "$AR_SDK/include/config/sdkconfig.h"
474475

475476
# Handle Mem Variants
476-
mkdir -p "$AR_SDK/$MEMCONF"
477+
mkdir -p "$AR_SDK/$MEMCONF/include"
478+
mv "$AR_SDK/include/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h"
477479
for mem_variant in `jq -c '.mem_variants_files[]' configs/builds.json`; do
478480
file=$(echo "$mem_variant" | jq -c '.file' | tr -d '"')
479481
out=$(echo "$mem_variant" | jq -c '.out' | tr -d '"')

tools/copy-mem-variant.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ source ./tools/config.sh
2121

2222
echo "IDF_TARGET: $IDF_TARGET, MEMCONF: $MEMCONF"
2323

24+
# Add IDF versions to sdkconfig
25+
echo "#define CONFIG_ARDUINO_IDF_COMMIT \"$IDF_COMMIT\"" >> "build/config/sdkconfig.h"
26+
echo "#define CONFIG_ARDUINO_IDF_BRANCH \"$IDF_BRANCH\"" >> "build/config/sdkconfig.h"
27+
2428
# Handle Mem Variants
2529
rm -rf "$AR_SDK/$MEMCONF"
26-
mkdir -p "$AR_SDK/$MEMCONF"
30+
mkdir -p "$AR_SDK/$MEMCONF/include"
31+
mv "build/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h"
2732
for mem_variant in `jq -c '.mem_variants_files[]' configs/builds.json`; do
2833
file=$(echo "$mem_variant" | jq -c '.file' | tr -d '"')
2934
src=$(echo "$mem_variant" | jq -c '.src' | tr -d '"')

tools/update-components.sh

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
source ./tools/config.sh
44

55
CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
6-
FACE_REPO_URL="https://github.com/espressif/esp-dl.git"
6+
DL_REPO_URL="https://github.com/espressif/esp-dl.git"
7+
SR_REPO_URL="https://github.com/espressif/esp-sr.git"
78
RMAKER_REPO_URL="https://github.com/espressif/esp-rainmaker.git"
89
DSP_REPO_URL="https://github.com/espressif/esp-dsp.git"
910
LITTLEFS_REPO_URL="https://github.com/joltwallet/esp_littlefs.git"
@@ -63,14 +64,26 @@ fi
6364
if [ $? -ne 0 ]; then exit 1; fi
6465

6566
#
66-
# CLONE/UPDATE ESP-FACE
67+
# CLONE/UPDATE ESP-DL
6768
#
6869

69-
if [ ! -d "$AR_COMPS/esp-face" ]; then
70-
git clone $FACE_REPO_URL "$AR_COMPS/esp-face"
70+
if [ ! -d "$AR_COMPS/esp-dl" ]; then
71+
git clone $DL_REPO_URL "$AR_COMPS/esp-dl"
7172
else
72-
git -C "$AR_COMPS/esp-face" fetch && \
73-
git -C "$AR_COMPS/esp-face" pull --ff-only
73+
git -C "$AR_COMPS/esp-dl" fetch && \
74+
git -C "$AR_COMPS/esp-dl" pull --ff-only
75+
fi
76+
if [ $? -ne 0 ]; then exit 1; fi
77+
78+
#
79+
# CLONE/UPDATE ESP-SR
80+
#
81+
82+
if [ ! -d "$AR_COMPS/esp-sr" ]; then
83+
git clone $SR_REPO_URL "$AR_COMPS/esp-sr"
84+
else
85+
git -C "$AR_COMPS/esp-sr" fetch && \
86+
git -C "$AR_COMPS/esp-sr" pull --ff-only
7487
fi
7588
if [ $? -ne 0 ]; then exit 1; fi
7689

@@ -93,8 +106,13 @@ if [ $? -ne 0 ]; then exit 1; fi
93106
#
94107

95108
if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
96-
git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker"
97-
git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3
109+
git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \
110+
git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
111+
# git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3
112+
else
113+
git -C "$AR_COMPS/esp-rainmaker" fetch && \
114+
git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \
115+
git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
98116
fi
99117
if [ $? -ne 0 ]; then exit 1; fi
100118

@@ -104,10 +122,10 @@ if [ $? -ne 0 ]; then exit 1; fi
104122

105123
if [ ! -d "$AR_COMPS/esp-dsp" ]; then
106124
git clone $DSP_REPO_URL "$AR_COMPS/esp-dsp"
107-
cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"`
108-
echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt"
109-
echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
110-
echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
125+
# cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"`
126+
# echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt"
127+
# echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
128+
# echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
111129
else
112130
git -C "$AR_COMPS/esp-dsp" fetch && \
113131
git -C "$AR_COMPS/esp-dsp" pull --ff-only

0 commit comments

Comments
 (0)