From d00b5438310e23f0f2115ee660d066a1bfc1b23c Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 9 Nov 2013 14:23:13 +1000 Subject: Updated Makefile and new openocd config file for the Olimex SAM7EX256 board. Makefiles modifications required for updated gcc v4.7.2 --- boards/base/Olimex-SAM7EX256-GE8/example/Makefile | 8 ++- .../base/Olimex-SAM7EX256-GE8/example/openocd.cfg | 75 ++++++++++++++++++++++ 2 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 boards/base/Olimex-SAM7EX256-GE8/example/openocd.cfg (limited to 'boards/base') diff --git a/boards/base/Olimex-SAM7EX256-GE8/example/Makefile b/boards/base/Olimex-SAM7EX256-GE8/example/Makefile index cff4e7ad..d6161d5e 100644 --- a/boards/base/Olimex-SAM7EX256-GE8/example/Makefile +++ b/boards/base/Olimex-SAM7EX256-GE8/example/Makefile @@ -5,8 +5,9 @@ # Compiler options here. ifeq ($(USE_OPT),) -# USE_OPT = -O2 -ggdb -gstabs+ -fomit-frame-pointer -mabi=apcs-gnu - USE_OPT = -O0 -ggdb -gstabs+ -fomit-frame-pointer -mabi=apcs-gnu + # If you are using gcc V4.5.1 or older then replace -g with -ggdb -gstabs+ + # For debugging you probably want -O0 rather than -O2 + USE_OPT = -O0 -g -fomit-frame-pointer -mabi=apcs-gnu endif # C specific options here (added to USE_OPT). @@ -126,7 +127,8 @@ CPPC = $(TRGT)g++ # Enable loading with g++ only if you need C++ runtime support. # NOTE: You can use C++ even without C++ support if you are careful. C++ # runtime support makes code size explode. -LD = $(TRGT)gcc -ggdb -gstabs+ +# If you are using gcc V4.5.1 or older then add -ggdb -gstabs+ to the LD line +LD = $(TRGT)gcc #LD = $(TRGT)g++ CP = $(TRGT)objcopy AS = $(TRGT)gcc -x assembler-with-cpp diff --git a/boards/base/Olimex-SAM7EX256-GE8/example/openocd.cfg b/boards/base/Olimex-SAM7EX256-GE8/example/openocd.cfg new file mode 100644 index 00000000..8c58e6f0 --- /dev/null +++ b/boards/base/Olimex-SAM7EX256-GE8/example/openocd.cfg @@ -0,0 +1,75 @@ +# This is a script file for OpenOCD 0.7.0 +# +# It is set up for the Olimex SAM7EX256 board using the Olimex Tiny-H JTAG adaptor. +# +# Assuming the current directory is your project directory containing this openocd.cfg file... +# +# To program your device: +# +# openocd -f openocd.cfg -c "Burn yourfile.bin" -c shutdown +# +# To debug your device: +# +# openocd +# (This will run openocd in gdb server debug mode. Leave it running in the background) +# +# gdb yourfile.elf +# (To start gdb. Then run the following commands in gdb...) +# +# target remote 127.0.0.1:3333 +# monitor Debug +# stepi +# (This last stepi resynchronizes gdb). +# +# If you want to reprogram from within gdb: +# +# monitor Burn yourfile.bin +# + +echo "" +echo "##### Loading debugger..." +source [find interface/olimex-arm-usb-tiny-h.cfg] +#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg] + +echo "" +echo "##### Loading CPU..." +source [find target/at91sam7x256.cfg] + +echo "" +echo "##### Configuring..." +jtag_rclk 3000 +arm7_9 dcc_downloads enable +arm7_9 fast_memory_access enable +# flash protect 0 0 1 off +#gdb_breakpoint_override hard +arm7_9 dbgrq enable + +proc Debug { } { + echo "" + echo "##### Debug Session Connected..." + soft_reset_halt + reg pc 0x00100000 + echo "Ready..." +} + +proc Burn {file} { + echo "" + echo "##### Burning $file to device..." + halt + flash write_image erase unlock $file 0x00100000 + reset + echo "Burning Complete!" +} + +echo "" +echo "##### Leaving Configuration Mode..." +init +soft_reset_halt +$_TARGETNAME invoke-event reset-init +flash probe 0 +flash banks + +echo "" +echo "##### Waiting for debug connections..." + + -- cgit v1.2.3