Skip to content

CMake: require bootloader_support on ESP-IDF 5.3 and later - #413

Merged
lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:idf_bootloader_support_requires
Nov 11, 2026
Merged

lovyan03 merged 1 commit into
m5stack:developfrom
ainyan03:idf_bootloader_support_requires

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

Summary

Require bootloader_support on ESP-IDF 5.3 and later (before ESP-IDF 6).

Bus_SPI checks <esp_flash_encrypt.h> to decide whether external RAM may be a DMA source on chips with AHB GDMA v2 or AXI DMA (ESP32-P4, ESP32-C5, ESP32-C61). The header belongs to bootloader_support, which the component did not require. On ESP-IDF 5 builds the header was therefore not visible, the check fell back to "flash encryption enabled", and data in external RAM was always sent by the CPU instead of DMA. No error or warning was shown. Arduino builds see all include directories and already used DMA; ESP-IDF 6 uses the efuse API and is unchanged.

Up to ESP-IDF 5.2 the header also includes spi_flash_mmap.h, which bootloader_support does not export, so those versions are left as they are (CPU path).

The comment in Bus_SPI about ESP-IDF 6 is also corrected: the header is still public there, but esp_flash_encryption_enabled() is deprecated.

Testing

  • ESP-IDF 5.3.1 / 5.4.3 (ESP32-P4) and 5.5.3 (ESP32-C61): bootloader_support/include is now on the include path and esp_flash_encryption_enabled is referenced from the SPI bus code. ESP-IDF 5.1 / 5.2 and 6.1 builds are unchanged.
  • Build check on ESP-IDF 5.1 / 5.2 / 5.3 / 5.4 / 5.5 / 6.0 / 6.1 and Arduino core 2.0 / 3.x for the supported chips passed.
  • Not tested on hardware with an ESP-IDF-only build. The DMA path that is enabled here is the one Arduino builds already use.
  • Fork CI passed.

Bus_SPI checks <esp_flash_encrypt.h> to decide whether external RAM may be
a DMA source on chips with AHB GDMA v2 or AXI DMA (ESP32-P4, ESP32-C5,
ESP32-C61). The header belongs to bootloader_support, which the component
did not require, so on ESP-IDF 5 builds the check always assumed flash
encryption and data in external RAM was sent by the CPU instead of DMA.

Only ESP-IDF 5.3 and later is changed: up to 5.2 the header also needs
spi_flash, so those versions keep the CPU path. Arduino builds see all
include directories and were not affected; ESP-IDF 6 uses the efuse API
instead.

Also correct the comment in Bus_SPI: on ESP-IDF 6 the header is still
public, but esp_flash_encryption_enabled() is deprecated.
@lovyan03
lovyan03 merged commit a9de51b into m5stack:develop Nov 11, 2026
26 checks passed
@ainyan03
ainyan03 deleted the idf_bootloader_support_requires branch November 11, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants