Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash: Return flash capacity per-chosen device #252

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading