mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
749c446a7e
Add a new CMake function esp_partition_flash_binary() that provides a unified API for registering partition data binaries to be flashed. It replaces the direct esptool_py_flash_target calls scattered across components (spiffs, fatfs, nvs_flash) with a single function that: - Resolves partition offset from the partition table automatically - Determines encryption requirements (auto-detect or ALWAYS_PLAINTEXT) - Creates per-partition flash targets (e.g. idf.py <partition>-flash) - Optionally includes the binary in `idf.py flash` via FLASH_IN_PROJECT On the linux target, the function registers binaries for pre-loading into the emulated flash. A build-time manifest (linux_flash_data.txt) is generated via file(GENERATE), and partition_linux.c reads it at runtime to copy each binary into the memory-mapped flash buffer at the correct offset. The partition_ops example is updated to use the new function and includes a custom_partition with pre-built data to demonstrate the full workflow, including on the linux target.
368 B
368 B
| 1 | # Name, Type, SubType, Offset, Size, Flags |
|---|---|
| 2 | # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap |
| 3 | nvs, data, nvs, 0x9000, 0x6000, |
| 4 | phy_init, data, phy, 0xf000, 0x1000, |
| 5 | factory, app, factory, 0x10000, 1M, |
| 6 | storage, data, , , 0x3F000, |
| 7 | custom_partition, data, , , 0x1000, |