Skip to content

Commit b6351da

Browse files
committed
Implement MultiwriteNorFlash for nRF52 boards that support it
1 parent bcd5c5d commit b6351da

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nrf-hal-common/src/nvmc.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ where
183183
}
184184
}
185185

186+
// Only nRF52 boards have been checked. There 2 things to note:
187+
//
188+
// 1. The nRF52832 doesn't support 2 writes per word. Instead it supports 181 writes per block,
189+
// where a block is 128 words. So on average it's a bit less than 2 writes per word, and thus we
190+
// can't implement MultiwriteNorFlash.
191+
//
192+
// 2. The nRF52820 supports 2 writes per word but doesn't have an associated feature.
193+
#[cfg(any(
194+
feature = "52810",
195+
feature = "52811",
196+
feature = "52833",
197+
feature = "52840",
198+
))]
199+
impl<T: Instance> embedded_storage::nor_flash::MultiwriteNorFlash for Nvmc<T> {}
200+
186201
pub trait Instance: Deref<Target = nvmc::RegisterBlock> + sealed::Sealed {}
187202

188203
impl Instance for NVMC {}

0 commit comments

Comments
 (0)