Physical Flash Sector 0 (256 KB) Physical Flash Sector 1 (256 KB)
┌──────────────────────────────────┐ ┌────────────────────────────────┐
│ Block HDR | OdometerData (4B) │ │ (empty — erased) │
│ Block HDR | CalibData (32B) │ │ │
│ Block HDR | FaultCounter (2B) │ │ (copy target when Sector 0 80%)│
│ (sector ACTIVE) │ │ │
└──────────────────────────────────┘ └────────────────────────────────┘
When Sector 0 is 80% full:
Fee copies valid blocks to Sector 1 → marks Sector 1 ACTIVE → erases Sector 0💡 FeeBlockSize
FeeBlockSize must be a multiple of the flash page size (typically 4 or 8 bytes on NOR flash). Misalignment causes Fee_Write to silently write to a partial page, resulting in data corruption on subsequent reads.