nrf51dk, nrf52dk; change startup code for split app to reset CPU
mode to 0.


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

Branch: refs/heads/develop
Commit: b32668d043aa8f4307d2c384e82e458d332f6eff
Parents: 12fdc5c
Author: Marko Kiiskila <[email protected]>
Authored: Wed Jan 25 14:18:00 2017 -0800
Committer: Marko Kiiskila <[email protected]>
Committed: Wed Jan 25 14:32:31 2017 -0800

----------------------------------------------------------------------
 hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s | 5 +++++
 hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b32668d0/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s 
b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s
index 73602ef..ec41c56 100755
--- a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s
+++ b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s
@@ -88,6 +88,11 @@ __isr_vector_split:
 Reset_Handler_split:
     .fnstart
 
+/* Clear CPU state before proceeding */
+    SUBS    r0, r0
+    MSR     CONTROL, r0
+    MSR     PRIMASK, r0
+
 /* Make sure ALL RAM banks are powered on */
     MOVS    R1, #NRF_POWER_RAMONx_RAMxON_ONMODE_Msk
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/b32668d0/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s 
b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s
index 51899e3..de1ce6e 100755
--- a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s
+++ b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s
@@ -83,8 +83,11 @@ __isr_vector_split:
 Reset_Handler_split:
     .fnstart
 
-    /* Clear BSS */
+    /* Clear CPU state before proceeding */
     mov     r0, #0
+    msr     control, r0
+    msr     primask, r0
+    /* Clear BSS */
     ldr     r2, =__bss_start__
     ldr     r3, =__bss_end__
 .bss_zero_loop:

Reply via email to