Configure the flash as read-only at boot

This commit is contained in:
Julien Cretin
2022-06-30 16:56:05 +02:00
parent 667c269552
commit 8549e2e436
3 changed files with 7 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/chips/nrf52/src/nvmc.rs b/chips/nrf52/src/nvmc.rs
index adbc2a2b5..7594ec867 100644
index adbc2a2b5..4092cf346 100644
--- a/chips/nrf52/src/nvmc.rs
+++ b/chips/nrf52/src/nvmc.rs
@@ -3,15 +3,19 @@
@@ -68,7 +68,7 @@ index adbc2a2b5..7594ec867 100644
let word: u32 = (data[i + 0] as u32) << 0
| (data[i + 1] as u32) << 8
| (data[i + 2] as u32) << 16
@@ -387,3 +399,236 @@ impl hil::flash::Flash for Nvmc {
@@ -387,3 +399,237 @@ impl hil::flash::Flash for Nvmc {
self.erase_page(page_number)
}
}
@@ -139,6 +139,7 @@ index adbc2a2b5..7594ec867 100644
+ apps: Grant<App>,
+ deferred_caller: &'static DynamicDeferredCall,
+ ) -> SyscallDriver {
+ nvmc.configure_readonly();
+ SyscallDriver {
+ nvmc,
+ apps,