Commit Graph

14 Commits

Author SHA1 Message Date
Adam Múdry 749c446a7e feat(esp_partition): Add esp_partition_flash_binary() CMake function
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.
2026-04-10 15:22:50 +02:00
Frantisek Hrbata d4d778182f fix(esp_partition/cmake): remove unused PRIV_INCLUDE_DIRS
Currently, the bootloader version of the `esp_partition` component sets
`PRIV_INCLUDE_DIRS` using the `private_include_dirs` variable. However,
this variable is not properly initialized, which causes issues in
cmakev2. In cmakev2, components are evaluated recursively, and a
component may be evaluated in the context of another component, so
components must initialize all variables before using them.

Moreover, there are effectively no `PRIV_INCLUDE_DIRS` to set when the
component is evaluated for the bootloader. Therefore, remove
`PRIV_INCLUDE_DIRS` entirely for bootloader and test builds.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Chen Jichang b8c527a87c refactor(flash_enc): move esp_flash_encryption_enabled() to efuse component 2026-02-05 11:42:08 +08:00
sonika.rathi 6216b017f0 feat(vfs): add 'fatfs' host test to include 'vfs' support 2025-11-05 09:49:21 +01:00
Martin Vychodil 4493b39d18 feat(storage): Added Block Device Layer support for esp_partition component 2025-10-07 14:55:36 +08:00
Laukik Hase c9f7bcd452 feat(esp_tee): Support the nvs_flash for the ESP-TEE build 2025-05-04 18:03:28 +05:30
radek.tandler c445ec134b feat(nvs_flash): Implemented basic nvs_flash support for bootloader 2024-11-14 11:56:45 +01:00
Jakob Hasse 69c04f4adf refactor(esp_partition): Made private includes private on Linux 2024-05-13 16:02:19 +02:00
Jakob Hasse 4d629be602 refactor(linux): Unified libbsd handling
* Users can now use libbsd string.h and sys/cdefs.h functionality
  (e.g., strlcpy, containerof) on Linux by just including
  string.h or sys/cdefs.h. In other words, the includes are the same
  on the Linux target as well as on chips targets (ESP32, etc.).
* libbsd linking is done by the linux component (belongs to common
  components) now instead of handling it separately in each component
2024-03-08 12:26:54 +08:00
Adam Múdry e151184da7 refactor: Remove -Wno-format from storage related components 2023-10-22 17:56:41 +00:00
radek.tandler 28f82d8de7 refactor(nvs_flash): Host test migrated to esp_partition emulation for linux 2023-08-09 14:14:21 +02:00
Jakob Hasse f67bcc669a esp_partition: partition_linux.c and its test do not use hard-coded file anymore 2023-03-31 15:07:07 +08:00
radek.tandler e9e388a085 Storage: ESP Partition extended options for the SPI Flash emulation
Various extensions and fixes to improve Linux target SPI Flash emulation. Used by the host tests
2023-03-03 23:57:34 +00:00
Martin Vychodil c9c7573f71 Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:54:45 +01:00