1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/makefiles/tools/edbg.inc.mk
Kaspar Schleiser e6776ae8d1
edbg.inc.mk: allow flashing with an offset in rom
Allow flashing with an offset in ROM from the rom base address.
It reuses `IMAGE_OFFSET` configuration variable name from `openocd.sh`.

This will allow flashing multiple images with different flash operations.
2018-08-16 16:49:16 +02:00

24 lines
703 B
Makefile

RIOT_EDBG = $(RIOTTOOLS)/edbg/edbg
EDBG ?= $(RIOT_EDBG)
FLASHER ?= $(EDBG)
HEXFILE = $(BINFILE)
# Use USB serial number to select device when more than one is connected
# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number.
# Usage:
# export DEBUG_ADAPTER_ID="ATML..."
# BOARD=<board> make flash
ifneq (,$(DEBUG_ADAPTER_ID))
EDBG_ARGS += --serial $(DEBUG_ADAPTER_ID)
endif
# Set offset according to IMAGE_OFFSET if it's defined
EDBG_ARGS += $(addprefix --offset ,$(IMAGE_OFFSET))
FFLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -v -p -f $(HEXFILE)
ifeq ($(RIOT_EDBG),$(FLASHER))
FLASHDEPS += $(RIOT_EDBG)
endif
RESET ?= $(EDBG)
RESET_FLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE)