Skip to content

Commit

Permalink
Merge pull request #252 from plaes/sd-flash-size
Browse files Browse the repository at this point in the history
flash: Return flash capacity per-chosen device
  • Loading branch information
Dirbaio authored Apr 30, 2024
2 parents a6c5b15 + 969d887 commit 3c53b8c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion nrf-softdevice/src/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,18 @@ impl ReadNorFlash for Flash {
}

fn capacity(&self) -> usize {
256 * 4096
#[cfg(any(feature = "nrf52805", feature = "nrf52810", feature = "nrf52811",))]
return 48 * 4096; // 192KB

#[cfg(feature = "nrf52820")]
return 64 * 4096; // 256KB

// TODO: nrf52832 has also "lite" edition (QFAB) with 256KB/32KB of flash/RAM
#[cfg(any(feature = "nrf52832", feature = "nrf52833",))]
return 128 * 4096; // 512KB

#[cfg(feature = "nrf52840")]
return 256 * 4096; // 1024KB
}
}

Expand Down

0 comments on commit 3c53b8c

Please sign in to comment.