ESPSomfy-RTS/platformio.ini
cjkas a1622e652d build: move to pioarduino 55.03.312 (Arduino 3.3.12, ESP-IDF 5.5)
IDF 4.4 gets no more security fixes, and the planned RMT radio needs
IDF 5's RMT driver.  See docs/adr/0003-pioarduino-idf55.md.

- Every env on one pinned pioarduino release.  C6 drops its own
  library list and flags but stays a debug build on huge_app.
- Release envs build at CORE_DEBUG_LEVEL=2 so the ESP32 image fits its
  1.5 MB OTA slot (17 KB free); debug envs stay at 3.
- Drop the C3: its image is 76.5 KB over the OTA slot on IDF 5.5.
- CI installs pioarduino's Core and checks firmware.bin against the app
  partition, failing under 8 KB free.  PlatformIO's "Flash:" figure
  reads ~45 KB low and passed a C3 image that doesn't fit.
- esp_task_wdt_reconfigure(): on 3.x the core already starts the watchdog
  and esp_task_wdt_init() fails, so the C6 build kept the 5 s default.
- An updated firmware is kept only once it has run 60 s with the
  network up; a reset before then rolls back to the previous one.
- ETH.begin() takes the 3.x argument order; Arduino 2.x branches gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 22:05:22 +02:00

113 lines
3.8 KiB
INI

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = esp32devdbg
src_dir = src
; Shared by every firmware env (they extend it). Kept out of [env] so the
; native test env doesn't inherit the Arduino framework and ESP32 libraries.
[esp32]
; pioarduino: Arduino 3.3.12 on ESP-IDF 5.5. Pinned to a release so an
; upgrade is its own PR (docs/adr/0003-pioarduino-idf55.md).
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.312/platform-espressif32.zip
framework = arduino
; Unit tests only run on the PC: pio test -e native
test_ignore = *
lib_deps =
bblanchon/ArduinoJson@^7.2.2
lsatan/SmartRC-CC1101-Driver-Lib@^2.5.7
knolleary/PubSubClient@^2.8
esp32async/ESPAsyncWebServer@^3.12.1
esp32async/AsyncTCP@^3.5.0
extra_scripts =
pre:app_version.py
pre:minify.py
post:archive_elf.py
board_build.filesystem = littlefs
; Each env adds a CORE_DEBUG_LEVEL: 2 (warnings) for release builds, which
; only fit the 1.5 MB OTA slot without the info logs, 3 for debug builds.
build_flags =
-DCONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=1
-DCONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=1
-DCONFIG_ESP_COREDUMP_CHECKSUM_CRC32=1
-DCONFIG_ESP_TASK_WDT_PANIC=1
-DCONFIG_ESP_COREDUMP_DECODE_INFO=1
; Route log_printfv through src/LogLock.cpp so lines from both cores don't
; interleave. The core already wraps log_printf for ESP Insights.
-Wl,--wrap=log_printfv
monitor_speed = 115200
monitor_filters =
time
esp32_exception_decoder
log2file
; Dual-core targets: keep the async web/socket task on core 0 so the radio
; task on core 1 (with loop()) never competes with network handling.
[dualcore]
build_flags =
${esp32.build_flags}
-DCONFIG_ASYNC_TCP_RUNNING_CORE=0
[env:esp32dev]
extends = esp32
board = esp32dev
board_build.partitions = esp32_3MB.csv
build_flags =
${dualcore.build_flags}
-DCORE_DEBUG_LEVEL=2
[env:esp32devdbg]
extends = esp32
board = esp32dev
build_type = debug
; One 3 MB app slot and no OTA: the debug build is never shipped and outgrew
; the 1.5 MB OTA slot. Release envs keep esp32_3MB.csv. NVS stays at 0x9000
; but the file system shrinks, so moving a board to this table means: take a
; backup, flash over USB with -t upload -t uploadfs, then restore the backup.
board_build.partitions = esp32_huge_app.csv
; -Og only limits inlining in units over large-unit-insns (10000 by default).
; Smaller files inline ArduinoJson's helpers into every caller, which costs
; KBs of flash per file, so treat every file as large.
build_flags =
${dualcore.build_flags}
-DCORE_DEBUG_LEVEL=3
--param=large-unit-insns=1000
[env:esp32s3]
extends = esp32
board = esp32-s3-devkitc-1
build_flags =
${dualcore.build_flags}
-DCORE_DEBUG_LEVEL=2
; Released as a debug build with one 3 MB app slot, so C6 boards update over
; USB, not OTA.
[env:esp32c6]
extends = esp32
board = seeed_xiao_esp32c6
build_type = debug
board_build.partitions = esp32_huge_app.csv
build_flags =
${esp32.build_flags}
-DCORE_DEBUG_LEVEL=3
; Host-side unit tests: pio test -e native (needs gcc/g++ on PATH).
; Only the sources the tests cover are built; test/stubs stands in for Arduino.h.
[env:native]
platform = native
test_framework = unity
test_build_src = yes
build_src_filter = -<*> +<Utils.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp> +<ShadeSensors.cpp> +<ShadeBehaviour.cpp> +<PulseDecoder.cpp> +<TxBuffer.cpp> +<RadioScheduler.cpp> +<ShadeRequests.cpp> +<entryPoints/MqttCommands.cpp> +<ModelSnapshot.cpp> +<ModelEditor.cpp> +<ShadeChanges.cpp>
build_flags =
-std=gnu++17
-Isrc
-Itest/stubs
-D_POSIX_THREAD_SAFE_FUNCTIONS