mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Add an example under examples/storage/generic_partition_bdl that partitions a raw block device at run time using only the Block Device Layer (BDL) interface. The example obtains a whole-disk BDL (SPI flash data partition by default, or an SD/eMMC card via menuconfig), writes an MBR partition table onto it with the esp_ext_part_tables managed component (fetched via idf_component.yml), then creates a generic-partition BDL for each MBR entry with esp_blockdev_generic_partition_get() and mounts FATFS on the FAT slice and LittleFS on the LittleFS slice.
10 lines
293 B
Plaintext
10 lines
293 B
Plaintext
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
|
|
|
# Whole-disk block device: SD/eMMC card over the SPI bus (SDSPI)
|
|
CONFIG_EXAMPLE_STORAGE_MEDIA_SDCARD=y
|
|
CONFIG_EXAMPLE_SD_HOST_SDSPI=y
|
|
|
|
# FATFS
|
|
# Runtime FAT sector size is derived from the SD card BDL geometry (512 bytes).
|
|
CONFIG_FATFS_VFS_FSTAT_BLKSIZE=4096
|