From 041a21c55e7811f5c1bfb9ff5970e52985c835c2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:40:24 +0000 Subject: [PATCH 1/8] git_sync: depend on espressif/cjson managed component for ESP-IDF 6.x --- components/git_sync/CMakeLists.txt | 17 ++++++++++++++++- components/git_sync/idf_component.yml | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 components/git_sync/idf_component.yml diff --git a/components/git_sync/CMakeLists.txt b/components/git_sync/CMakeLists.txt index a79d412..5cd74b9 100644 --- a/components/git_sync/CMakeLists.txt +++ b/components/git_sync/CMakeLists.txt @@ -1,5 +1,20 @@ +## ESP-IDF 6.0 moved the bundled cJSON ("json") component out of the +## core tree into the espressif/cjson managed component (see the +## ESP-IDF 6.0 protocols migration guide). The managed component +## registers under the name "cjson", so the PRIV_REQUIRES entry must +## switch from "json" (IDF <=5.x built-in) to "cjson" (IDF >=6.0 +## managed) depending on the running ESP-IDF version. The matching +## dependency declaration lives in idf_component.yml and is gated on +## the same idf_version >=6.0 rule so older IDFs keep using the +## built-in component without downloading it. +if(IDF_VERSION_MAJOR GREATER_EQUAL 6) + set(_git_sync_cjson_component cjson) +else() + set(_git_sync_cjson_component json) +endif() + idf_component_register( SRCS "git_sync.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_http_client esp-tls json sd_card wifi_manager nvs_flash + PRIV_REQUIRES esp_http_client esp-tls ${_git_sync_cjson_component} sd_card wifi_manager nvs_flash ) diff --git a/components/git_sync/idf_component.yml b/components/git_sync/idf_component.yml new file mode 100644 index 0000000..4eb682d --- /dev/null +++ b/components/git_sync/idf_component.yml @@ -0,0 +1,20 @@ +## IDF Component manifest for the git_sync component. +## +## git_sync parses GitHub REST API responses with cJSON. Through +## ESP-IDF 5.x, cJSON was bundled in-tree as the "json" core +## component and was pulled in via PRIV_REQUIRES alone. ESP-IDF 6.0 +## removed the bundled component and moved it to the +## espressif/cjson managed component (see the ESP-IDF 6.0 protocols +## migration guide). Declare the managed dependency only on IDF +## >=6.0 so that 5.x builds keep using the built-in "json" +## component (the matching PRIV_REQUIRES switch lives in +## CMakeLists.txt and keys off IDF_VERSION_MAJOR). +## +## See: +## https://components.espressif.com/components/espressif/cjson +## https://github.com/espressif/idf-extra-components/tree/master/cjson +dependencies: + espressif/cjson: + version: "^1.7.18" + rules: + - if: "idf_version >=6.0" From 24009cd5201de0042e4ced57f70cfcfd29996965 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:11:16 +0000 Subject: [PATCH 2/8] Add explicit esp_driver_* deps and gate epdiy to ESP-IDF <6.0 --- components/battery/CMakeLists.txt | 9 ++++++++- components/display/CMakeLists.txt | 9 ++++++++- components/display/idf_component.yml | 10 ++++++++++ components/sd_card/CMakeLists.txt | 9 ++++++++- components/standby/CMakeLists.txt | 7 ++++++- main/CMakeLists.txt | 9 ++++++++- 6 files changed, 48 insertions(+), 5 deletions(-) diff --git a/components/battery/CMakeLists.txt b/components/battery/CMakeLists.txt index 703c9f8..40337ac 100644 --- a/components/battery/CMakeLists.txt +++ b/components/battery/CMakeLists.txt @@ -1,5 +1,12 @@ idf_component_register( SRCS "battery.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_adc driver + ## ESP-IDF 6.0 removed the legacy `driver` component's public + ## dependencies on the split `esp_driver_*` components (see the + ## 6.0 peripherals migration guide). battery.cpp includes + ## `driver/gpio.h` and `driver/i2c_master.h`, so the matching + ## `esp_driver_gpio` and `esp_driver_i2c` components must be + ## listed explicitly. They also exist on IDF 5.3+, so the same + ## list works on older IDFs. + PRIV_REQUIRES esp_adc driver esp_driver_gpio esp_driver_i2c ) diff --git a/components/display/CMakeLists.txt b/components/display/CMakeLists.txt index 1e39743..b8cc1d6 100644 --- a/components/display/CMakeLists.txt +++ b/components/display/CMakeLists.txt @@ -1,7 +1,14 @@ idf_component_register( SRCS "display_rlcd.cpp" "display_epdiy.cpp" "epd_board_papers3.c" "display_axs15231b.cpp" "display_mipi_dsi.cpp" "lvgl_port.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES driver esp_lcd esp_timer lvgl__lvgl + ## ESP-IDF 6.0 removed the legacy `driver` component's public + ## dependencies on the split `esp_driver_*` components (see the + ## 6.0 peripherals migration guide). The display backends + ## directly include `driver/gpio.h`, `driver/spi_master.h`, + ## `driver/i2c_master.h`, and `driver/ledc.h`, so the matching + ## `esp_driver_*` components must be listed explicitly. They + ## also exist on IDF 5.3+, so the same list works on older IDFs. + PRIV_REQUIRES driver esp_driver_gpio esp_driver_spi esp_driver_i2c esp_driver_ledc esp_lcd esp_timer lvgl__lvgl ) # Inject the LVGL custom-allocator hooks (lv_mem_init / lv_malloc_core / diff --git a/components/display/idf_component.yml b/components/display/idf_component.yml index 8bc3a81..d5be3c7 100644 --- a/components/display/idf_component.yml +++ b/components/display/idf_component.yml @@ -36,11 +36,21 @@ dependencies: ## compile epd_board.h. display_epdiy.cpp is wrapped in ## `#if CONFIG_DRAFTLING_DISPLAY_EPDIY` so skipping the dep on ## non-epdiy targets is sufficient. + ## epdiy does not yet compile against ESP-IDF 6.x: its + ## `src/output_lcd/lcd_driver.c` includes `soc/lcd_periph.h`, + ## which was removed in IDF 6.0. Tracked upstream in + ## https://github.com/vroland/epdiy/issues/450. Until a fix lands, + ## gate the dependency to `idf_version <6.0` so non-epdiy boards + ## (Waveshare 3.49 / JC3248W535 / RLCD42, plus the ESP32-P4 Tab5) + ## can still build on IDF 6.x. epdiy-based boards (LilyGO T5 + ## Pro / Pro Lite, M5Stack PaperS3) must stay on ESP-IDF 5.3-5.5 + ## for now. vroland/epdiy: git: "https://github.com/vroland/epdiy.git" version: "a3426c0ec38f98282cf3ec33761e556f083b0f7c" rules: - if: "idf_version >=5.3.0" + - if: "idf_version <6.0" - if: "target != esp32p4" require: public ## espressif/m5stack_tab5 BSP, pulled in only for the ESP32-P4 diff --git a/components/sd_card/CMakeLists.txt b/components/sd_card/CMakeLists.txt index ec97784..af86d50 100644 --- a/components/sd_card/CMakeLists.txt +++ b/components/sd_card/CMakeLists.txt @@ -1,5 +1,12 @@ idf_component_register( SRCS "sd_card.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES fatfs sdmmc vfs driver + ## ESP-IDF 6.0 removed the legacy `driver` component's public + ## dependencies on the split `esp_driver_*` components (see the + ## 6.0 peripherals migration guide). sd_card.cpp includes + ## `driver/sdmmc_host.h`, `driver/sdspi_host.h`, + ## `driver/spi_common.h`, and `driver/gpio.h`, so the matching + ## `esp_driver_*` components must be listed explicitly. They + ## also exist on IDF 5.3+, so the same list works on older IDFs. + PRIV_REQUIRES fatfs sdmmc vfs driver esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_gpio ) diff --git a/components/standby/CMakeLists.txt b/components/standby/CMakeLists.txt index d56c9da..fddebf6 100644 --- a/components/standby/CMakeLists.txt +++ b/components/standby/CMakeLists.txt @@ -1,6 +1,11 @@ idf_component_register( SRCS "standby.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES nvs_flash esp_timer driver ble_keyboard display touchscreen power lvgl__lvgl + ## ESP-IDF 6.0 removed the legacy `driver` component's public + ## dependencies on the split `esp_driver_*` components (see the + ## 6.0 peripherals migration guide). standby.cpp includes + ## `driver/gpio.h` (now in esp_driver_gpio) and + ## `driver/rtc_io.h` (still in the legacy `driver` component). + PRIV_REQUIRES nvs_flash esp_timer driver esp_driver_gpio ble_keyboard display touchscreen power lvgl__lvgl ) idf_component_optional_requires(PRIVATE usb_kbd) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 94fe166..0cd9b61 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -4,7 +4,14 @@ ## init. We list it as a private requirement under a CONFIG guard so ## ESP32-S3 builds (which do not pull esp_hosted in at all) keep ## the same dependency set as before. -set(MAIN_PRIV_REQS display sd_card ble_keyboard editor wifi_manager git_sync standby battery touchscreen power nvs_flash bt esp_hid driver esp_event) +## ESP-IDF 6.0 removed the legacy `driver` component's public +## dependencies on the split `esp_driver_*` components (see the 6.0 +## peripherals migration guide). main.cpp includes +## `driver/spi_common.h`, `driver/spi_master.h`, `driver/gpio.h`, +## `driver/i2c_master.h` (now in esp_driver_spi / esp_driver_gpio / +## esp_driver_i2c) and `driver/rtc_io.h` (still in the legacy +## `driver` component). +set(MAIN_PRIV_REQS display sd_card ble_keyboard editor wifi_manager git_sync standby battery touchscreen power nvs_flash bt esp_hid driver esp_driver_gpio esp_driver_spi esp_driver_i2c esp_event) if(CONFIG_ESP_HOSTED_ENABLED) list(APPEND MAIN_PRIV_REQS espressif__esp_hosted) endif() From 6106e3bd1d93db8a72c9dc3e27ab363e7d032848 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:24:43 +0000 Subject: [PATCH 3/8] git_sync: use PSA Crypto for blob SHA-1 on ESP-IDF 6.x (Mbed TLS 4) --- components/git_sync/CMakeLists.txt | 6 +++++- components/git_sync/git_sync.cpp | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/components/git_sync/CMakeLists.txt b/components/git_sync/CMakeLists.txt index 5cd74b9..87ab7df 100644 --- a/components/git_sync/CMakeLists.txt +++ b/components/git_sync/CMakeLists.txt @@ -16,5 +16,9 @@ endif() idf_component_register( SRCS "git_sync.cpp" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_http_client esp-tls ${_git_sync_cjson_component} sd_card wifi_manager nvs_flash + ## mbedtls is needed for mbedtls_base64_* and for the PSA Crypto + ## API used by the git blob SHA-1 helper on ESP-IDF 6.x (Mbed + ## TLS 4.x removed the legacy mbedtls_sha1_* API; see the + ## ESP-IDF 6.0 security migration guide). + PRIV_REQUIRES esp_http_client esp-tls mbedtls ${_git_sync_cjson_component} sd_card wifi_manager nvs_flash ) diff --git a/components/git_sync/git_sync.cpp b/components/git_sync/git_sync.cpp index e3853e1..78e30aa 100644 --- a/components/git_sync/git_sync.cpp +++ b/components/git_sync/git_sync.cpp @@ -9,7 +9,16 @@ #include #include #include +#include +#if ESP_IDF_VERSION_MAJOR >= 6 +/* ESP-IDF 6.0 upgrades to Mbed TLS 4.x which removes the legacy + * `mbedtls/sha1.h` low-level API in favour of PSA Crypto (see the + * ESP-IDF 6.0 security migration guide). Use psa/crypto.h for the + * git blob SHA-1 helper instead. */ +#include +#else #include +#endif #include "git_sync.h" #include "sd_card.h" @@ -177,6 +186,17 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) char header[32]; int hlen = snprintf(header, sizeof(header), "blob %zu", len); +#if ESP_IDF_VERSION_MAJOR >= 6 + /* Mbed TLS 4.x removed the legacy mbedtls_sha1_* API; use PSA + * Crypto. ESP-IDF initialises PSA during normal startup, so no + * psa_crypto_init() call is needed here. */ + psa_hash_operation_t op = PSA_HASH_OPERATION_INIT; + size_t hash_len = 0; + psa_hash_setup(&op, PSA_ALG_SHA_1); + psa_hash_update(&op, (const unsigned char *)header, hlen + 1); + psa_hash_update(&op, (const unsigned char *)content, len); + psa_hash_finish(&op, hash, sizeof(hash), &hash_len); +#else mbedtls_sha1_context ctx; mbedtls_sha1_init(&ctx); mbedtls_sha1_starts(&ctx); @@ -184,6 +204,7 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) mbedtls_sha1_update(&ctx, (const unsigned char *)content, len); mbedtls_sha1_finish(&ctx, hash); mbedtls_sha1_free(&ctx); +#endif for (int i = 0; i < 20; i++) snprintf(out_hex + i * 2, 3, "%02x", hash[i]); From 6187791c58140e7a20a7adf8b102660d1a97ade4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:43:27 +0000 Subject: [PATCH 4/8] Drop ESP-IDF 5.x compatibility paths and refresh docs --- AGENTS.md | 6 +++--- README.md | 2 +- components/battery/CMakeLists.txt | 3 +-- components/display/CMakeLists.txt | 3 +-- components/display/idf_component.yml | 21 +++----------------- components/fonts/idf_component.yml | 2 +- components/git_sync/CMakeLists.txt | 27 ++++++++------------------ components/git_sync/git_sync.cpp | 23 ++++------------------ components/git_sync/idf_component.yml | 15 ++++---------- components/power/power.cpp | 2 +- components/sd_card/CMakeLists.txt | 3 +-- components/touchscreen/touchscreen.cpp | 2 +- components/usb_kbd/idf_component.yml | 2 +- main/idf_component.yml | 2 +- 14 files changed, 31 insertions(+), 82 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6caf0db..d415ac5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,7 +31,7 @@ Draftling is a distraction-free Markdown text editor for ESP32-S3-based development boards with reflective LCD displays. It is built with the -ESP-IDF framework (v5.3+) and uses LVGL v9 for the graphical interface. +ESP-IDF framework (v6.0+) and uses LVGL v9 for the graphical interface. The user connects a Bluetooth keyboard and edits Markdown files stored on a MicroSD card. The reflective LCD needs no backlight and works well in @@ -402,7 +402,7 @@ latch has no effect and the chip just deep-sleeps. The TCA9554 is reached over a dedicated I2C bus (SDA/SCL pins + address + latch bit all carried by `power_config_t` so this component stays board-agnostic). The bus is opened with the -ESP-IDF v5.x `i2c_master_*` API; we issue only two register writes +ESP-IDF `i2c_master_*` API; we issue only two register writes (Output and Configuration) so this component does not pull in a heavy `esp_io_expander_tca9554` dependency. @@ -613,7 +613,7 @@ only the enabled layout tables. ## Building -Requires ESP-IDF v5.3 or later (v5.3 - v5.5 confirmed working). +Requires ESP-IDF v6.0 or later. PSRAM is required on every supported board. The editor gap buffer (sized dynamically at startup from the PSRAM that is free when diff --git a/README.md b/README.md index 1034698..6392b50 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ can be independently enabled or disabled. By default **US-English** and ## Building Requires [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/) -v5.3 or later (v5.3 - v5.5 confirmed working). +v6.0 or later. Keep in mind that M5Stack Tab5 uses a different MCU, so the tatget should be set to 'esp32s4'. diff --git a/components/battery/CMakeLists.txt b/components/battery/CMakeLists.txt index 40337ac..0b2fdf0 100644 --- a/components/battery/CMakeLists.txt +++ b/components/battery/CMakeLists.txt @@ -6,7 +6,6 @@ idf_component_register( ## 6.0 peripherals migration guide). battery.cpp includes ## `driver/gpio.h` and `driver/i2c_master.h`, so the matching ## `esp_driver_gpio` and `esp_driver_i2c` components must be - ## listed explicitly. They also exist on IDF 5.3+, so the same - ## list works on older IDFs. + ## listed explicitly. PRIV_REQUIRES esp_adc driver esp_driver_gpio esp_driver_i2c ) diff --git a/components/display/CMakeLists.txt b/components/display/CMakeLists.txt index b8cc1d6..7d69ee4 100644 --- a/components/display/CMakeLists.txt +++ b/components/display/CMakeLists.txt @@ -6,8 +6,7 @@ idf_component_register( ## 6.0 peripherals migration guide). The display backends ## directly include `driver/gpio.h`, `driver/spi_master.h`, ## `driver/i2c_master.h`, and `driver/ledc.h`, so the matching - ## `esp_driver_*` components must be listed explicitly. They - ## also exist on IDF 5.3+, so the same list works on older IDFs. + ## `esp_driver_*` components must be listed explicitly. PRIV_REQUIRES driver esp_driver_gpio esp_driver_spi esp_driver_i2c esp_driver_ledc esp_lcd esp_timer lvgl__lvgl ) diff --git a/components/display/idf_component.yml b/components/display/idf_component.yml index d5be3c7..f86e1b4 100644 --- a/components/display/idf_component.yml +++ b/components/display/idf_component.yml @@ -22,13 +22,9 @@ dependencies: ## Both pieces are required to share the LilyGO T5 E-Paper S3 Pro ## (and Pro Lite) on-board I2C bus between epdiy (PCA9535 + TPS65185) ## and the GT911 capacitive touch controller managed by the - ## Draftling touchscreen component (also driver-NG). With epdiy - ## 2.0.0 the two driver generations collided on I2C port 0 and - ## ESP-IDF aborted at boot ("CONFLICT! driver_ng is not allowed - ## to be used with this old driver"), so touch had to be disabled - ## on both T5 SKUs. Drop the pin and switch back to a version - ## range once a 2.0.1 / 2.1 tag including PR #475 lands on - ## the Espressif Component Registry. + ## Draftling touchscreen component (also driver-NG). Drop the pin + ## and switch back to a version range once a 2.0.1 / 2.1 tag + ## including PR #475 lands on the Espressif Component Registry. ## epdiy only supports Xtensa targets (LX6/LX7); its board headers ## include xtensa/core-macros.h which does not exist in the RISC-V ## toolchain used for ESP32-P4. Exclude the dependency on ESP32-P4 @@ -36,21 +32,10 @@ dependencies: ## compile epd_board.h. display_epdiy.cpp is wrapped in ## `#if CONFIG_DRAFTLING_DISPLAY_EPDIY` so skipping the dep on ## non-epdiy targets is sufficient. - ## epdiy does not yet compile against ESP-IDF 6.x: its - ## `src/output_lcd/lcd_driver.c` includes `soc/lcd_periph.h`, - ## which was removed in IDF 6.0. Tracked upstream in - ## https://github.com/vroland/epdiy/issues/450. Until a fix lands, - ## gate the dependency to `idf_version <6.0` so non-epdiy boards - ## (Waveshare 3.49 / JC3248W535 / RLCD42, plus the ESP32-P4 Tab5) - ## can still build on IDF 6.x. epdiy-based boards (LilyGO T5 - ## Pro / Pro Lite, M5Stack PaperS3) must stay on ESP-IDF 5.3-5.5 - ## for now. vroland/epdiy: git: "https://github.com/vroland/epdiy.git" version: "a3426c0ec38f98282cf3ec33761e556f083b0f7c" rules: - - if: "idf_version >=5.3.0" - - if: "idf_version <6.0" - if: "target != esp32p4" require: public ## espressif/m5stack_tab5 BSP, pulled in only for the ESP32-P4 diff --git a/components/fonts/idf_component.yml b/components/fonts/idf_component.yml index 0c0d028..4b211d9 100644 --- a/components/fonts/idf_component.yml +++ b/components/fonts/idf_component.yml @@ -1,4 +1,4 @@ dependencies: idf: - version: ">=5.3.0" + version: ">=6.0" lvgl/lvgl: "^9.2" diff --git a/components/git_sync/CMakeLists.txt b/components/git_sync/CMakeLists.txt index 87ab7df..2d49adc 100644 --- a/components/git_sync/CMakeLists.txt +++ b/components/git_sync/CMakeLists.txt @@ -1,24 +1,13 @@ -## ESP-IDF 6.0 moved the bundled cJSON ("json") component out of the -## core tree into the espressif/cjson managed component (see the -## ESP-IDF 6.0 protocols migration guide). The managed component -## registers under the name "cjson", so the PRIV_REQUIRES entry must -## switch from "json" (IDF <=5.x built-in) to "cjson" (IDF >=6.0 -## managed) depending on the running ESP-IDF version. The matching -## dependency declaration lives in idf_component.yml and is gated on -## the same idf_version >=6.0 rule so older IDFs keep using the -## built-in component without downloading it. -if(IDF_VERSION_MAJOR GREATER_EQUAL 6) - set(_git_sync_cjson_component cjson) -else() - set(_git_sync_cjson_component json) -endif() - +## cJSON is provided by the espressif/cjson managed component +## (ESP-IDF 6.0 moved it out of the core tree -- see the ESP-IDF 6.0 +## protocols migration guide). The matching dependency declaration +## lives in idf_component.yml. idf_component_register( SRCS "git_sync.cpp" INCLUDE_DIRS "include" ## mbedtls is needed for mbedtls_base64_* and for the PSA Crypto - ## API used by the git blob SHA-1 helper on ESP-IDF 6.x (Mbed - ## TLS 4.x removed the legacy mbedtls_sha1_* API; see the - ## ESP-IDF 6.0 security migration guide). - PRIV_REQUIRES esp_http_client esp-tls mbedtls ${_git_sync_cjson_component} sd_card wifi_manager nvs_flash + ## API used by the git blob SHA-1 helper (Mbed TLS 4.x, shipped + ## with ESP-IDF 6.x, removed the legacy mbedtls_sha1_* API; see + ## the ESP-IDF 6.0 security migration guide). + PRIV_REQUIRES esp_http_client esp-tls mbedtls cjson sd_card wifi_manager nvs_flash ) diff --git a/components/git_sync/git_sync.cpp b/components/git_sync/git_sync.cpp index 78e30aa..863aeb0 100644 --- a/components/git_sync/git_sync.cpp +++ b/components/git_sync/git_sync.cpp @@ -9,16 +9,11 @@ #include #include #include -#include -#if ESP_IDF_VERSION_MAJOR >= 6 -/* ESP-IDF 6.0 upgrades to Mbed TLS 4.x which removes the legacy - * `mbedtls/sha1.h` low-level API in favour of PSA Crypto (see the - * ESP-IDF 6.0 security migration guide). Use psa/crypto.h for the - * git blob SHA-1 helper instead. */ +/* Mbed TLS 4.x (ESP-IDF 6.x) removed the legacy `mbedtls/sha1.h` + * low-level API in favour of PSA Crypto (see the ESP-IDF 6.0 + * security migration guide). Use psa/crypto.h for the git blob + * SHA-1 helper. */ #include -#else -#include -#endif #include "git_sync.h" #include "sd_card.h" @@ -186,7 +181,6 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) char header[32]; int hlen = snprintf(header, sizeof(header), "blob %zu", len); -#if ESP_IDF_VERSION_MAJOR >= 6 /* Mbed TLS 4.x removed the legacy mbedtls_sha1_* API; use PSA * Crypto. ESP-IDF initialises PSA during normal startup, so no * psa_crypto_init() call is needed here. */ @@ -196,15 +190,6 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) psa_hash_update(&op, (const unsigned char *)header, hlen + 1); psa_hash_update(&op, (const unsigned char *)content, len); psa_hash_finish(&op, hash, sizeof(hash), &hash_len); -#else - mbedtls_sha1_context ctx; - mbedtls_sha1_init(&ctx); - mbedtls_sha1_starts(&ctx); - mbedtls_sha1_update(&ctx, (const unsigned char *)header, hlen + 1); - mbedtls_sha1_update(&ctx, (const unsigned char *)content, len); - mbedtls_sha1_finish(&ctx, hash); - mbedtls_sha1_free(&ctx); -#endif for (int i = 0; i < 20; i++) snprintf(out_hex + i * 2, 3, "%02x", hash[i]); diff --git a/components/git_sync/idf_component.yml b/components/git_sync/idf_component.yml index 4eb682d..d408167 100644 --- a/components/git_sync/idf_component.yml +++ b/components/git_sync/idf_component.yml @@ -1,14 +1,9 @@ ## IDF Component manifest for the git_sync component. ## -## git_sync parses GitHub REST API responses with cJSON. Through -## ESP-IDF 5.x, cJSON was bundled in-tree as the "json" core -## component and was pulled in via PRIV_REQUIRES alone. ESP-IDF 6.0 -## removed the bundled component and moved it to the -## espressif/cjson managed component (see the ESP-IDF 6.0 protocols -## migration guide). Declare the managed dependency only on IDF -## >=6.0 so that 5.x builds keep using the built-in "json" -## component (the matching PRIV_REQUIRES switch lives in -## CMakeLists.txt and keys off IDF_VERSION_MAJOR). +## git_sync parses GitHub REST API responses with cJSON. ESP-IDF 6.0 +## removed the bundled in-tree "json" core component and moved cJSON +## to the espressif/cjson managed component (see the ESP-IDF 6.0 +## protocols migration guide). ## ## See: ## https://components.espressif.com/components/espressif/cjson @@ -16,5 +11,3 @@ dependencies: espressif/cjson: version: "^1.7.18" - rules: - - if: "idf_version >=6.0" diff --git a/components/power/power.cpp b/components/power/power.cpp index 0f6c6a1..959c370 100644 --- a/components/power/power.cpp +++ b/components/power/power.cpp @@ -6,7 +6,7 @@ * ------------ * The TCA9554 IO-expander is the only device this code talks to over * I2C, so we open a dedicated I2C master bus on the pins provided - * via power_config_t (the same ESP-IDF v5.x i2c_master API the + * via power_config_t (the same ESP-IDF i2c_master API the * touchscreen component uses, which avoids pulling in a heavy * esp_io_expander_tca9554 dependency for the two writes we need to * make). diff --git a/components/sd_card/CMakeLists.txt b/components/sd_card/CMakeLists.txt index af86d50..6fddcf5 100644 --- a/components/sd_card/CMakeLists.txt +++ b/components/sd_card/CMakeLists.txt @@ -6,7 +6,6 @@ idf_component_register( ## 6.0 peripherals migration guide). sd_card.cpp includes ## `driver/sdmmc_host.h`, `driver/sdspi_host.h`, ## `driver/spi_common.h`, and `driver/gpio.h`, so the matching - ## `esp_driver_*` components must be listed explicitly. They - ## also exist on IDF 5.3+, so the same list works on older IDFs. + ## `esp_driver_*` components must be listed explicitly. PRIV_REQUIRES fatfs sdmmc vfs driver esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_gpio ) diff --git a/components/touchscreen/touchscreen.cpp b/components/touchscreen/touchscreen.cpp index 148b655..7156ea3 100644 --- a/components/touchscreen/touchscreen.cpp +++ b/components/touchscreen/touchscreen.cpp @@ -361,7 +361,7 @@ extern "C" void touchscreen_init(const touchscreen_config_t *cfg) gpio_config(&g); } - /* I2C master bus + device handle (ESP-IDF v5.x i2c_master API). + /* I2C master bus + device handle (ESP-IDF i2c_master API). * * If the caller passed an existing driver-NG bus handle via * s_cfg.i2c_bus we adopt it instead of creating our own. This diff --git a/components/usb_kbd/idf_component.yml b/components/usb_kbd/idf_component.yml index 4cbb8b4..1da77e2 100644 --- a/components/usb_kbd/idf_component.yml +++ b/components/usb_kbd/idf_component.yml @@ -4,7 +4,7 @@ ## is the only USB host port across the supported devices. dependencies: idf: - version: ">=5.5" + version: ">=6.0" espressif/usb_host_hid: version: "^1.0.1" rules: diff --git a/main/idf_component.yml b/main/idf_component.yml index e6b4370..91d18c8 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,6 +1,6 @@ dependencies: idf: - version: '>=5.3.0' + version: '>=6.0' lvgl/lvgl: "^9.2" ## Wi-Fi / Bluetooth on the ESP32-P4 are routed through the From c54e119fd66f2b65f9af80ca557fa1544c490c25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:48:04 +0000 Subject: [PATCH 5/8] Pin epdiy to PR #477 head for ESP-IDF 6.0 LCD driver fix --- components/display/idf_component.yml | 44 +++++++++++++++++++--------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/components/display/idf_component.yml b/components/display/idf_component.yml index f86e1b4..eb5341f 100644 --- a/components/display/idf_component.yml +++ b/components/display/idf_component.yml @@ -12,19 +12,35 @@ ## https://components.espressif.com/components/vroland/epdiy ## https://github.com/vroland/epdiy dependencies: - ## Pinned to a post-2.0.0 git commit (no tagged release yet) that - ## carries vroland/epdiy PR #475 ("Migrate epdiy board I2C init to - ## the new ESP-IDF driver"). That PR migrates epdiy's on-board I2C - ## bus from the legacy `driver/i2c.h` to driver-NG - ## (`driver/i2c_master.h`) AND adds a new `epd_init_with_config()` - ## entry point that accepts a caller-supplied - ## `i2c_master_bus_handle_t` via `EpdInitConfig.i2c.bus_handle`. - ## Both pieces are required to share the LilyGO T5 E-Paper S3 Pro - ## (and Pro Lite) on-board I2C bus between epdiy (PCA9535 + TPS65185) - ## and the GT911 capacitive touch controller managed by the - ## Draftling touchscreen component (also driver-NG). Drop the pin - ## and switch back to a version range once a 2.0.1 / 2.1 tag - ## including PR #475 lands on the Espressif Component Registry. + ## Pinned to the head of vroland/epdiy's `idf-6.0-compatibility` + ## branch (PR #477, "IDF-6.0 support ported from #463"). That + ## branch is itself based on post-2.0.0 main and therefore + ## includes the earlier PR #475 ("Migrate epdiy board I2C init + ## to the new ESP-IDF driver"), which migrates epdiy's on-board + ## I2C bus from the legacy `driver/i2c.h` to driver-NG + ## (`driver/i2c_master.h`) and adds the + ## `epd_init_with_config()` entry point that accepts a + ## caller-supplied `i2c_master_bus_handle_t` via + ## `EpdInitConfig.i2c.bus_handle`. Both pieces are required to + ## share the LilyGO T5 E-Paper S3 Pro (and Pro Lite) on-board + ## I2C bus between epdiy (PCA9535 + TPS65185) and the GT911 + ## capacitive touch controller managed by the Draftling + ## touchscreen component (also driver-NG). + ## + ## PR #477 additionally adapts `src/output_lcd/lcd_driver.c` to + ## ESP-IDF 6.0: the legacy `soc/lcd_periph.h` header was removed + ## in IDF 6.0 (tracked in vroland/epdiy#450), and the branch + ## gates the include and the `lcd_periph_signals` / + ## `lcd_periph_rgb_signals` lookups behind `ESP_IDF_VERSION` + ## checks so the driver builds against both 5.x and 6.x. + ## Without this pin the IDF 6.0+ build of the LilyGO T5 and + ## M5Stack PaperS3 backends fails with + ## `fatal error: soc/lcd_periph.h: No such file or directory`. + ## + ## Drop the pin and switch back to a tagged version range once + ## both PR #475 and PR #477 land in a tagged release on the + ## Espressif Component Registry. + ## ## epdiy only supports Xtensa targets (LX6/LX7); its board headers ## include xtensa/core-macros.h which does not exist in the RISC-V ## toolchain used for ESP32-P4. Exclude the dependency on ESP32-P4 @@ -34,7 +50,7 @@ dependencies: ## non-epdiy targets is sufficient. vroland/epdiy: git: "https://github.com/vroland/epdiy.git" - version: "a3426c0ec38f98282cf3ec33761e556f083b0f7c" + version: "9d2608b4ca637c9678d859dad24b261ca9e239f5" rules: - if: "target != esp32p4" require: public From d9dfe1079430fe406e5ca486d840b4bad6a6ef90 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:54:48 +0000 Subject: [PATCH 6/8] Revert "Pin epdiy to PR #477 head for ESP-IDF 6.0 LCD driver fix" This reverts commit c54e119fd66f2b65f9af80ca557fa1544c490c25. --- components/display/idf_component.yml | 44 +++++++++------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/components/display/idf_component.yml b/components/display/idf_component.yml index eb5341f..f86e1b4 100644 --- a/components/display/idf_component.yml +++ b/components/display/idf_component.yml @@ -12,35 +12,19 @@ ## https://components.espressif.com/components/vroland/epdiy ## https://github.com/vroland/epdiy dependencies: - ## Pinned to the head of vroland/epdiy's `idf-6.0-compatibility` - ## branch (PR #477, "IDF-6.0 support ported from #463"). That - ## branch is itself based on post-2.0.0 main and therefore - ## includes the earlier PR #475 ("Migrate epdiy board I2C init - ## to the new ESP-IDF driver"), which migrates epdiy's on-board - ## I2C bus from the legacy `driver/i2c.h` to driver-NG - ## (`driver/i2c_master.h`) and adds the - ## `epd_init_with_config()` entry point that accepts a - ## caller-supplied `i2c_master_bus_handle_t` via - ## `EpdInitConfig.i2c.bus_handle`. Both pieces are required to - ## share the LilyGO T5 E-Paper S3 Pro (and Pro Lite) on-board - ## I2C bus between epdiy (PCA9535 + TPS65185) and the GT911 - ## capacitive touch controller managed by the Draftling - ## touchscreen component (also driver-NG). - ## - ## PR #477 additionally adapts `src/output_lcd/lcd_driver.c` to - ## ESP-IDF 6.0: the legacy `soc/lcd_periph.h` header was removed - ## in IDF 6.0 (tracked in vroland/epdiy#450), and the branch - ## gates the include and the `lcd_periph_signals` / - ## `lcd_periph_rgb_signals` lookups behind `ESP_IDF_VERSION` - ## checks so the driver builds against both 5.x and 6.x. - ## Without this pin the IDF 6.0+ build of the LilyGO T5 and - ## M5Stack PaperS3 backends fails with - ## `fatal error: soc/lcd_periph.h: No such file or directory`. - ## - ## Drop the pin and switch back to a tagged version range once - ## both PR #475 and PR #477 land in a tagged release on the - ## Espressif Component Registry. - ## + ## Pinned to a post-2.0.0 git commit (no tagged release yet) that + ## carries vroland/epdiy PR #475 ("Migrate epdiy board I2C init to + ## the new ESP-IDF driver"). That PR migrates epdiy's on-board I2C + ## bus from the legacy `driver/i2c.h` to driver-NG + ## (`driver/i2c_master.h`) AND adds a new `epd_init_with_config()` + ## entry point that accepts a caller-supplied + ## `i2c_master_bus_handle_t` via `EpdInitConfig.i2c.bus_handle`. + ## Both pieces are required to share the LilyGO T5 E-Paper S3 Pro + ## (and Pro Lite) on-board I2C bus between epdiy (PCA9535 + TPS65185) + ## and the GT911 capacitive touch controller managed by the + ## Draftling touchscreen component (also driver-NG). Drop the pin + ## and switch back to a version range once a 2.0.1 / 2.1 tag + ## including PR #475 lands on the Espressif Component Registry. ## epdiy only supports Xtensa targets (LX6/LX7); its board headers ## include xtensa/core-macros.h which does not exist in the RISC-V ## toolchain used for ESP32-P4. Exclude the dependency on ESP32-P4 @@ -50,7 +34,7 @@ dependencies: ## non-epdiy targets is sufficient. vroland/epdiy: git: "https://github.com/vroland/epdiy.git" - version: "9d2608b4ca637c9678d859dad24b261ca9e239f5" + version: "a3426c0ec38f98282cf3ec33761e556f083b0f7c" rules: - if: "target != esp32p4" require: public From b2e4f2a5c73f5a351f6df64092b82fed3c37758e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:54:49 +0000 Subject: [PATCH 7/8] Revert "Drop ESP-IDF 5.x compatibility paths and refresh docs" This reverts commit 6187791c58140e7a20a7adf8b102660d1a97ade4. --- AGENTS.md | 6 +++--- README.md | 2 +- components/battery/CMakeLists.txt | 3 ++- components/display/CMakeLists.txt | 3 ++- components/display/idf_component.yml | 21 +++++++++++++++++--- components/fonts/idf_component.yml | 2 +- components/git_sync/CMakeLists.txt | 27 ++++++++++++++++++-------- components/git_sync/git_sync.cpp | 23 ++++++++++++++++++---- components/git_sync/idf_component.yml | 15 ++++++++++---- components/power/power.cpp | 2 +- components/sd_card/CMakeLists.txt | 3 ++- components/touchscreen/touchscreen.cpp | 2 +- components/usb_kbd/idf_component.yml | 2 +- main/idf_component.yml | 2 +- 14 files changed, 82 insertions(+), 31 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d415ac5..6caf0db 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,7 +31,7 @@ Draftling is a distraction-free Markdown text editor for ESP32-S3-based development boards with reflective LCD displays. It is built with the -ESP-IDF framework (v6.0+) and uses LVGL v9 for the graphical interface. +ESP-IDF framework (v5.3+) and uses LVGL v9 for the graphical interface. The user connects a Bluetooth keyboard and edits Markdown files stored on a MicroSD card. The reflective LCD needs no backlight and works well in @@ -402,7 +402,7 @@ latch has no effect and the chip just deep-sleeps. The TCA9554 is reached over a dedicated I2C bus (SDA/SCL pins + address + latch bit all carried by `power_config_t` so this component stays board-agnostic). The bus is opened with the -ESP-IDF `i2c_master_*` API; we issue only two register writes +ESP-IDF v5.x `i2c_master_*` API; we issue only two register writes (Output and Configuration) so this component does not pull in a heavy `esp_io_expander_tca9554` dependency. @@ -613,7 +613,7 @@ only the enabled layout tables. ## Building -Requires ESP-IDF v6.0 or later. +Requires ESP-IDF v5.3 or later (v5.3 - v5.5 confirmed working). PSRAM is required on every supported board. The editor gap buffer (sized dynamically at startup from the PSRAM that is free when diff --git a/README.md b/README.md index 6392b50..1034698 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ can be independently enabled or disabled. By default **US-English** and ## Building Requires [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/) -v6.0 or later. +v5.3 or later (v5.3 - v5.5 confirmed working). Keep in mind that M5Stack Tab5 uses a different MCU, so the tatget should be set to 'esp32s4'. diff --git a/components/battery/CMakeLists.txt b/components/battery/CMakeLists.txt index 0b2fdf0..40337ac 100644 --- a/components/battery/CMakeLists.txt +++ b/components/battery/CMakeLists.txt @@ -6,6 +6,7 @@ idf_component_register( ## 6.0 peripherals migration guide). battery.cpp includes ## `driver/gpio.h` and `driver/i2c_master.h`, so the matching ## `esp_driver_gpio` and `esp_driver_i2c` components must be - ## listed explicitly. + ## listed explicitly. They also exist on IDF 5.3+, so the same + ## list works on older IDFs. PRIV_REQUIRES esp_adc driver esp_driver_gpio esp_driver_i2c ) diff --git a/components/display/CMakeLists.txt b/components/display/CMakeLists.txt index 7d69ee4..b8cc1d6 100644 --- a/components/display/CMakeLists.txt +++ b/components/display/CMakeLists.txt @@ -6,7 +6,8 @@ idf_component_register( ## 6.0 peripherals migration guide). The display backends ## directly include `driver/gpio.h`, `driver/spi_master.h`, ## `driver/i2c_master.h`, and `driver/ledc.h`, so the matching - ## `esp_driver_*` components must be listed explicitly. + ## `esp_driver_*` components must be listed explicitly. They + ## also exist on IDF 5.3+, so the same list works on older IDFs. PRIV_REQUIRES driver esp_driver_gpio esp_driver_spi esp_driver_i2c esp_driver_ledc esp_lcd esp_timer lvgl__lvgl ) diff --git a/components/display/idf_component.yml b/components/display/idf_component.yml index f86e1b4..d5be3c7 100644 --- a/components/display/idf_component.yml +++ b/components/display/idf_component.yml @@ -22,9 +22,13 @@ dependencies: ## Both pieces are required to share the LilyGO T5 E-Paper S3 Pro ## (and Pro Lite) on-board I2C bus between epdiy (PCA9535 + TPS65185) ## and the GT911 capacitive touch controller managed by the - ## Draftling touchscreen component (also driver-NG). Drop the pin - ## and switch back to a version range once a 2.0.1 / 2.1 tag - ## including PR #475 lands on the Espressif Component Registry. + ## Draftling touchscreen component (also driver-NG). With epdiy + ## 2.0.0 the two driver generations collided on I2C port 0 and + ## ESP-IDF aborted at boot ("CONFLICT! driver_ng is not allowed + ## to be used with this old driver"), so touch had to be disabled + ## on both T5 SKUs. Drop the pin and switch back to a version + ## range once a 2.0.1 / 2.1 tag including PR #475 lands on + ## the Espressif Component Registry. ## epdiy only supports Xtensa targets (LX6/LX7); its board headers ## include xtensa/core-macros.h which does not exist in the RISC-V ## toolchain used for ESP32-P4. Exclude the dependency on ESP32-P4 @@ -32,10 +36,21 @@ dependencies: ## compile epd_board.h. display_epdiy.cpp is wrapped in ## `#if CONFIG_DRAFTLING_DISPLAY_EPDIY` so skipping the dep on ## non-epdiy targets is sufficient. + ## epdiy does not yet compile against ESP-IDF 6.x: its + ## `src/output_lcd/lcd_driver.c` includes `soc/lcd_periph.h`, + ## which was removed in IDF 6.0. Tracked upstream in + ## https://github.com/vroland/epdiy/issues/450. Until a fix lands, + ## gate the dependency to `idf_version <6.0` so non-epdiy boards + ## (Waveshare 3.49 / JC3248W535 / RLCD42, plus the ESP32-P4 Tab5) + ## can still build on IDF 6.x. epdiy-based boards (LilyGO T5 + ## Pro / Pro Lite, M5Stack PaperS3) must stay on ESP-IDF 5.3-5.5 + ## for now. vroland/epdiy: git: "https://github.com/vroland/epdiy.git" version: "a3426c0ec38f98282cf3ec33761e556f083b0f7c" rules: + - if: "idf_version >=5.3.0" + - if: "idf_version <6.0" - if: "target != esp32p4" require: public ## espressif/m5stack_tab5 BSP, pulled in only for the ESP32-P4 diff --git a/components/fonts/idf_component.yml b/components/fonts/idf_component.yml index 4b211d9..0c0d028 100644 --- a/components/fonts/idf_component.yml +++ b/components/fonts/idf_component.yml @@ -1,4 +1,4 @@ dependencies: idf: - version: ">=6.0" + version: ">=5.3.0" lvgl/lvgl: "^9.2" diff --git a/components/git_sync/CMakeLists.txt b/components/git_sync/CMakeLists.txt index 2d49adc..87ab7df 100644 --- a/components/git_sync/CMakeLists.txt +++ b/components/git_sync/CMakeLists.txt @@ -1,13 +1,24 @@ -## cJSON is provided by the espressif/cjson managed component -## (ESP-IDF 6.0 moved it out of the core tree -- see the ESP-IDF 6.0 -## protocols migration guide). The matching dependency declaration -## lives in idf_component.yml. +## ESP-IDF 6.0 moved the bundled cJSON ("json") component out of the +## core tree into the espressif/cjson managed component (see the +## ESP-IDF 6.0 protocols migration guide). The managed component +## registers under the name "cjson", so the PRIV_REQUIRES entry must +## switch from "json" (IDF <=5.x built-in) to "cjson" (IDF >=6.0 +## managed) depending on the running ESP-IDF version. The matching +## dependency declaration lives in idf_component.yml and is gated on +## the same idf_version >=6.0 rule so older IDFs keep using the +## built-in component without downloading it. +if(IDF_VERSION_MAJOR GREATER_EQUAL 6) + set(_git_sync_cjson_component cjson) +else() + set(_git_sync_cjson_component json) +endif() + idf_component_register( SRCS "git_sync.cpp" INCLUDE_DIRS "include" ## mbedtls is needed for mbedtls_base64_* and for the PSA Crypto - ## API used by the git blob SHA-1 helper (Mbed TLS 4.x, shipped - ## with ESP-IDF 6.x, removed the legacy mbedtls_sha1_* API; see - ## the ESP-IDF 6.0 security migration guide). - PRIV_REQUIRES esp_http_client esp-tls mbedtls cjson sd_card wifi_manager nvs_flash + ## API used by the git blob SHA-1 helper on ESP-IDF 6.x (Mbed + ## TLS 4.x removed the legacy mbedtls_sha1_* API; see the + ## ESP-IDF 6.0 security migration guide). + PRIV_REQUIRES esp_http_client esp-tls mbedtls ${_git_sync_cjson_component} sd_card wifi_manager nvs_flash ) diff --git a/components/git_sync/git_sync.cpp b/components/git_sync/git_sync.cpp index 863aeb0..78e30aa 100644 --- a/components/git_sync/git_sync.cpp +++ b/components/git_sync/git_sync.cpp @@ -9,11 +9,16 @@ #include #include #include -/* Mbed TLS 4.x (ESP-IDF 6.x) removed the legacy `mbedtls/sha1.h` - * low-level API in favour of PSA Crypto (see the ESP-IDF 6.0 - * security migration guide). Use psa/crypto.h for the git blob - * SHA-1 helper. */ +#include +#if ESP_IDF_VERSION_MAJOR >= 6 +/* ESP-IDF 6.0 upgrades to Mbed TLS 4.x which removes the legacy + * `mbedtls/sha1.h` low-level API in favour of PSA Crypto (see the + * ESP-IDF 6.0 security migration guide). Use psa/crypto.h for the + * git blob SHA-1 helper instead. */ #include +#else +#include +#endif #include "git_sync.h" #include "sd_card.h" @@ -181,6 +186,7 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) char header[32]; int hlen = snprintf(header, sizeof(header), "blob %zu", len); +#if ESP_IDF_VERSION_MAJOR >= 6 /* Mbed TLS 4.x removed the legacy mbedtls_sha1_* API; use PSA * Crypto. ESP-IDF initialises PSA during normal startup, so no * psa_crypto_init() call is needed here. */ @@ -190,6 +196,15 @@ static void compute_blob_sha(const char *content, size_t len, char out_hex[41]) psa_hash_update(&op, (const unsigned char *)header, hlen + 1); psa_hash_update(&op, (const unsigned char *)content, len); psa_hash_finish(&op, hash, sizeof(hash), &hash_len); +#else + mbedtls_sha1_context ctx; + mbedtls_sha1_init(&ctx); + mbedtls_sha1_starts(&ctx); + mbedtls_sha1_update(&ctx, (const unsigned char *)header, hlen + 1); + mbedtls_sha1_update(&ctx, (const unsigned char *)content, len); + mbedtls_sha1_finish(&ctx, hash); + mbedtls_sha1_free(&ctx); +#endif for (int i = 0; i < 20; i++) snprintf(out_hex + i * 2, 3, "%02x", hash[i]); diff --git a/components/git_sync/idf_component.yml b/components/git_sync/idf_component.yml index d408167..4eb682d 100644 --- a/components/git_sync/idf_component.yml +++ b/components/git_sync/idf_component.yml @@ -1,9 +1,14 @@ ## IDF Component manifest for the git_sync component. ## -## git_sync parses GitHub REST API responses with cJSON. ESP-IDF 6.0 -## removed the bundled in-tree "json" core component and moved cJSON -## to the espressif/cjson managed component (see the ESP-IDF 6.0 -## protocols migration guide). +## git_sync parses GitHub REST API responses with cJSON. Through +## ESP-IDF 5.x, cJSON was bundled in-tree as the "json" core +## component and was pulled in via PRIV_REQUIRES alone. ESP-IDF 6.0 +## removed the bundled component and moved it to the +## espressif/cjson managed component (see the ESP-IDF 6.0 protocols +## migration guide). Declare the managed dependency only on IDF +## >=6.0 so that 5.x builds keep using the built-in "json" +## component (the matching PRIV_REQUIRES switch lives in +## CMakeLists.txt and keys off IDF_VERSION_MAJOR). ## ## See: ## https://components.espressif.com/components/espressif/cjson @@ -11,3 +16,5 @@ dependencies: espressif/cjson: version: "^1.7.18" + rules: + - if: "idf_version >=6.0" diff --git a/components/power/power.cpp b/components/power/power.cpp index 959c370..0f6c6a1 100644 --- a/components/power/power.cpp +++ b/components/power/power.cpp @@ -6,7 +6,7 @@ * ------------ * The TCA9554 IO-expander is the only device this code talks to over * I2C, so we open a dedicated I2C master bus on the pins provided - * via power_config_t (the same ESP-IDF i2c_master API the + * via power_config_t (the same ESP-IDF v5.x i2c_master API the * touchscreen component uses, which avoids pulling in a heavy * esp_io_expander_tca9554 dependency for the two writes we need to * make). diff --git a/components/sd_card/CMakeLists.txt b/components/sd_card/CMakeLists.txt index 6fddcf5..af86d50 100644 --- a/components/sd_card/CMakeLists.txt +++ b/components/sd_card/CMakeLists.txt @@ -6,6 +6,7 @@ idf_component_register( ## 6.0 peripherals migration guide). sd_card.cpp includes ## `driver/sdmmc_host.h`, `driver/sdspi_host.h`, ## `driver/spi_common.h`, and `driver/gpio.h`, so the matching - ## `esp_driver_*` components must be listed explicitly. + ## `esp_driver_*` components must be listed explicitly. They + ## also exist on IDF 5.3+, so the same list works on older IDFs. PRIV_REQUIRES fatfs sdmmc vfs driver esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_gpio ) diff --git a/components/touchscreen/touchscreen.cpp b/components/touchscreen/touchscreen.cpp index 7156ea3..148b655 100644 --- a/components/touchscreen/touchscreen.cpp +++ b/components/touchscreen/touchscreen.cpp @@ -361,7 +361,7 @@ extern "C" void touchscreen_init(const touchscreen_config_t *cfg) gpio_config(&g); } - /* I2C master bus + device handle (ESP-IDF i2c_master API). + /* I2C master bus + device handle (ESP-IDF v5.x i2c_master API). * * If the caller passed an existing driver-NG bus handle via * s_cfg.i2c_bus we adopt it instead of creating our own. This diff --git a/components/usb_kbd/idf_component.yml b/components/usb_kbd/idf_component.yml index 1da77e2..4cbb8b4 100644 --- a/components/usb_kbd/idf_component.yml +++ b/components/usb_kbd/idf_component.yml @@ -4,7 +4,7 @@ ## is the only USB host port across the supported devices. dependencies: idf: - version: ">=6.0" + version: ">=5.5" espressif/usb_host_hid: version: "^1.0.1" rules: diff --git a/main/idf_component.yml b/main/idf_component.yml index 91d18c8..e6b4370 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,6 +1,6 @@ dependencies: idf: - version: '>=6.0' + version: '>=5.3.0' lvgl/lvgl: "^9.2" ## Wi-Fi / Bluetooth on the ESP32-P4 are routed through the From 18316d41098665b69373bb4967aad752e5a50f14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Jun 2026 20:55:03 +0000 Subject: [PATCH 8/8] Note that e-paper boards require ESP-IDF 5.5.x until epdiy is compatible --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1034698..1d4a324 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,12 @@ can be independently enabled or disabled. By default **US-English** and Requires [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/) v5.3 or later (v5.3 - v5.5 confirmed working). +> **Note:** the e-paper boards (M5Stack PaperS3 and LilyGO T5 E-Paper +> S3 Pro / Pro Lite) currently require **ESP-IDF 5.5.x**. The +> `vroland/epdiy` driver is not yet compatible with ESP-IDF 6.x; +> please stay on the 5.5.x release line for these devices until the +> driver becomes compatible. + Keep in mind that M5Stack Tab5 uses a different MCU, so the tatget should be set to 'esp32s4'.