Skip to content

Commit

Permalink
makesfiles/jlink: fix exports for flashing
Browse files Browse the repository at this point in the history
  • Loading branch information
crasbe committed Jul 6, 2024
1 parent 4ba7c46 commit 1261e03
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions makefiles/tools/jlink.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ JLINK_SERIAL ?= $(DEBUG_ADAPTER_ID)
JLINK_IF ?=
JLINK_RESET_FILE ?=
JLINK_PRE_FLASH ?=
JLINK_POST_FLASH ?=

JLINK_FLASH_TARGETS = flash flash%
JLINK_TARGETS = debug% $(JLINK_FLASH_TARGETS) reset term-rtt

# 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))
# Export JLINK to required targets if not empty
$(call target-export-variables,$(JLINK_TARGETS),JLINK)
endif

ifneq (,$(JLINK_IF))
# Export JLINK_IF to required targets if not empty
$(call target-export-variables,$(JLINK_TARGETS),JLINK_IF)
Expand All @@ -35,5 +43,10 @@ endif

# Export JLINK_PRE_FLASH to flash targets only if not empty
ifneq (,$(JLINK_PRE_FLASH))
$(call target-export-variables,flash%,JLINK_PRE_FLASH)
$(call target-export-variables,JLINK_FLASH_TARGETS,JLINK_PRE_FLASH)
endif

# Export JLINK_POST_FLASH to flash targets only if not empty
ifneq (,$(JLINK_POST_FLASH))
$(call target-export-variables,JLINK_FLASH_TARGETS,JLINK_POST_FLASH)
endif

0 comments on commit 1261e03

Please sign in to comment.