Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makesfiles/jlink: fix exports for flashing #20779

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading