2018-05-15 11:29:33 +02:00
|
|
|
RIOT_EDBG = $(RIOTTOOLS)/edbg/edbg
|
2017-05-18 12:10:10 +02:00
|
|
|
EDBG ?= $(RIOT_EDBG)
|
|
|
|
FLASHER ?= $(EDBG)
|
2018-12-19 19:34:37 +01:00
|
|
|
FLASHFILE ?= $(BINFILE)
|
2017-10-08 07:58:02 +02:00
|
|
|
# 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
|
2018-08-16 16:36:05 +02:00
|
|
|
|
|
|
|
# Set offset according to IMAGE_OFFSET if it's defined
|
2018-09-18 18:28:19 +02:00
|
|
|
EDBG_ARGS += $(if $(IMAGE_OFFSET),--offset $(IMAGE_OFFSET))
|
2018-08-16 16:36:05 +02:00
|
|
|
|
2018-12-19 19:34:37 +01:00
|
|
|
FFLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -v -p -f $(FLASHFILE)
|
2017-05-18 12:10:10 +02:00
|
|
|
|
|
|
|
ifeq ($(RIOT_EDBG),$(FLASHER))
|
|
|
|
FLASHDEPS += $(RIOT_EDBG)
|
|
|
|
endif
|
2018-02-16 15:32:58 +01:00
|
|
|
RESET ?= $(EDBG)
|
|
|
|
RESET_FLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE)
|