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 aafc099a1c
dist/tools/mspdebug: build from source
This adds mspdebug as package, similar to EDBG, so that the
programmer/debugger is build from source.

This has the advantage that we can indeed provide patches of our own.
The first patch fixes a bug with the CPU detection of `mspdebug` in
combination with the Olimex MSP430-JTAG-TINY-V2. The second adds the
`--expect-id <CPU_NAME>` argument.

The RIOT integration is updated to directly make use of the
`--expect-id` parameter. No more spending time debugging why firmware
the firmware for the `olimex-msp430-h2618` doesn't run when flashed on
the `olimex-msp430h1611` hardware :D
2024-02-06 15:23:02 +01:00

33 lines
1.1 KiB
Makefile

FLASHFILE ?= $(HEXFILE)
MSPDEBUG_PROGRAMMER ?= olimex
MSPDEBUG ?= $(RIOTTOOLS)/mspdebug/mspdebug
FLASHER ?= $(MSPDEBUG)
FLASHDEPS += $(MSPDEBUG)
DEBUGSERVER_PORT ?= 2000
DEBUGGER := $(RIOTTOOLS)/mspdebug/debug.sh
MSPDEBUG_PROTOCOL ?= JTAG
MSPDEBUG_TTY ?=
DEBUG_TARGET := $(call uppercase_and_underscore,$(CPU_MODEL))
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 += --expect-id "$(DEBUG_TARGET)"
FFLAGS += $(MSPDEBUG_PROGRAMMER) "prog $(FLASHFILE)"
DEBUGGER_FLAGS = $(MSPDEBUG) $(MSPDEBUG_PROGRAMMER) $(MSPDEBUG_PROTOCOL) "$(MSPDEBUG_TTY)" "$(DEBUG_ADAPTER_ID)" "$(DEBUG_TARGET)" $(DEBUGSERVER_PORT) $(ELFFILE) $(PREFIX) $(RIOTBASE)
DEBUGSERVER := $(RIOTTOOLS)/mspdebug/debug_srv.sh
DEBUGSERVER_FLAGS = $(MSPDEBUG) $(MSPDEBUG_PROGRAMMER) $(MSPDEBUG_PROTOCOL) "$(MSPDEBUG_TTY)" "$(DEBUG_ADAPTER_ID)" "$(DEBUG_TARGET)" $(DEBUGSERVER_PORT)
# setup reset tool
RESET ?= $(MSPDEBUG)
RESET_FLAGS ?= -j $(MSPDEBUG_PROGRAMMER) reset