diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5c7b2b2da..800c3479a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,23 +1,26 @@ -name: IDF v5.1 +name: S3 OPI 120Mhz on: workflow_dispatch: # Manually start a workflow jobs: build-libs: name: Build Arduino Libs - runs-on: ubuntu-22.04 + runs-on: macos-14 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: bash ./tools/prepare-ci.sh + - name: Get current branch + run: | + echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV - name: Build Arduino Libs run: bash ./build.sh - name: Release - uses: jason2866/action-gh-release@v1.2 + uses: jason2866/action-gh-release@v1.3 with: tag_name: ${{ github.run_number }} body_path: release-info.txt diff --git a/.gitignore b/.gitignore index 2d74868b1..99ced40ba 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ version.txt dependencies.lock managed_components/ target/ +core_version.h +package.json +release-info.txt diff --git a/README.md b/README.md index 6e94b2775..9e78ce862 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ This repository contains the scripts that produce the libraries included with Ta ### Build on Ubuntu ```bash -sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python3 python3-pip python3-setuptools python3-serial python3-click python3-cryptography python3-future python3-pyparsing python3-pyelftools cmake ninja-build ccache jq p7zip-full -sudo pip3 install --upgrade pip3 +sudo apt update && sudo apt install -y git wget curl libssl-dev libncurses-dev flex bison gperf python3 cmake ninja-build ccache jq +curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && \ +pip3 install setuptools pyserial click future wheel cryptography pyparsing pyelftools git clone https://github.com/Jason2866/esp32-arduino-lib-builder cd esp32-arduino-lib-builder ./build.sh diff --git a/build.sh b/build.sh index 99357c274..2ed1d610b 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ if ! [ -x "$(command -v git)" ]; then exit 1 fi -TARGET="all" +export TARGET="all" BUILD_TYPE="all" SKIP_ENV=0 COPY_OUT=0 @@ -144,9 +144,10 @@ mkdir -p "$AR_TOOLS/esp32-arduino-libs" rm -rf release-info.txt IDF_Commit_short=$(git -C "$IDF_PATH" rev-parse --short HEAD || echo "") AR_Commit_short=$(git -C "$AR_COMPS/arduino" rev-parse --short HEAD || echo "") -echo "Framework built from -- $IDF_REPO branch [$IDF_BRANCH](https://github.com/$IDF_REPO/tree/$IDF_BRANCH) commit [$IDF_Commit_short](https://github.com/$IDF_REPO/commits/$IDF_BRANCH/#:~:text=$IDF_Commit_short) -- $AR_REPO branch [$AR_BRANCH](https://github.com/$AR_REPO/tree/$AR_BRANCH) commit [$AR_Commit_short](https://github.com/$AR_REPO/commits/$AR_BRANCH/#:~:text=$AR_Commit_short)" >> release-info.txt +echo "Framework built from +- $IDF_REPO branch [$IDF_BRANCH](https://github.com/$IDF_REPO/tree/$IDF_BRANCH) commit [$IDF_Commit_short](https://github.com/$IDF_REPO/commits/$IDF_BRANCH/#:~:text=$IDF_Commit_short) +- $AR_REPO branch [$AR_BRANCH](https://github.com/$AR_REPO/tree/$AR_BRANCH) commit [$AR_Commit_short](https://github.com/$AR_REPO/commits/$AR_BRANCH/#:~:text=$AR_Commit_short) +- Arduino lib builder branch: $GIT_BRANCH" >> release-info.txt #targets_count=`jq -c '.targets[] | length' configs/builds.json` for target_json in `jq -c '.targets[]' configs/builds.json`; do @@ -234,6 +235,8 @@ for component in `ls "$AR_MANAGED_COMPS"`; do fi done +export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD) + # update package_esp32_index.template.json if [ "$BUILD_TYPE" = "all" ]; then python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -j "$AR_COMPS/arduino/package/package_esp32_index.template.json" -o "$AR_OUT/" @@ -241,12 +244,29 @@ if [ "$BUILD_TYPE" = "all" ]; then if [ $? -ne 0 ]; then exit 1; fi fi -# Generate PlatformIO manifest file +# Generate PlatformIO library manifest file if [ "$BUILD_TYPE" = "all" ]; then - python3 ./tools/gen_platformio_manifest.py -o "$TOOLS_JSON_OUT/" -s $(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD) -c $(git -C "$IDF_PATH" rev-parse --short HEAD) + python3 ./tools/gen_pio_lib_manifest.py -o "$TOOLS_JSON_OUT/" -s "v$IDF_VERSION" -c "$IDF_COMMIT" if [ $? -ne 0 ]; then exit 1; fi fi +AR_VERSION=$(jq -c '.version' "$AR_COMPS/arduino/package.json" | tr -d '"') +AR_VERSION_UNDERSCORE=`echo "$AR_VERSION" | tr . _` + +# Generate PlatformIO framework manifest file +rm -rf "$AR_ROOT/package.json" +if [ "$BUILD_TYPE" = "all" ]; then + python3 ./tools/gen_pio_frmwk_manifest.py -o "$AR_ROOT/" -s "v$AR_VERSION" -c "$IDF_COMMIT" + if [ $? -ne 0 ]; then exit 1; fi +fi + +# Generate core_version.h +rm -rf "$AR_ROOT/core_version.h" +echo "#define ARDUINO_ESP32_GIT_VER 0x$AR_Commit_short +#define ARDUINO_ESP32_GIT_DESC $AR_VERSION +#define ARDUINO_ESP32_RELEASE_$AR_VERSION_UNDERSCORE +#define ARDUINO_ESP32_RELEASE \"$AR_VERSION_UNDERSCORE\"" >> "$AR_ROOT/core_version.h" + # copy everything to arduino-esp32 installation if [ $COPY_OUT -eq 1 ] && [ -d "$ESP32_ARDUINO" ]; then ./tools/copy-to-arduino.sh diff --git a/configs/builds.json b/configs/builds.json index 2de37abeb..02695519c 100644 --- a/configs/builds.json +++ b/configs/builds.json @@ -134,15 +134,23 @@ "idf_libs":["qio","80m","opi_ram"], "bootloaders":[ ["qio","120m","qio_ram"], + ["qio","120m","opi_ram"], ["qio","80m","qio_ram"], ["qio","80m","opi_ram"], + ["opi","120m","qio_ram"], + ["opi","120m","opi_ram"], + ["opi","80m","qio_ram"], ["opi","80m","opi_ram"] ], "mem_variants":[ ["qio","120m","qio_ram"], + ["qio","120m","opi_ram"], ["qio","80m","qio_ram"], - ["opi","80m","opi_ram"], - ["opi","80m","qio_ram"] + ["qio","80m","opi_ram"], + ["opi","120m","qio_ram"], + ["opi","120m","opi_ram"], + ["opi","80m","qio_ram"], + ["opi","80m","opi_ram"] ] } ] diff --git a/configs/defconfig.120m b/configs/defconfig.120m index 2dd8e0253..11d11177f 100644 --- a/configs/defconfig.120m +++ b/configs/defconfig.120m @@ -1,2 +1,3 @@ CONFIG_ESPTOOLPY_FLASHFREQ_120M=y CONFIG_SPIRAM_SPEED_120M=y +CONFIG_SPI_FLASH_HPM_ENA=y diff --git a/configs/defconfig.common b/configs/defconfig.common index 896ef78e8..4a2be049d 100644 --- a/configs/defconfig.common +++ b/configs/defconfig.common @@ -1,18 +1,18 @@ CONFIG_AUTOSTART_ARDUINO=y # CONFIG_WS2812_LED_ENABLE is not set CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +CONFIG_APP_REPRODUCIBLE_BUILD=y CONFIG_COMPILER_HIDE_PATHS_MACROS=y CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y # CONFIG_APP_COMPILE_TIME_DATE is not set CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +CONFIG_BOOT_ROM_LOG_ALWAYS_OFF=y CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS=y CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_NONE=y CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y -CONFIG_BT_ENABLED=y -CONFIG_BT_STACK_NO_LOG=y -# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set -# CONFIG_BLE_MESH is not set +CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y +CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y @@ -34,14 +34,22 @@ CONFIG_ESP_TASK_WDT_PANIC=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096 CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y -CONFIG_ESP_WIFI_FTM_ENABLE=n +# CONFIG_ESP_WIFI_FTM_ENABLE is not set CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_CSI_ENABLED=n +# CONFIG_ESP_WIFI_CSI_ENABLED is not set CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +# CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT is not set +# CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=0 +# CONFIG_ESP_WIFI_MBEDTLS_CRYPTO is not set # CONFIG_ESP_WIFI_IRAM_OPT is not set # CONFIG_ESP_WIFI_RX_IRAM_OPT is not set +CONFIG_ETH_TRANSMIT_MUTEX=y CONFIG_ETH_SPI_ETHERNET_DM9051=y CONFIG_ETH_SPI_ETHERNET_W5500=y CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL=y @@ -92,13 +100,6 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_NEWLIB_NANO_FORMAT=y # CONFIG_DAC_DMA_AUTO_16BIT_ALIGN is not set -# CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set -# CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT is not set -# CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT is not set -# CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA is not set -CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=0 -# CONFIG_ESP_WIFI_MBEDTLS_CRYPTO is not set - CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_TLS_DISABLED=y @@ -188,6 +189,7 @@ CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y CONFIG_OPENSSL_ASSERT_DO_NOTHING=y CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=y +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2 CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 diff --git a/configs/defconfig.esp32 b/configs/defconfig.esp32 index 7ef4ac4cf..d15399735 100644 --- a/configs/defconfig.esp32 +++ b/configs/defconfig.esp32 @@ -1,8 +1,10 @@ -CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR=y # # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 @@ -11,17 +13,19 @@ CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 # CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY is not set # CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY is not set # CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +# CONFIG_BT_BTC_TASK_STACK_SIZE is not set +# CONFIG_BT_BTU_TASK_STACK_SIZE is not set +CONFIG_BT_STACK_NO_LOG=y +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y + +CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR=y CONFIG_ETH_ENABLED=y CONFIG_ETH_USE_ESP32_EMAC=y CONFIG_ETH_PHY_INTERFACE_RMII=y CONFIG_ETH_USE_SPI_ETHERNET=y -# CONFIG_BTDM_CTRL_MODE_BTDM is not set -# CONFIG_BT_BTC_TASK_STACK_SIZE is not set -# CONFIG_BT_BTU_TASK_STACK_SIZE is not set -CONFIG_BT_STACK_NO_LOG=y -CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y CONFIG_SPIRAM=y CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y CONFIG_ULP_COPROC_ENABLED=y diff --git a/configs/defconfig.esp32c2 b/configs/defconfig.esp32c2 index 2e3ecad3d..b0cb51820 100644 --- a/configs/defconfig.esp32c2 +++ b/configs/defconfig.esp32c2 @@ -5,6 +5,9 @@ CONFIG_XTAL_FREQ=26 # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 diff --git a/configs/defconfig.esp32c3 b/configs/defconfig.esp32c3 index 96296de58..c3c5f8518 100644 --- a/configs/defconfig.esp32c3 +++ b/configs/defconfig.esp32c3 @@ -2,6 +2,9 @@ # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 diff --git a/configs/defconfig.esp32c6 b/configs/defconfig.esp32c6 index 5aa525c0c..f2cfcded3 100644 --- a/configs/defconfig.esp32c6 +++ b/configs/defconfig.esp32c6 @@ -10,6 +10,9 @@ CONFIG_ULP_COPROC_RESERVE_MEM=8192 # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 diff --git a/configs/defconfig.esp32h2 b/configs/defconfig.esp32h2 index 96296de58..c3c5f8518 100644 --- a/configs/defconfig.esp32h2 +++ b/configs/defconfig.esp32h2 @@ -2,6 +2,9 @@ # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 diff --git a/configs/defconfig.esp32s2 b/configs/defconfig.esp32s2 index 7aad2865d..23842a80b 100644 --- a/configs/defconfig.esp32s2 +++ b/configs/defconfig.esp32s2 @@ -1,6 +1,9 @@ -CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_SPIRAM=y +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y +CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y +CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y CONFIG_ESP32S2_KEEP_USB_ALIVE=y CONFIG_ULP_COPROC_ENABLED=y CONFIG_ESP32_ULP_COPROC_RISCV=y diff --git a/configs/defconfig.esp32s3 b/configs/defconfig.esp32s3 index 0a4aae470..5a96b55b8 100644 --- a/configs/defconfig.esp32s3 +++ b/configs/defconfig.esp32s3 @@ -1,10 +1,15 @@ +CONFIG_IDF_EXPERIMENTAL_FEATURES=y + CONFIG_ULP_COPROC_ENABLED=y CONFIG_ULP_COPROC_TYPE_RISCV=y CONFIG_ULP_COPROC_RESERVE_MEM=4096 CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_SPIRAM=y +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y +CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y CONFIG_RTC_CLK_CAL_CYCLES=576 CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set @@ -12,6 +17,7 @@ CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3120 CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n +CONFIG_BOOTLOADER_FLASH_DC_AWARE=y # # S3 Display shift fix -> https://espressif-docs.readthedocs-hosted.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html @@ -22,6 +28,9 @@ CONFIG_LCD_RGB_RESTART_IN_VSYNC=y # Bluetooth # CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1 diff --git a/core_version.h b/core_version.h deleted file mode 100644 index 468a2459e..000000000 --- a/core_version.h +++ /dev/null @@ -1,4 +0,0 @@ -#define ARDUINO_ESP32_GIT_VER 0xcbaeab4e -#define ARDUINO_ESP32_GIT_DESC 3.0.0 -#define ARDUINO_ESP32_RELEASE_3_0_0 -#define ARDUINO_ESP32_RELEASE "3_0_0" diff --git a/package.json b/package.json deleted file mode 100644 index c184e5481..000000000 --- a/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "framework-arduinoespressif32", - "version": "3.0.0", - "description": "Tasmota Arduino Framework for the Espressif ESP32, ESP32-S and ESP32-C series of SoCs", - "keywords": [ - "tasmota", - "framework", - "arduino", - "espressif", - "esp32" - ], - "license": "LGPL-2.1-or-later", - "repository": { - "type": "git", - "url": "https://github.com/tasmota/arduino-esp32" - } -} diff --git a/tools/archive-build.sh b/tools/archive-build.sh index 109ecf6fc..1f7b48955 100755 --- a/tools/archive-build.sh +++ b/tools/archive-build.sh @@ -1,13 +1,11 @@ #!/bin/bash -IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD || echo "") -IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD || echo "") idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT" -archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz" -build_archive_path="dist/arduino-esp32-build-$idf_version_string.tar.gz" -pio_archive_path="dist/framework-arduinoespressif32-$idf_version_string.tar.gz" -pio_zip_archive_path="dist/framework-arduinoespressif32-$idf_version_string.zip" +archive_path="dist/arduino-esp32-libs-$TARGET-$idf_version_string.tar.gz" +build_archive_path="dist/arduino-esp32-build-$TARGET-$idf_version_string.tar.gz" +pio_archive_path="dist/framework-arduinoespressif32-$TARGET-$idf_version_string.tar.gz" +pio_zip_archive_path="dist/framework-arduinoespressif32-$TARGET-$idf_version_string.zip" mkdir -p dist && rm -rf "$archive_path" "$build_archive_path" @@ -40,12 +38,11 @@ rm -rf arduino-esp32/libraries/TFLiteMicro rm -rf arduino-esp32/libraries/ESP32 rm -rf arduino-esp32/package rm -rf arduino-esp32/tools/esp32-arduino-libs +rm -rf arduino-esp32/tools/*.exe rm -rf arduino-esp32/tools/esptool.py rm -rf arduino-esp32/tools/get.py -rm -rf arduino-esp32/tools/get.exe rm -rf arduino-esp32/tools/ide-debug rm -rf arduino-esp32/tools/gen_insights_package.py -rm -rf arduino-esp32/tools/gen_insights_package.exe rm -rf arduino-esp32/platform.txt rm -rf arduino-esp32/programmers.txt rm -rf arduino-esp32/boards.txt diff --git a/tools/config.sh b/tools/config.sh index fe8a65d4f..94472f03a 100755 --- a/tools/config.sh +++ b/tools/config.sh @@ -6,7 +6,7 @@ if [ -z $IDF_PATH ]; then fi if [ -z $IDF_BRANCH ]; then - IDF_BRANCH="release/v5.1" + export IDF_BRANCH="release/v5.1" fi # Arduino branch to use @@ -60,17 +60,20 @@ TOOLS_JSON_OUT="$AR_TOOLS/esp32-arduino-libs" IDF_LIBS_DIR="$AR_ROOT/../esp32-arduino-libs" if [ "$IDF_COMMIT" ]; then - echo "Using IDF commit $IDF_COMMIT" export IDF_COMMIT -elif [ -d "$IDF_PATH" ]; then - export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD) - export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD) fi +if [ -d "$IDF_PATH" ]; then + export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD) +fi + +echo "Using IDF branch $IDF_BRANCH" +echo "Using IDF commit $IDF_COMMIT" + if [ "$AR_COMMIT" ]; then - echo "Using commit $AR_COMMIT for Arduino" + echo "Using Arduino commit $AR_COMMIT" else - AR_COMMIT=$(git -C "$AR_COMPS/arduino" rev-parse --short HEAD || echo "") + export AR_COMMIT=$(git -C "$AR_COMPS/arduino" rev-parse --short HEAD || echo "") fi #rm -rf release-info.txt @@ -103,6 +106,7 @@ function get_os(){ AR_OS=`get_os` export SED="sed" +export AWK="awk" export SSTAT="stat -c %s" if [[ "$AR_OS" == "macos" ]]; then @@ -115,6 +119,7 @@ if [[ "$AR_OS" == "macos" ]]; then exit 1 fi export SED="gsed" + export AWK="gawk" export SSTAT="stat -f %z" fi diff --git a/tools/gen_pio_frmwk_manifest.py b/tools/gen_pio_frmwk_manifest.py new file mode 100644 index 000000000..e3e84629a --- /dev/null +++ b/tools/gen_pio_frmwk_manifest.py @@ -0,0 +1,89 @@ +import argparse +import json +import os +import re +import sys +import datetime + +MANIFEST_DATA = { + "name": "framework-arduinoespressif32", + "description": "Platformio Tasmota Arduino framework for the Espressif ESP32 series of SoCs", + "keywords": ["framework", "tasmota", "arduino", "espressif", "esp32"], + "license": "LGPL-2.1-or-later", + "repository": { + "type": "git", + "url": "https://github.com/tasmota/arduino-esp32", + }, +} + + +def convert_version(version_string): + """A helper function that converts a custom IDF version string + extracted from a Git repository to a suitable SemVer alternative. For example: + 'release/v5.1' becomes '5.1.0', + 'v7.7.7' becomes '7.7.7' + """ + + regex_pattern = ( + r"v(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.*(?P0|[1-9]\d*)*" + ) + match = re.search(regex_pattern, version_string) + if not match: + sys.stderr.write( + f"Failed to find a regex match for '{regex_pattern}' in '{version_string}'\n" + ) + return "" + + major, minor, patch = match.groups() + if not patch: + patch = "0" + + return ".".join((major, minor, patch)) + + +def main(dst_dir, version_string, commit_hash): + + converted_version = convert_version(version_string) + if not converted_version: + sys.stderr.write(f"Failed to convert version '{version_string}'\n") + return -1 + + manifest_file_path = os.path.join(dst_dir, "package.json") + build_date = datetime.date.today() + with open(manifest_file_path, "w", encoding="utf8") as fp: + MANIFEST_DATA["version"] = f"{converted_version}+sha.{commit_hash}" + MANIFEST_DATA["date"] = f"{build_date}" + json.dump(MANIFEST_DATA, fp, indent=2) + + print( + f"Generated PlatformIO framework manifest file '{manifest_file_path}' with '{converted_version}' version" + ) + return 0 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "-o", + "--dst-dir", + dest="dst_dir", + required=True, + help="Destination folder where the 'package.json' manifest will be located", + ) + parser.add_argument( + "-s", + "--version-string", + dest="version_string", + required=True, + help="ESP-IDF version string used for compiling libraries", + ) + parser.add_argument( + "-c", + "--commit-hash", + dest="commit_hash", + required=True, + help="ESP-IDF revision in form of a commit hash", + ) + args = parser.parse_args() + + sys.exit(main(args.dst_dir, args.version_string, args.commit_hash)) diff --git a/tools/gen_platformio_manifest.py b/tools/gen_pio_lib_manifest.py similarity index 89% rename from tools/gen_platformio_manifest.py rename to tools/gen_pio_lib_manifest.py index 02057d9a2..22df9a730 100644 --- a/tools/gen_platformio_manifest.py +++ b/tools/gen_pio_lib_manifest.py @@ -7,7 +7,7 @@ MANIFEST_DATA = { "name": "framework-arduinoespressif32-libs", "description": "Precompiled libraries for Arduino Wiring-based Framework for the Espressif ESP32 series of SoCs", - "keywords": ["framework", "arduino", "espressif", "esp32"], + "keywords": ["framework", "tasmota", "arduino", "espressif", "esp32"], "license": "LGPL-2.1-or-later", "repository": { "type": "git", @@ -53,7 +53,7 @@ def main(dst_dir, version_string, commit_hash): json.dump(MANIFEST_DATA, fp, indent=2) print( - f"Generated PlatformIO manifest file '{manifest_file_path}' with '{converted_version}' version" + f"Generated PlatformIO libraries manifest file '{manifest_file_path}' with '{converted_version}' version" ) return 0 diff --git a/tools/gen_tools_json.py b/tools/gen_tools_json.py index ca53ec8cb..20d8f864b 100644 --- a/tools/gen_tools_json.py +++ b/tools/gen_tools_json.py @@ -59,7 +59,7 @@ if tool_name.endswith('-elf'): tool_name += '-gcc' print('Found {0}, version: {1}'.format(tool_name, tool_version)) - + if simple_output == False: dep_found = False dep_skip = False diff --git a/tools/install-arduino.sh b/tools/install-arduino.sh index 865dc3fbb..707fd7f4b 100755 --- a/tools/install-arduino.sh +++ b/tools/install-arduino.sh @@ -71,8 +71,10 @@ fi if [ $? -ne 0 ]; then exit 1; fi # -# remove libraries not needed for Tasmota +# remove code and libraries not needed/wanted for Tasmota framework # +rm -rf "$AR_COMPS/arduino/cores/esp32/chip-debug-report.cpp" +rm -rf "$AR_COMPS/arduino/cores/esp32/chip-debug-report.h" rm -rf "$AR_COMPS/arduino/libraries/RainMaker" rm -rf "$AR_COMPS/arduino/libraries/Insights" rm -rf "$AR_COMPS/arduino/libraries/ESP_I2S" diff --git a/tools/install-esp-idf.sh b/tools/install-esp-idf.sh index 45d3c21af..57150e7c7 100755 --- a/tools/install-esp-idf.sh +++ b/tools/install-esp-idf.sh @@ -37,7 +37,7 @@ if [ ! -d "$IDF_PATH" ]; then idf_was_installed="1" else # update existing branch - echo "ESP-IDF is already installed, updating branch '$IDF_BRANCH'" + echo "ESP-IDF is already installed, updating branch $IDF_BRANCH" cd $IDF_PATH git pull git reset --hard $IDF_BRANCH @@ -63,13 +63,17 @@ fi if [ ! -x $idf_was_installed ] || [ ! -x $commit_predefined ]; then git submodule update --recursive $IDF_PATH/install.sh - export IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD) - export IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD) # Temporarily patch the ESP32-S2 I2C LL driver to keep the clock source cd $IDF_PATH patch -p1 -N -i ../patches/esp32s2_i2c_ll_master_init.diff cd - + + # Get the exact IDF version from file "version.txt" + cd $IDF_PATH + export IDF_VERSION=$(