aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/SAM7S256/gcc
diff options
context:
space:
mode:
authorNicolas Schodet2012-02-11 17:39:48 +0100
committerNicolas Schodet2012-02-11 17:40:50 +0100
commiteb584f8d27a856e8f4d2ddebdd1173ff04217946 (patch)
tree83bbf94ff00b0120c3e37aeb3f725561b03f1c5d /AT91SAM7S256/SAM7S256/gcc
parent35d4c19a154b0b4366876783eacb13bec27d288c (diff)
parent99a4c90dee42104638933096728bebc45e28bf1a (diff)
Merge branch 'master'
Conflicts: AT91SAM7S256/SAM7S256/Include/Cstartup.S AT91SAM7S256/SAM7S256/Include/sam7s256.c AT91SAM7S256/SAM7S256/gcc/Makefile AT91SAM7S256/SAM7S256/gcc/nxt.ld AT91SAM7S256/Source/c_comm.c AT91SAM7S256/Source/c_comm.h
Diffstat (limited to 'AT91SAM7S256/SAM7S256/gcc')
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/Makefile26
-rw-r--r--AT91SAM7S256/SAM7S256/gcc/nxt.ld48
2 files changed, 41 insertions, 33 deletions
diff --git a/AT91SAM7S256/SAM7S256/gcc/Makefile b/AT91SAM7S256/SAM7S256/gcc/Makefile
index f8f8561..93334fa 100644
--- a/AT91SAM7S256/SAM7S256/gcc/Makefile
+++ b/AT91SAM7S256/SAM7S256/gcc/Makefile
@@ -1,6 +1,6 @@
BASE = ../..
-DBGDIR = $(BASE)/armdebug/Debugger
SRCDIR = $(BASE)/Source
+DBGDIR = $(BASE)/armdebug/Debugger
CPUINCDIR = $(BASE)/SAM7S256/Include
GIT_VERSION := $(shell git rev-parse --short=7 HEAD)
@@ -8,7 +8,10 @@ CUSTOM_FIRMWAREVERSION = $(GIT_VERSION)
TARGET = nxt_firmware
-ARM_SOURCES =
+# Set to 'y' to enable embedded debuger.
+ARMDEBUG = n
+
+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 \
@@ -18,23 +21,21 @@ 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 abort_handler.S undef_handler.S debug_hexutils.S \
- debug_stub.S debug_comm.S debug_opcodes.S debug_runlooptasks.S
+ASM_ARM_SOURCE = Cstartup.S
ASM_THUMB_SOURCE =
vpath %.c $(SRCDIR)
vpath %.c $(CPUINCDIR)
vpath %.c lib
-vpath %.S $(CPUINCDIR) $(DBGDIR)
+vpath %.S $(CPUINCDIR)
-INCLUDES = -I../../armdebug/Debugger
+INCLUDES =
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) $(DEBUG_DEFINES)
+ $(STARTOFUSERFLASH_DEFINES) $(VERSION_DEFINES)
OPTIMIZE = -Os -fno-strict-aliasing \
-ffunction-sections -fdata-sections
WARNINGS = -Wall -W -Wundef -Wno-unused -Wno-format
@@ -46,6 +47,15 @@ LDSCRIPT = nxt.ld
LDFLAGS = -nostdlib -T $(LDSCRIPT) -Wl,--gc-sections
LDLIBS = -lc -lm -lgcc
+ifeq ($(ARMDEBUG),y)
+ASM_ARM_SOURCE += abort_handler.S undef_handler.S debug_hexutils.S \
+ debug_stub.S debug_comm.S debug_opcodes.S \
+ debug_runlooptasks.S
+vpath %.S $(DBGDIR)
+DEFINES += -DARMDEBUG
+INCLUDES += -I../../armdebug/Debugger
+endif
+
CROSS_COMPILE = arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
OBJDUMP = $(CROSS_COMPILE)objdump
diff --git a/AT91SAM7S256/SAM7S256/gcc/nxt.ld b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
index 7b5a9e2..e54bc5d 100644
--- a/AT91SAM7S256/SAM7S256/gcc/nxt.ld
+++ b/AT91SAM7S256/SAM7S256/gcc/nxt.ld
@@ -87,30 +87,29 @@ 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;
+ /*
+ * The various debugger stacks.
+ */
+ .stack : ALIGN(8) {
+ /* abort stack */
+ __abort_stack_bottom__ = . ;
+ KEEP(*(.stack.abort))
+ __abort_stack__ = . ;
+ __abort_stack_top__ = . ;
+
+ /* debugger state */
+ __debugger_stack_bottom__ = . ;
+ KEEP(*(.stack.debugger))
+ __debugger_stack__ = . ;
+ __debugger_stack_top__ = . ;
+
+ /* breakpoints */
+ __breakpoints_start__ = . ;
+ KEEP(*(.breakpoints))
+ __breakpoints_end__ = . ;
+ } > DATA
+
+ __breakpoints_num__ = (__breakpoints_end__ - __breakpoints_start__) / 8;
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
@@ -128,7 +127,6 @@ SECTIONS
__bss_end__ = . ;
-
_end = .;
PROVIDE (end = .);