From 3d455ef619036b2cc77a87b715cf1d45c95ce271 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Sun, 27 Feb 2011 18:32:50 -0500 Subject: Also disable systick handler in exception path. --- libmaple/exc.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libmaple/exc.S') 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 -- cgit v1.2.3