From 0bbc00cfa0b97089467bafe6bdc9b02e2a7769b5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 28 Jun 2026 16:38:12 +0200 Subject: [PATCH] [SYS] esp32_platform: update to 55.03.39 (#2329) * esp32_platform: update to 55.03.39 ## Summary - Add support for Python 3.14 - Improve ESP32 platform and framework compatibility. - Update board support and toolchain integrations. - Fix stability and hardware-specific issues across supported ESP32 targets. - Release notes: - [55.03.39](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.39) - [55.03.38](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.38) - [55.03.37](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.37) - [55.03.36](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.36) - [55.03.35](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.35) - [55.03.34](https://github.com/pioarduino/platform-espressif32/releases/tag/55.03.34) * update build to use python 3.14 with platformio 6.1.19 * Update esp32-arduino-lib-builder to v1.5 * [CI] Fix call8 link overflow on large Xtensa builds (IDF 5.5.4) The 55.03.39 / IDF 5.5.4 bump enlarges the precompiled libs enough that large Xtensa images (esp32 / esp32s3) overflow the call8 reach and fail to link with "dangerous relocation: call8: call target out of range". -mlongcalls (which makes calls linker-relaxable) is injected by esp32-arduino-libs into the framework compile but NOT into lib_deps (NimBLE-Arduino, ArduinoJson) or project sources. Add a project pre: extra_script (scripts/add_mlongcalls.py) that applies -mlongcalls to CCFLAGS/ASFLAGS, gated on the Xtensa MCUs (RISC-V c3 has no call8 and rejects the flag). Wired into [env]; the four esp32dev-*pilight* envs that set their own extra_scripts list it explicitly too, since PlatformIO replaces rather than merges extra_scripts. Also bump esp32-arduino-libs 0.1.5 -> 0.1.6, which restores the framework-side -mdisable-hardware-atomics / -fno-builtin-* flags that 0.1.5 dropped under IDF 5.5.4 (separate from the lib_deps call8 issue). Verified clean (0 call8): esp32dev-all-test, esp32dev-ble, theengs-bridge, theengs-plug, esp32dev-pilight (+cc1101); esp32c3 unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Florian Co-authored-by: Claude Opus 4.8 (1M context) --- .github/workflows/README.md | 6 +++--- .github/workflows/task-build.yml | 4 ++-- .github/workflows/task-docs.yml | 2 +- environments.ini | 16 ++++++++++++---- platformio.ini | 5 +++-- scripts/add_mlongcalls.py | 16 ++++++++++++++++ 6 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 scripts/add_mlongcalls.py diff --git a/.github/workflows/README.md b/.github/workflows/README.md index a082304..6987211 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -472,7 +472,7 @@ prepare → build (task-build.yml) → deploy → documentation (task-docs.yml) **Parameters**: - `python-version`: Python version to use (default: '3.13') -- `pio-version`: PlatformIO version to use (default: 'v6.1.18') +- `pio-version`: PlatformIO version to use (default: 'v6.1.19') - `environment-set`: Which set of environments to build: 'all' or 'ci' (default: 'all') - `enable-dev-ota`: Enable development OTA builds (default: false) - `version-tag`: Optional version tag to pass to ci.sh build - omitted if empty (default: '') @@ -501,7 +501,7 @@ prepare → build (task-build.yml) → deploy → documentation (task-docs.yml) **Technical Details**: - Runs on: Ubuntu latest -- PlatformIO version: Configurable via `pio-version` input (default: v6.1.18, custom fork: `pioarduino/platformio-core`) +- PlatformIO version: Configurable via `pio-version` input (default: v6.1.19, custom fork: `pioarduino/platformio-core`) - Python package manager: `uv` (astral-sh/setup-uv@v6) - Environment sets: `all` (complete set) or `ci` (subset for quick validation) - Strategy: Matrix with fail-fast: false (builds complete even if one environment fails) @@ -743,7 +743,7 @@ All build environments are defined in `.github/workflows/environments.json`: - Provides consistent CLI across all operations **Build System** (`ci.sh build`): -- PlatformIO 6.1.18 from custom fork: `pioarduino/platformio-core` +- PlatformIO 6.1.19 from custom fork: `pioarduino/platformio-core` - Python package manager: `uv` for fast dependency installation - Orchestrator: `ci_build.sh` - Worker: `ci_build_firmware.sh` (PlatformIO compilation) diff --git a/.github/workflows/task-build.yml b/.github/workflows/task-build.yml index 88b356d..7b96ca9 100644 --- a/.github/workflows/task-build.yml +++ b/.github/workflows/task-build.yml @@ -7,12 +7,12 @@ on: description: "Python version to use" required: false type: string - default: "3.13" + default: "3.14" pio-version: description: "PlatformIO version to use" required: false type: string - default: "v6.1.18" + default: "v6.1.19" environment-set: description: 'Which set of environments to build (all, ci)' required: false diff --git a/.github/workflows/task-docs.yml b/.github/workflows/task-docs.yml index 4c4c73f..169a2f2 100644 --- a/.github/workflows/task-docs.yml +++ b/.github/workflows/task-docs.yml @@ -47,7 +47,7 @@ on: description: "PlatformIO version to use" required: false type: string - default: "v6.1.18" + default: "v6.1.19" secrets: github-token: description: "GitHub token for deploying to GitHub Pages" diff --git a/environments.ini b/environments.ini index c60cca2..3c3a72d 100644 --- a/environments.ini +++ b/environments.ini @@ -293,7 +293,9 @@ custom_description = RF gateway using RCSwitch library [env:esp32dev-pilight] platform = ${com.esp32_platform} platform_packages = ${com.esp32_platform_packages} -extra_scripts = pre:scripts/add_c_flags.py +extra_scripts = + pre:scripts/add_c_flags.py + pre:scripts/add_mlongcalls.py board = esp32dev board_build.partitions = min_spiffs.csv lib_deps = @@ -308,7 +310,9 @@ custom_description = RF gateway using ESPilight library [env:esp32dev-pilight-cc1101] platform = ${com.esp32_platform} platform_packages = ${com.esp32_platform_packages} -extra_scripts = pre:scripts/add_c_flags.py +extra_scripts = + pre:scripts/add_c_flags.py + pre:scripts/add_mlongcalls.py board = esp32dev board_build.partitions = min_spiffs.csv lib_deps = @@ -341,7 +345,9 @@ custom_description = Gateway using Somfy Remote library, need CC1101 [env:esp32dev-pilight-somfy-cc1101] platform = ${com.esp32_platform} platform_packages = ${com.esp32_platform_packages} -extra_scripts = pre:scripts/add_c_flags.py +extra_scripts = + pre:scripts/add_c_flags.py + pre:scripts/add_mlongcalls.py board = esp32dev board_build.partitions = min_spiffs.csv lib_deps = @@ -1264,7 +1270,9 @@ custom_description = Multi RF library with the possibility to switch between RTL [env:esp32dev-multi_receiver-pilight] platform = ${com.esp32_platform} platform_packages = ${com.esp32_platform_packages} -extra_scripts = pre:scripts/add_c_flags.py +extra_scripts = + pre:scripts/add_c_flags.py + pre:scripts/add_mlongcalls.py board = esp32dev board_build.partitions = min_spiffs.csv lib_deps = diff --git a/platformio.ini b/platformio.ini index 678ed3c..23339aa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -176,11 +176,12 @@ build_flags = ; -E ; generate precompiled source file (.pio/build/*/src/main.ino.cpp.o), use for precompilator debuging only (prevent compilation to succeed) ; '-DLOG_LEVEL=LOG_LEVEL_TRACE' ; Enable trace level logging monitor_speed = 115200 +extra_scripts = pre:scripts/add_mlongcalls.py [com] esp8266_platform = espressif8266@4.2.1 -esp32_platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.33/platform-espressif32.zip -esp32_platform_packages = framework-arduinoespressif32-libs @ https://github.com/theengs/esp32-arduino-lib-builder/releases/download/0.1.4/esp32-arduino-libs.tar.gz +esp32_platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip +esp32_platform_packages = framework-arduinoespressif32-libs @ https://github.com/theengs/esp32-arduino-lib-builder/releases/download/0.1.6/esp32-arduino-libs.tar.gz esp32_solo_platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.02.00/platform-espressif32.zip atmelavr_platform = atmelavr@3.3.0 diff --git a/scripts/add_mlongcalls.py b/scripts/add_mlongcalls.py new file mode 100644 index 0000000..b63a4a1 --- /dev/null +++ b/scripts/add_mlongcalls.py @@ -0,0 +1,16 @@ +# Apply -mlongcalls to the whole build (project sources + lib_deps) on Xtensa +# ESP32 targets. The precompiled esp32-arduino-libs only inject -mlongcalls into +# the framework compile, not into lib_deps (NimBLE, ArduinoJson) or project +# sources. For large images (OMG is ~90% of a 2 MB partition on IDF 5.5.4 libs) +# the resulting fixed-range call8 relocations overflow and the link fails with +# "dangerous relocation: call8: call target out of range". +# RISC-V targets (esp32c*/h*/p4) have no call8 and reject -mlongcalls, so this is +# restricted to the Xtensa MCUs. Guarded so nothing is duplicated. +Import("env") + +mcu = env.BoardConfig().get("build.mcu", "") +if mcu in ("esp32", "esp32s2", "esp32s3"): + if "-mlongcalls" not in env.get("CCFLAGS", []): + env.Append(CCFLAGS=["-mlongcalls"]) + if "-mlongcalls" not in env.get("ASFLAGS", []): + env.Append(ASFLAGS=["-mlongcalls"])