This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 96c2cada4 mcu/nrf52: Handle APROTECT
96c2cada4 is described below

commit 96c2cada4cc04c1b33489287f8796cf1bbf06309
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Wed Jun 8 14:15:13 2022 +0200

    mcu/nrf52: Handle APROTECT
    
    Newest hardware revisions of NRF52840, NRF52810 (and others) now have
    access port protection enabled by default.
    
    To enable debugger use after reset nrf52_handle_approtect() should be
    called during startup.
    
    SystemInit from NRF SDK now has and uses code to handle APROTECT, this
    change do the same for mynewt.
---
 hw/mcu/nordic/nrf52xxx/src/system_nrf52.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c 
b/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
index 902d16483..57a6d5a12 100644
--- a/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
+++ b/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
@@ -49,6 +49,8 @@
 #include "system_nrf52811.h"
 #endif
 
+#include "system_nrf52_approtect.h"
+
 /*lint ++flb "Enter library region" */
 
 #define __SYSTEM_CLOCK_64M      (64000000UL)
@@ -487,6 +489,8 @@ void SystemInit(void)
             NRF_P1->PIN_CNF[9]  = (GPIO_PIN_CNF_DRIVE_H0H1 << 
GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_INPUT_Connect << 
GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
         #endif
 #endif
+    nrf52_handle_approtect();
+
     SystemCoreClockUpdate();
 
     NVIC_Relocate();

Reply via email to