1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/tools/jlink.inc.mk
Marian Buschsieweke 63d535e21d
makefiles/tools/jlink.inc.mk: use ELF file for flashing
There seems to be a consensus to go for a more ELF centric approach
whenever possible. J-Link seems to work fine with ELF files, so let's
avoid the extra step to create a bin file from the ELF file prior to
flashing.
2023-05-03 15:32:17 +02:00

40 lines
1.1 KiB
Makefile

FLASHER ?= $(RIOTTOOLS)/jlink/jlink.sh
DEBUGGER ?= $(RIOTTOOLS)/jlink/jlink.sh
DEBUGSERVER ?= $(RIOTTOOLS)/jlink/jlink.sh
RESET ?= $(RIOTTOOLS)/jlink/jlink.sh
FLASHFILE ?= $(ELFFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(DEBUG_ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
RESET_FLAGS ?= reset
JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID)
JLINK_IF ?=
JLINK_RESET_FILE ?=
JLINK_PRE_FLASH ?=
# Export JLINK_SERIAL to required targets
JLINK_TARGETS = debug% flash% reset term-rtt
$(call target-export-variables,$(JLINK_TARGETS),JLINK_SERIAL)
# Export JLINK_DEVICE to required targets
$(call target-export-variables,$(JLINK_TARGETS),JLINK_DEVICE)
ifneq (,$(JLINK_IF))
# Export JLINK_IF to required targets if not empty
$(call target-export-variables,$(JLINK_TARGETS),JLINK_IF)
endif
ifneq (,$(JLINK_RESET_FILE))
# Export JLINK_RESET_FILE to required targets if not empty
$(call target-export-variables,$(JLINK_TARGETS),JLINK_RESET_FILE)
endif
# Export JLINK_PRE_FLASH to flash targets only if not empty
ifneq (,$(JLINK_PRE_FLASH))
$(call target-export-variables,flash%,JLINK_PRE_FLASH)
endif