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 2016/10/07 18:21:58 UTC

incubator-mynewt-core git commit: This closes #112.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop a398137f4 -> a6a2c878e


This closes #112.

kernel: os: arch: m4: set vectors for functions in HAL_M4

Differences across board initialization can lead to having
uninitialized vectors for several of the functions defined
in HAL_M4.  Explicitly set them to be sure they are correct.

This fixes a HardFault issue when using SVC_Call after moving
vectors to ram on FRDM-K64F hardware.

Signed-off-by: Michael Scott <mi...@linaro.org>


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/a6a2c878
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a6a2c878
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a6a2c878

Branch: refs/heads/develop
Commit: a6a2c878e5735dff06ab550119fea12d52d1f52c
Parents: a398137
Author: Michael Scott <mi...@linaro.org>
Authored: Fri Oct 7 10:59:55 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Oct 7 11:12:45 2016 -0700

----------------------------------------------------------------------
 kernel/os/src/arch/cortex_m4/os_arch_arm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a6a2c878/kernel/os/src/arch/cortex_m4/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/arch/cortex_m4/os_arch_arm.c b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
index cef11f9..7cc8f7b 100755
--- a/kernel/os/src/arch/cortex_m4/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
@@ -25,6 +25,13 @@
 
 #include "os_priv.h"
 
+/*
+ * From HAL_CM4.s
+ */
+extern void SVC_Handler(void);
+extern void PendSV_Handler(void);
+extern void SysTick_Handler(void);
+
 /* Initial program status register */
 #define INITIAL_xPSR    0x01000000
 
@@ -196,6 +203,10 @@ os_arch_os_init(void)
             NVIC->IP[i] = 0xff;
         }
 
+        NVIC_SetVector(SVCall_IRQn, (uint32_t)SVC_Handler);
+        NVIC_SetVector(PendSV_IRQn, (uint32_t)PendSV_Handler);
+        NVIC_SetVector(SysTick_IRQn, (uint32_t)SysTick_Handler);
+
         /*
          * Install default interrupt handler, which'll print out system
          * state at the time of the interrupt, and few other regs which