From ff256deb74ca15caf41be4b1ff81c299e54403a6 Mon Sep 17 00:00:00 2001 From: TC Wan Date: Tue, 21 Dec 2010 17:57:54 +0800 Subject: updated makefile and linker file for armdebug support --- AT91SAM7S256/SAM7S256/gcc/Makefile | 7 ++++--- AT91SAM7S256/SAM7S256/gcc/nxt.ld | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'AT91SAM7S256/SAM7S256') diff --git a/AT91SAM7S256/SAM7S256/gcc/Makefile b/AT91SAM7S256/SAM7S256/gcc/Makefile index 7ad3156..39163f6 100644 --- a/AT91SAM7S256/SAM7S256/gcc/Makefile +++ b/AT91SAM7S256/SAM7S256/gcc/Makefile @@ -1,4 +1,5 @@ BASE = ../.. +DBGDIR = $(BASE)/armdebug/Debugger SRCDIR = $(BASE)/Source CPUINCDIR = $(BASE)/SAM7S256/Include @@ -7,7 +8,7 @@ CUSTOM_FIRMWAREVERSION = $(GIT_VERSION) TARGET = nxt_firmware -ARM_SOURCES = +ARM_SOURCES = THUMB_SOURCES = c_button.c c_cmd.c c_comm.c c_display.c c_input.c c_ioctrl.c \ c_loader.c c_lowspeed.c c_output.c c_sound.c c_ui.c \ d_bt.c d_button.c d_display.c d_hispeed.c d_input.c \ @@ -17,13 +18,13 @@ THUMB_SOURCES = c_button.c c_cmd.c c_comm.c c_display.c c_input.c c_ioctrl.c \ errno.c sbrk.c strtod.c sscanf.c \ Cstartup_SAM7.c -ASM_ARM_SOURCE = Cstartup.S +ASM_ARM_SOURCE = Cstartup.S undef_handler.S debug_stub.S debug_comm.S ASM_THUMB_SOURCE = vpath %.c $(SRCDIR) vpath %.c $(CPUINCDIR) vpath %.c lib -vpath %.S $(CPUINCDIR) +vpath %.S $(CPUINCDIR) $(DBGDIR) INCLUDES = diff --git a/AT91SAM7S256/SAM7S256/gcc/nxt.ld b/AT91SAM7S256/SAM7S256/gcc/nxt.ld index 8e5f0cb..28e118a 100644 --- a/AT91SAM7S256/SAM7S256/gcc/nxt.ld +++ b/AT91SAM7S256/SAM7S256/gcc/nxt.ld @@ -80,6 +80,31 @@ SECTIONS __STARTOFUSERFLASH_FROM_LINKER = ALIGN (LOADADDR (.data) + SIZEOF (.data), 0x100); + /* + * The various debugger stacks. + */ + .stack : ALIGN(8) { + + /* abort stack */ + __abort_stack_bottom__ = . ; + . += 0x60; /* 96 byte supervisor 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) : { @@ -96,6 +121,7 @@ SECTIONS __bss_end__ = . ; + _end = .; PROVIDE (end = .); -- cgit v1.2.3