Skip to content
Snippets Groups Projects
Commit d7d796b8 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

makefiles: add edbg tool support

parent 6a917594
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# Usage: SERIAL="ATML..." BOARD=<board> make flash
ifneq (,$(SERIAL))
export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)"
EDBG_ARGS += "--serial $(SERIAL)"
SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL)))
ifeq (,$(SERIAL_TTY))
$(error Did not find a device with serial $(SERIAL))
......@@ -17,5 +18,15 @@ ifneq (,$(SERIAL))
PORT_LINUX := $(SERIAL_TTY)
endif
# this board uses openocd
# set this to either openocd or edbg
PROGRAMMER ?= edbg
# use edbg if selected and a device type has been set
ifeq ($(PROGRAMMER),edbg)
ifneq (,$(EDBG_DEVICE_TYPE))
include $(RIOTMAKE)/tools/edbg.inc.mk
endif
endif
# this board uses openocd for debug and possibly flashing
include $(RIOTMAKE)/tools/openocd.inc.mk
RIOT_EDBG = $(RIOTBASE)/dist/tools/edbg/edbg
EDBG ?= $(RIOT_EDBG)
FLASHER ?= $(EDBG)
OFLAGS ?= -O binary
HEXFILE = $(ELFFILE:.elf=.bin)
FFLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -e -v -p -f $(HEXFILE)
ifeq ($(RIOT_EDBG),$(FLASHER))
FLASHDEPS += $(RIOT_EDBG)
endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment