diff --git a/Makefile.buildtests b/Makefile.buildtests index 1ca6e4188b..16a1ee969b 100644 --- a/Makefile.buildtests +++ b/Makefile.buildtests @@ -193,4 +193,11 @@ buildinfo: @echo 'DEBUGGER: $(DEBUGGER)' @echo 'DEBUGGER_FLAGS: $(DEBUGGER_FLAGS)' @echo '' + @echo 'DEBUGSERVER: $(DEBUGSERVER)' + @echo 'DEBUGSERVER_FLAGS: $(DEBUGSERVER_FLAGS)' + @echo '' + @echo 'RESET: $(RESET)' + @echo 'RESET_FLAGS: $(RESET_FLAGS)' + @echo '' @echo -e 'MAKEFILE_LIST:$(patsubst %, \n\t%, $(abspath $(MAKEFILE_LIST)))' + diff --git a/Makefile.include b/Makefile.include index c2867acfe5..1ac1b589b2 100644 --- a/Makefile.include +++ b/Makefile.include @@ -157,6 +157,12 @@ doc: debug: $(DEBUGGER) $(DEBUGGER_FLAGS) +debug-server: + $(DEBUGSERVER) $(DEBUGSERVER_FLAGS) + +reset: + $(RESET) $(RESET_FLAGS) + # Extra make goals for testing and comparing changes. include $(RIOTBASE)/Makefile.buildtests diff --git a/Makefile.vars b/Makefile.vars index 2f895fdede..c91f33b7c1 100644 --- a/Makefile.vars +++ b/Makefile.vars @@ -40,3 +40,9 @@ export TERMPROG # The command to call on "make term". export PORT # The parameters to supply to TERMPROG. export ELFFILE # The unstripped result of the compilation. export HEXFILE # The stripped result of the compilation. +export DEBUGGER # The command to call on "make debug", usually a script starting the GDB front-end +export DEBUGGER_FLAGS # The parameters to supply to DEBUGGER +export DEBUGSERVER # The command to call on "make debug-server", usually a script starting the GDB server +export DEBUGSERVER_FLAGS # The parameters to supply to DEBUGSERVER +export RESET # The command to call on "make reset", this command resets/reboots the target +export RESET_FLAGS # The parameters to supply to RESET diff --git a/boards/msb-430-common/Makefile.include b/boards/msb-430-common/Makefile.include index 149f9fd07e..68bdb30fe7 100644 --- a/boards/msb-430-common/Makefile.include +++ b/boards/msb-430-common/Makefile.include @@ -18,13 +18,17 @@ TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm export FLASHER ?= mspdebug export PORT ?= /dev/ttyUSB0 export PROGRAMMER ?= olimex -export FFLAGS += -j $(PROGRAMMER) +export MSPDEBUGFLAGS += -j $(PROGRAMMER) ifeq ($(strip $(PROGRAMMER)),uif) - export FFLAGS += -d $(PORT) + export MSPDEBUGFLAGS += -d $(PORT) endif +export DEBUGSERVER = $(FLASHER) +export DEBUGSERVER_FLAGS = $(MSPDEBUGFLAGS) gdb +export DEBUGGER = $(PREFIX)gdb +export DEBUGGER_FLAGS = --tui --ex="target remote localhost:2000" --ex "monitor reset halt" --ex load -ex "monitor reset halt" $(ELFFILE) export TERMFLAGS += -p -export FFLAGS += "prog $(HEXFILE)" +export FFLAGS = $(MSPDEBUGFLAGS) "prog $(HEXFILE)" export USEMODULE += msp430_common export INCLUDES += -I$(RIOTCPU)/msp430-common/include/ -I$(RIOTBOARD)/msb-430-common/include -I$(RIOTBOARD)/msb-430-common/drivers/include diff --git a/boards/stm32f0discovery/Makefile.include b/boards/stm32f0discovery/Makefile.include index 2de34acfa4..94058251a9 100644 --- a/boards/stm32f0discovery/Makefile.include +++ b/boards/stm32f0discovery/Makefile.include @@ -25,6 +25,7 @@ export OBJCOPY = $(PREFIX)objcopy export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm export FLASHER = st-flash export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +export DEBUGSERVER = st-util # define build specific options CPU_USAGE = -mcpu=cortex-m0 diff --git a/boards/stm32f3discovery/Makefile.include b/boards/stm32f3discovery/Makefile.include index 2a16151d01..60a9ea884d 100644 --- a/boards/stm32f3discovery/Makefile.include +++ b/boards/stm32f3discovery/Makefile.include @@ -25,6 +25,7 @@ export OBJCOPY = $(PREFIX)objcopy export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm export FLASHER = st-flash export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +export DEBUGSERVER = st-util # define build specific options CPU_USAGE = -mcpu=cortex-m4 diff --git a/boards/stm32f4discovery/Makefile.include b/boards/stm32f4discovery/Makefile.include index 45aa0ad92b..6919759a3a 100644 --- a/boards/stm32f4discovery/Makefile.include +++ b/boards/stm32f4discovery/Makefile.include @@ -25,6 +25,7 @@ export OBJCOPY = $(PREFIX)objcopy export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm export FLASHER = st-flash export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh +export DEBUGSERVER = st-util # define build specific options CPU_USAGE = -mcpu=cortex-m4