aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/SAM7S256/Include
diff options
context:
space:
mode:
authorTat-Chee Wan2012-02-03 23:57:04 +0100
committerNicolas Schodet2012-02-11 17:30:42 +0100
commitd50dd5ab9567cc308e412c5e9e775dc8e15fb509 (patch)
treeb7d30c1025fb34e65a04d15701c53ee2ca071dec /AT91SAM7S256/SAM7S256/Include
parentceb0cbf65a11aed7662eb41ae66157e60ff61d60 (diff)
merge armdebug rc1
This enables the use of GDB or GDB based debuggers to debug the code running on the NXT brick using the USB connection.
Diffstat (limited to 'AT91SAM7S256/SAM7S256/Include')
-rw-r--r--AT91SAM7S256/SAM7S256/Include/Cstartup.S19
-rw-r--r--AT91SAM7S256/SAM7S256/Include/sam7s256.c6
2 files changed, 21 insertions, 4 deletions
diff --git a/AT91SAM7S256/SAM7S256/Include/Cstartup.S b/AT91SAM7S256/SAM7S256/Include/Cstartup.S
index b60ba2c..e3e996e 100644
--- a/AT91SAM7S256/SAM7S256/Include/Cstartup.S
+++ b/AT91SAM7S256/SAM7S256/Include/Cstartup.S
@@ -136,16 +136,22 @@ FIQ_Handler_Entry:
/* end of fiqhandler */
Reset_Addr: .word InitReset
-Undef_Addr: .word Undef_Handler
+Undef_Addr: .word undef_handler /* BKPT instruction trap */
SWI_Addr: .word SWI_Handler
/*SWI_Addr: .word SoftwareInterruptASM*/ /*in swi_handler.S */
-PAbt_Addr: .word PAbt_Handler
-DAbt_Addr: .word DAbt_Handler
+PAbt_Addr: .word prefetch_abort_handler
+DAbt_Addr: .word data_abort_handler
IRQ_Addr: .word IRQ_Handler_Entry
-
+
+ .global default_undef_handler
+default_undef_handler:
Undef_Handler: B Undef_Handler
SWI_Handler: B SWI_Handler
+ .global default_prefetch_abort_handler
+default_prefetch_abort_handler:
PAbt_Handler: B PAbt_Handler
+ .global default_data_abort_handler
+default_data_abort_handler:
DAbt_Handler: B DAbt_Handler
@@ -255,6 +261,7 @@ already_remapped:
.EQU ARM_MODE_FIQ, 0x11
.EQU ARM_MODE_IRQ, 0x12
.EQU ARM_MODE_SVC, 0x13
+ .EQU ARM_MODE_ABT, 0x17
.EQU I_BIT, 0x80
.EQU F_BIT, 0x40
@@ -264,6 +271,10 @@ already_remapped:
//*-------------------------------*/
mov r0, sp /* see (**) */
+/*- Set up Abort Mode Stack for Debugger*/
+ msr CPSR_c, #ARM_MODE_ABT | I_BIT | F_BIT
+ ldr sp, =__abort_stack_top__
+
/*- Set up Fast Interrupt Mode and set FIQ Mode Stack*/
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT
mov sp, r0
diff --git a/AT91SAM7S256/SAM7S256/Include/sam7s256.c b/AT91SAM7S256/SAM7S256/Include/sam7s256.c
index cc22ca3..8ff0ab4 100644
--- a/AT91SAM7S256/SAM7S256/Include/sam7s256.c
+++ b/AT91SAM7S256/SAM7S256/Include/sam7s256.c
@@ -11,6 +11,9 @@
//
// Platform C
//
+#ifdef __ARMDEBUG__
+#include "debug_stub.h"
+#endif
void main(void)
{
@@ -18,6 +21,9 @@ void main(void)
{
HARDWAREInit;
mSchedInit();
+#ifdef __ARMDEBUG__
+ dbg__bkpt_init();
+#endif
while(TRUE == mSchedCtrl())
{
OSWatchdogWrite;