diff --git a/boards/samr21-xpro/Makefile.include b/boards/samr21-xpro/Makefile.include index bb4791976a..5355f35bc2 100644 --- a/boards/samr21-xpro/Makefile.include +++ b/boards/samr21-xpro/Makefile.include @@ -14,9 +14,12 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy -export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm -p -export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh -export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +export DBG = $(PREFIX)gdb +export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm +export FLASHER = $(RIOTBASE)/dist/tools/openocd/openocd.sh +export DEBUGGER = $(RIOTBASE)/dist/tools/openocd/openocd.sh +export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh +export RESET = $(RIOTBASE)/dist/tools/openocd/openocd.sh # define build specific options export CPU_USAGE = -mcpu=cortex-m0plus @@ -27,10 +30,12 @@ export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mno-thumb-interwork -nostartfiles # linkerscript specified in cpu/Makefile.include export LINKFLAGS += -T$(LINKERSCRIPT) -export OFLAGS += -O binary -export FFLAGS += $(HEXFILE) -export DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE) -export TERMFLAGS += "$(PORT)" +export OFLAGS = -O ihex +export TERMFLAGS += -p "$(PORT)" +export FFLAGS = flash +export DEBUGGER_FLAGS = debug +export DEBUGSERVER_FLAGS = debug-server +export RESET_FLAGS = reset # unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ export CXXUWFLAGS += @@ -42,5 +47,5 @@ export LINKFLAGS += -specs=nano.specs -lc -lnosys endif # export board specific includes to the global includes-listing -export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ +export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ include $(RIOTBOARD)/$(BOARD)/Makefile.dep diff --git a/boards/samr21-xpro/dist/debug.sh b/boards/samr21-xpro/dist/debug.sh deleted file mode 100755 index 5b0fad1f71..0000000000 --- a/boards/samr21-xpro/dist/debug.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -openocd -f "board/atmel_samr21_xplained_pro.cfg" \ - -c "tcl_port 6333" \ - -c "telnet_port 4444" \ - -c "init" \ - -c "targets" \ - -c "reset halt" \ - -l /dev/null & - -# save pid to terminate afterwards -OCD_PID=$? - -# needed for openocd to set up -sleep 5 - -arm-none-eabi-gdb -tui --command=${1} ${2} - -kill ${OCD_PID} diff --git a/boards/samr21-xpro/dist/flash.sh b/boards/samr21-xpro/dist/flash.sh deleted file mode 100755 index e33ada6b3a..0000000000 --- a/boards/samr21-xpro/dist/flash.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -openocd -f "board/atmel_samr21_xplained_pro.cfg" \ - -c "init" \ - -c "targets" \ - -c "reset halt" \ - -c "reset init" \ - -c "flash write_image erase $1" \ - -c "verify_image $1" \ - -c "reset run" \ - -c "shutdown" diff --git a/boards/samr21-xpro/dist/gdb.conf b/boards/samr21-xpro/dist/gdb.conf deleted file mode 100644 index 8a693c6a03..0000000000 --- a/boards/samr21-xpro/dist/gdb.conf +++ /dev/null @@ -1,2 +0,0 @@ -target remote localhost:3333 -monitor reset halt diff --git a/boards/samr21-xpro/dist/openocd.cfg b/boards/samr21-xpro/dist/openocd.cfg new file mode 100644 index 0000000000..2c81bdfbfa --- /dev/null +++ b/boards/samr21-xpro/dist/openocd.cfg @@ -0,0 +1 @@ +source [find board/atmel_samr21_xplained_pro.cfg]