Skip to content

Migrate consumers to esp-hal flash #6205

Description

@MabezDev

Migrate the real consumers onto esp_hal::flash.

First decouple esp-bootloader-esp-idf from esp-storage behind a private seam with a cfg(test) host mock. Then swap the backend to Flash<'_, Blocking> and expose two checked partition accessors:

PartitionEntry::as_flash_region()           -> FlashRegion          (plaintext; impls the blocking NOR traits)
PartitionEntry::as_encrypted_flash_region() -> EncryptedFlashRegion (inherent read / erase / encrypted-write only)

Effective encryption is checked from the partition flags, partition type and hardware state. Remove the old ReadStorage/Storage, NorFlashRegion and EncryptedNorFlashRegion wrappers (breaking). Dropping NorFlash from the encrypted region is a conformance fix: erased flash is all-1s ciphertext, which decrypts to pseudorandom plaintext and can't satisfy the "all 1s after erase" contract.

Migrate the flash and OTA examples, the HIL tests and qa-test off esp-storage.

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Selected For Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions