diff --git a/.gitignore b/.gitignore index 18043de7e..b74965aea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ .DS_Store .vscode components/arduino/ -components/esp-face/ +components/esp-dl/ +components/esp-sr/ components/esp32-camera/ components/esp_littlefs/ components/esp-rainmaker/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 3928bf105..8edbe7205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -if(IDF_TARGET STREQUAL "esp32") - set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components) -endif() +set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(arduino-lib-builder) diff --git a/build.sh b/build.sh index 6bc2779ec..a66245a17 100755 --- a/build.sh +++ b/build.sh @@ -97,9 +97,22 @@ if [ "$BUILD_TYPE" != "all" ]; then print_help fi configs="configs/defconfig.common;configs/defconfig.$TARGET" + + # Target Features Configs + for target_json in `jq -c '.targets[]' configs/builds.json`; do + target=$(echo "$target_json" | jq -c '.target' | tr -d '"') + if [ "$TARGET" == "$target" ]; then + for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do + configs="$configs;configs/defconfig.$defconf" + done + fi + done + + # Configs From Arguments for conf in $CONFIGS; do configs="$configs;configs/defconfig.$conf" done + echo "idf.py -DIDF_TARGET=\"$TARGET\" -DSDKCONFIG_DEFAULTS=\"$configs\" $BUILD_TYPE" rm -rf build sdkconfig 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 fi echo "* Target: $target" + + # Build Main Configs List main_configs="configs/defconfig.common;configs/defconfig.$target" + for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do + main_configs="$main_configs;configs/defconfig.$defconf" + done # Build IDF Libs idf_libs_configs="$main_configs" diff --git a/configs/builds.json b/configs/builds.json index 8d20b2b1e..6d5b3a868 100644 --- a/configs/builds.json +++ b/configs/builds.json @@ -34,20 +34,23 @@ "targets":[ { "target": "esp32s3", - "idf_libs":["qio","80m"], + "features":[], + "idf_libs":["qio","80m","qio_ram"], "bootloaders":[ - ["qio","120m"], - ["qio","80m"], - ["dio","80m"], - ["opi_flash","opi_ram","80m"] + ["qio","120m","qio_ram"], + ["qio","80m","qio_ram"], + ["dio","80m","qio_ram"], + ["opi","80m","opi_ram"] ], "mem_variants":[ - ["opi_ram","80m"], - ["opi_flash","opi_ram","80m"] + ["qio","80m","opi_ram"], + ["opi","80m","opi_ram"], + ["opi","80m","qio_ram"] ] }, { "target": "esp32s2", + "features":["qio_ram"], "idf_libs":["qio","80m"], "bootloaders":[ ["qio","80m"], @@ -63,6 +66,7 @@ }, { "target": "esp32c3", + "features":[], "idf_libs":["qio","80m"], "bootloaders":[ ["qio","80m"], @@ -78,6 +82,7 @@ }, { "target": "esp32", + "features":["qio_ram"], "idf_libs":["dio","40m"], "bootloaders":[ ["qio","80m"], diff --git a/configs/defconfig.common b/configs/defconfig.common index 68135c3a8..67ee16fb1 100644 --- a/configs/defconfig.common +++ b/configs/defconfig.common @@ -1,2 +1,3 @@ CONFIG_AUTOSTART_ARDUINO=y CONFIG_ARDUINO_UDP_RUN_CORE0=y +# CONFIG_WS2812_LED_ENABLE is not set \ No newline at end of file diff --git a/configs/defconfig.esp32 b/configs/defconfig.esp32 index 605ef41d2..f1fc7e444 100644 --- a/configs/defconfig.esp32 +++ b/configs/defconfig.esp32 @@ -17,7 +17,6 @@ CONFIG_BT_STACK_NO_LOG=y CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y CONFIG_ESP32_SPIRAM_SUPPORT=y -# CONFIG_SPIRAM_BOOT_INIT is not set CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0 @@ -72,3 +71,5 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +# CONFIG_USE_WAKENET is not set +# CONFIG_USE_MULTINET is not set \ No newline at end of file diff --git a/configs/defconfig.esp32s2 b/configs/defconfig.esp32s2 index 28ca6c4cc..8ebfb8559 100644 --- a/configs/defconfig.esp32s2 +++ b/configs/defconfig.esp32s2 @@ -14,7 +14,6 @@ CONFIG_COMPILER_WARN_WRITE_STRINGS=y # CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32S2_SPIRAM_SUPPORT=y -# CONFIG_SPIRAM_BOOT_INIT is not set CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0 @@ -74,3 +73,5 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +# CONFIG_USE_WAKENET is not set +# CONFIG_USE_MULTINET is not set \ No newline at end of file diff --git a/configs/defconfig.esp32s3 b/configs/defconfig.esp32s3 index 8de433aff..8a8042e75 100644 --- a/configs/defconfig.esp32s3 +++ b/configs/defconfig.esp32s3 @@ -14,7 +14,6 @@ CONFIG_BLE_MESH=y # CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32S3_SPIRAM_SUPPORT=y -# CONFIG_SPIRAM_BOOT_INIT is not set CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0 @@ -76,3 +75,7 @@ CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +CONFIG_SR_WN_MODEL_WN8_QUANT=y +CONFIG_SR_WN_WN8_HIESP=y +CONFIG_SR_MN_ENGLISH=y +CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8=y \ No newline at end of file diff --git a/configs/defconfig.opi_flash b/configs/defconfig.opi similarity index 100% rename from configs/defconfig.opi_flash rename to configs/defconfig.opi diff --git a/configs/defconfig.opi_ram b/configs/defconfig.opi_ram index 8e157ad01..16e6a278c 100644 --- a/configs/defconfig.opi_ram +++ b/configs/defconfig.opi_ram @@ -1 +1,3 @@ -CONFIG_SPIRAM_MODE_OCT=y \ No newline at end of file +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +# CONFIG_SPIRAM_MEMTEST is not set \ No newline at end of file diff --git a/configs/defconfig.qio_ram b/configs/defconfig.qio_ram new file mode 100644 index 000000000..902680b3a --- /dev/null +++ b/configs/defconfig.qio_ram @@ -0,0 +1 @@ +# CONFIG_SPIRAM_BOOT_INIT is not set \ No newline at end of file diff --git a/tools/copy-libs.sh b/tools/copy-libs.sh index 8e19c23e6..0c06f4b2b 100755 --- a/tools/copy-libs.sh +++ b/tools/copy-libs.sh @@ -196,7 +196,7 @@ for item; do add_next=0 is_script=0 is_dir=0 - elif [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" ]]; then + 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 LD_FLAGS+="$item " PIO_LD_FLAGS+="$item " fi @@ -359,6 +359,7 @@ for item; do done fi done +echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", env.BoardConfig().get(\"build.arduino.memory_type\", \"$MEMCONF\"), \"include\")," >> "$AR_PLATFORMIO_PY" echo " join(FRAMEWORK_DIR, \"cores\", env.BoardConfig().get(\"build.core\"))" >> "$AR_PLATFORMIO_PY" echo " ]," >> "$AR_PLATFORMIO_PY" echo "" >> "$AR_PLATFORMIO_PY" @@ -383,7 +384,7 @@ done echo " LIBPATH=[" >> "$AR_PLATFORMIO_PY" echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"lib\")," >> "$AR_PLATFORMIO_PY" echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"ld\")," >> "$AR_PLATFORMIO_PY" -echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", \"$MEMCONF\")" >> "$AR_PLATFORMIO_PY" +echo " join(FRAMEWORK_DIR, \"tools\", \"sdk\", \"$IDF_TARGET\", env.BoardConfig().get(\"build.arduino.memory_type\", \"$MEMCONF\"))" >> "$AR_PLATFORMIO_PY" echo " ]," >> "$AR_PLATFORMIO_PY" echo "" >> "$AR_PLATFORMIO_PY" @@ -473,7 +474,8 @@ echo "#define CONFIG_ARDUINO_IDF_COMMIT \"$IDF_COMMIT\"" >> "$AR_SDK/include/con echo "#define CONFIG_ARDUINO_IDF_BRANCH \"$IDF_BRANCH\"" >> "$AR_SDK/include/config/sdkconfig.h" # Handle Mem Variants -mkdir -p "$AR_SDK/$MEMCONF" +mkdir -p "$AR_SDK/$MEMCONF/include" +mv "$AR_SDK/include/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h" for mem_variant in `jq -c '.mem_variants_files[]' configs/builds.json`; do file=$(echo "$mem_variant" | jq -c '.file' | tr -d '"') out=$(echo "$mem_variant" | jq -c '.out' | tr -d '"') diff --git a/tools/copy-mem-variant.sh b/tools/copy-mem-variant.sh index c7b4765e2..b9366ad75 100755 --- a/tools/copy-mem-variant.sh +++ b/tools/copy-mem-variant.sh @@ -21,9 +21,14 @@ source ./tools/config.sh echo "IDF_TARGET: $IDF_TARGET, MEMCONF: $MEMCONF" +# Add IDF versions to sdkconfig +echo "#define CONFIG_ARDUINO_IDF_COMMIT \"$IDF_COMMIT\"" >> "build/config/sdkconfig.h" +echo "#define CONFIG_ARDUINO_IDF_BRANCH \"$IDF_BRANCH\"" >> "build/config/sdkconfig.h" + # Handle Mem Variants rm -rf "$AR_SDK/$MEMCONF" -mkdir -p "$AR_SDK/$MEMCONF" +mkdir -p "$AR_SDK/$MEMCONF/include" +mv "build/config/sdkconfig.h" "$AR_SDK/$MEMCONF/include/sdkconfig.h" for mem_variant in `jq -c '.mem_variants_files[]' configs/builds.json`; do file=$(echo "$mem_variant" | jq -c '.file' | tr -d '"') src=$(echo "$mem_variant" | jq -c '.src' | tr -d '"') diff --git a/tools/update-components.sh b/tools/update-components.sh index 76dbec07d..1c3391980 100755 --- a/tools/update-components.sh +++ b/tools/update-components.sh @@ -3,7 +3,8 @@ source ./tools/config.sh CAMERA_REPO_URL="/~https://github.com/espressif/esp32-camera.git" -FACE_REPO_URL="/~https://github.com/espressif/esp-dl.git" +DL_REPO_URL="/~https://github.com/espressif/esp-dl.git" +SR_REPO_URL="/~https://github.com/espressif/esp-sr.git" RMAKER_REPO_URL="/~https://github.com/espressif/esp-rainmaker.git" DSP_REPO_URL="/~https://github.com/espressif/esp-dsp.git" LITTLEFS_REPO_URL="/~https://github.com/joltwallet/esp_littlefs.git" @@ -63,14 +64,26 @@ fi if [ $? -ne 0 ]; then exit 1; fi # -# CLONE/UPDATE ESP-FACE +# CLONE/UPDATE ESP-DL # -if [ ! -d "$AR_COMPS/esp-face" ]; then - git clone $FACE_REPO_URL "$AR_COMPS/esp-face" +if [ ! -d "$AR_COMPS/esp-dl" ]; then + git clone $DL_REPO_URL "$AR_COMPS/esp-dl" else - git -C "$AR_COMPS/esp-face" fetch && \ - git -C "$AR_COMPS/esp-face" 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 + +# +# CLONE/UPDATE 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 @@ -93,8 +106,13 @@ if [ $? -ne 0 ]; then exit 1; fi # if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then - git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" - git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3 + git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \ + git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive + # git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3 +else + 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 @@ -104,10 +122,10 @@ if [ $? -ne 0 ]; then exit 1; fi if [ ! -d "$AR_COMPS/esp-dsp" ]; then git clone $DSP_REPO_URL "$AR_COMPS/esp-dsp" - cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"` - echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt" - echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt" - echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt" + # cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"` + # echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt" + # echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt" + # echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt" else git -C "$AR_COMPS/esp-dsp" fetch && \ git -C "$AR_COMPS/esp-dsp" pull --ff-only