aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-02-27 18:32:50 -0500
committerPerry Hung <iperry@gmail.com>2011-02-27 18:32:50 -0500
commit3d455ef619036b2cc77a87b715cf1d45c95ce271 (patch)
tree11c348dd408c57525043a2744ee2f1c11eaeef10
parent68c483e3c9c382779d2580598fb0f90a9f55d2ab (diff)
downloadlibrambutan-3d455ef619036b2cc77a87b715cf1d45c95ce271.tar.gz
librambutan-3d455ef619036b2cc77a87b715cf1d45c95ce271.zip
Also disable systick handler in exception path.
-rw-r--r--libmaple/exc.S12
1 files changed, 8 insertions, 4 deletions
diff --git a/libmaple/exc.S b/libmaple/exc.S
index 823bbc5..f31fccd 100644
--- a/libmaple/exc.S
+++ b/libmaple/exc.S
@@ -80,6 +80,9 @@ __default_exc:
mov r1 ,#1 @ exception. See flag NONEBASETHRDENA.
str r1, [r2]
cpsid i @ Disable global interrupts
+ ldr r2, SYSTICK_CSR @ Disable systick handler
+ mov r1, #0
+ str r1, [r2]
ldr r1, CPSR_MASK @ Set default CPSR
push {r1}
ldr r1, TARGET_PC @ Set target pc
@@ -90,8 +93,9 @@ __default_exc:
bx lr @ Exception exit
.align 4
-CPSR_MASK: .word 0x61000000
-EXC_RETURN: .word 0xFFFFFFF9
-TARGET_PC: .word __error
-NVIC_CCR: .word 0xE000ED14 @ NVIC configuration control register
+CPSR_MASK: .word 0x61000000
+EXC_RETURN: .word 0xFFFFFFF9
+TARGET_PC: .word __error
+NVIC_CCR: .word 0xE000ED14 @ NVIC configuration control register
+SYSTICK_CSR: .word 0xE000E010 @ Systick control register