1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/tools/mspdebug.inc.mk
Marian Buschsieweke ca15b1e1f8
tools/mspdebug: fix make debug and make debugserver
The semantics of `make debug` and `make debugserver` have changed in
the years since the MSP430 integration. This brings the implementation
back into line with the current semantics

- `make debug` now starts both mspdebug and GDB, no need to
  run `make debugserver` prior to `make debug` anymore
- `make debug` no longer flashes the target to not waste flash erase
  cycles
- GDB mutliarch support is added
- support for selecting a debug adapter by its serial is added
2023-05-24 17:00:38 +02:00

28 lines
892 B
Makefile

FLASHER ?= mspdebug
FLASHFILE ?= $(HEXFILE)
MSPDEBUG_PROGRAMMER ?= olimex
DEBUGSERVER_PORT ?= 2000
DEBUGGER := $(RIOTTOOLS)/mspdebug/debug.sh
MSPDEBUG_PROTOCOL ?= JTAG
MSPDEBUG_TTY ?=
ifeq (JTAG,$(strip $(MSPDEBUG_PROTOCOL)))
FFLAGS += -j
endif
ifneq (,$(strip $(MSPDEBUG_TTY)))
FFLAGS += -d "$(MSPDEBUG_TTY)"
endif
ifneq (,$(strip $(DEBUG_ADAPTER_ID)))
FFLAGS += -s "$(DEBUG_ADAPTER_ID)"
endif
FFLAGS += $(MSPDEBUG_PROGRAMMER) "prog $(FLASHFILE)"
DEBUGGER_FLAGS = $(FLASHER) $(MSPDEBUG_PROGRAMMER) $(MSPDEBUG_PROTOCOL) "$(MSPDEBUG_TTY)" "$(DEBUG_ADAPTER_ID)" $(DEBUGSERVER_PORT) $(ELFFILE) $(PREFIX) $(RIOTBASE)
DEBUGSERVER := $(RIOTTOOLS)/mspdebug/debug_srv.sh
DEBUGSERVER_FLAGS = $(FLASHER) $(MSPDEBUG_PROGRAMMER) $(MSPDEBUG_PROTOCOL) "$(MSPDEBUG_TTY)" "$(DEBUG_ADAPTER_ID)" $(DEBUGSERVER_PORT)
# setup reset tool
RESET ?= mspdebug
RESET_FLAGS ?= -j $(MSPDEBUG_PROGRAMMER) reset