From 34abdbe5f24833b739ba9c0c94c46f199924238e Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 5 Aug 2014 00:49:59 +0200 Subject: [PATCH 1/3] make: added targets 'debug-server' and 'reset' - added targets to Makefile.include - added DEBUGSERVER and RESET vars to Makefile.vars - added output of those to Makefile.buildtests --- Makefile.buildtests | 7 +++++++ Makefile.include | 6 ++++++ Makefile.vars | 6 ++++++ 3 files changed, 19 insertions(+) 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 From 9ced34a52d39ba9df6cbb8387913a13359bda274 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 5 Aug 2014 18:22:54 +0200 Subject: [PATCH 2/3] boards/stm32fXdiscovery: added debug-server target added "make debug-server" target for - stm32f0discovery - stm32f3discovery - stm32f4discovery --- boards/stm32f0discovery/Makefile.include | 1 + boards/stm32f3discovery/Makefile.include | 1 + boards/stm32f4discovery/Makefile.include | 1 + 3 files changed, 3 insertions(+) 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 From bbdd93e9d39e362acc6fb0464f66a91f8bb9f6c6 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 5 Aug 2014 13:43:58 +0200 Subject: [PATCH 3/3] make: msb-430 boards: added debug and debugserver targets --- boards/msb-430-common/Makefile.include | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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