You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/10/31 05:38:51 UTC

incubator-mynewt-larva git commit: Only issue "bkpt" on restart if debugger is attached.

Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master 73f7db240 -> cc3b813e1


Only issue "bkpt" on restart if debugger is attached.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/cc3b813e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/cc3b813e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/cc3b813e

Branch: refs/heads/master
Commit: cc3b813e117f77d44c6af4fee06dea203c52c37c
Parents: 73f7db2
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Oct 30 21:38:09 2015 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Oct 30 21:38:09 2015 -0700

----------------------------------------------------------------------
 hw/mcu/nordic/nrf52xxx/src/hal_system.c | 7 ++++++-
 hw/mcu/stm/stm32f3xx/src/hal_system.c   | 7 ++++++-
 hw/mcu/stm/stm32f4xx/src/hal_system.c   | 7 ++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cc3b813e/hw/mcu/nordic/nrf52xxx/src/hal_system.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_system.c b/hw/mcu/nordic/nrf52xxx/src/hal_system.c
index 37ebd6e..5fc2cbc 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_system.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_system.c
@@ -21,7 +21,12 @@ void
 system_reset(void)
 {
     while (1) {
-        asm("bkpt");
+        if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) {
+            /*
+             * If debugger is attached, breakpoint here.
+             */
+            asm("bkpt");
+        }
         NVIC_SystemReset();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cc3b813e/hw/mcu/stm/stm32f3xx/src/hal_system.c
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_system.c b/hw/mcu/stm/stm32f3xx/src/hal_system.c
index 8329f7f..9b2b00e 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_system.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_system.c
@@ -20,7 +20,12 @@ void
 system_reset(void)
 {
     while (1) {
-        asm("bkpt");
+        if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) {
+            /*
+             * If debugger is attached, breakpoint here.
+             */
+            asm("bkpt");
+        }
         NVIC_SystemReset();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cc3b813e/hw/mcu/stm/stm32f4xx/src/hal_system.c
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_system.c b/hw/mcu/stm/stm32f4xx/src/hal_system.c
index 2199024..d961621 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_system.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_system.c
@@ -21,7 +21,12 @@ void
 system_reset(void)
 {
     while (1) {
-        asm("bkpt");
+        if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) {
+            /*
+             * If debugger is attached, breakpoint here.
+             */
+            asm("bkpt");
+        }
         NVIC_SystemReset();
     }
 }