aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/SAM7S256/gcc
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/gcc
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/gcc')
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/Makefile11
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/nxt.ld24
2 files changed, 31 insertions, 4 deletions
diff --git a/AT91SAM7S256/SAM7S256/gcc/Makefile b/AT91SAM7S256/SAM7S256/gcc/Makefile
index ad40886..e96e153 100644
--- a/AT91SAM7S256/SAM7S256/gcc/Makefile
+++ b/AT91SAM7S256/SAM7S256/gcc/Makefile
@@ -1,5 +1,6 @@
BASE = ../..
SRCDIR = $(BASE)/Source
+DBGDIR = $(BASE)/armdebug/Debugger
CPUINCDIR = $(BASE)/SAM7S256/Include
GIT_VERSION := $(shell git rev-parse --short=7 HEAD)
@@ -17,21 +18,23 @@ THUMB_SOURCES = c_button.c c_cmd.c c_comm.c c_display.c c_input.c c_ioctrl.c \
abort.c errno.c sbrk.c strtod.c sscanf.c \
Cstartup_SAM7.c
-ASM_ARM_SOURCE = Cstartup.S
+ASM_ARM_SOURCE = Cstartup.S abort_handler.S undef_handler.S debug_hexutils.S \
+ debug_stub.S debug_comm.S debug_opcodes.S debug_runlooptasks.S
ASM_THUMB_SOURCE =
vpath %.c $(SRCDIR)
vpath %.c $(CPUINCDIR)
vpath %.c lib
-vpath %.S $(CPUINCDIR)
+vpath %.S $(CPUINCDIR) $(DBGDIR)
-INCLUDES =
+INCLUDES = -I../../armdebug/Debugger
MCU = arm7tdmi
+DEBUG_DEFINES = -D__ARMDEBUG__
STARTOFUSERFLASH_DEFINES = -DSTARTOFUSERFLASH_FROM_LINKER=1
VERSION_DEFINES = -DCUSTOM_FIRMWAREVERSION=\"$(CUSTOM_FIRMWAREVERSION)\"
DEFINES = -DPROTOTYPE_PCB_4 -DNEW_MENU -DROM_RUN -DVECTORS_IN_RAM \
- $(STARTOFUSERFLASH_DEFINES) $(VERSION_DEFINES)
+ $(STARTOFUSERFLASH_DEFINES) $(VERSION_DEFINES) $(DEBUG_DEFINES)
OPTIMIZE = -Os -fno-strict-aliasing \
-ffunction-sections -fdata-sections
WARNINGS = -Wall -W -Wundef -Wno-unused -Wno-format
diff --git a/AT91SAM7S256/SAM7S256/gcc/nxt.ld b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
index d63944e..9b7171f 100644
--- a/AT91SAM7S256/SAM7S256/gcc/nxt.ld
+++ b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
@@ -87,6 +87,30 @@ SECTIONS
__STARTOFUSERFLASH_FROM_LINKER =
ALIGN (LOADADDR (.data) + SIZEOF (.data), 0x100);
+ /*
+ * The various debugger stacks.
+ */
+ .stack : ALIGN(8) {
+ /* abort stack */
+ __abort_stack_bottom__ = . ;
+ . += 0x80; /* 128 byte abort mode stack. */
+ __abort_stack__ = . ;
+ __abort_stack_top__ = . ;
+
+ /* debugger state */
+ __debugger_stack_bottom__ = . ;
+ . += 0x48; /* 16 user mode registers + SPSR + UNDEF Next Instruction Address */
+ __debugger_stack__ = . ;
+ __debugger_stack_top__ = . ;
+
+ /* breakpoints */
+ __breakpoints_start__ = . ;
+ . += 0x40; /* Single Stepping Breakpoint + 7 Breakpoints */
+ __breakpoints_end__ = . ;
+ } > DATA
+
+ __breakpoints_num__ = (__breakpoints_end__ - __breakpoints_start__) / 8;
+
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{