aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src/lib.rs')
-rw-r--r--embassy-nrf/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index ed8aad89b..3274dafb1 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -349,10 +349,11 @@ pub fn init(config: config::Config) -> Peripherals {
349 // Get the letter for the build code (b'A' .. b'F') 349 // Get the letter for the build code (b'A' .. b'F')
350 let build_code = (variant >> 8) as u8; 350 let build_code = (variant >> 8) as u8;
351 351
352 if build_code >= b'F' { 352 if build_code >= chip::APPROTECT_MIN_BUILD_CODE {
353 // Chips with build code F and higher (revision 3 and higher) have an 353 // Chips with a certain chip type-specific build code or higher have an
354 // improved APPROTECT ("hardware and software controlled access port protection") 354 // improved APPROTECT ("hardware and software controlled access port protection")
355 // which needs explicit action by the firmware to keep it unlocked 355 // which needs explicit action by the firmware to keep it unlocked
356 // See https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect
356 357
357 // UICR.APPROTECT = SwDisabled 358 // UICR.APPROTECT = SwDisabled
358 let res = uicr_write(consts::UICR_APPROTECT, consts::APPROTECT_DISABLED); 359 let res = uicr_write(consts::UICR_APPROTECT, consts::APPROTECT_DISABLED);