Skip to content

make: verify before flash #11093

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,12 @@ distclean:
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i distclean ; done
-@rm -rf $(BINDIRBASE)

FLASHER_VERIFY ?= false

define flash-recipe
$(call check_cmd,$(FLASHER_VERIFY),Flash verification program)
$(call check_cmd,$(FLASHER),Flash program)
$(FLASHER) $(FFLAGS)
$(FLASHER_VERIFY) $(FFLAGS_VERIFY) || $(FLASHER) $(FFLAGS)
endef

# Do not add dependencies to "flash" directly, use FLASHDEPS, as this is shared
Expand Down
5 changes: 4 additions & 1 deletion makefiles/tools/edbg.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ endif
# Set offset according to IMAGE_OFFSET if it's defined
EDBG_ARGS += $(if $(IMAGE_OFFSET),--offset $(IMAGE_OFFSET))

FFLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -v -p -f $(HEXFILE)
FFLAGS_BASE ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -v -f $(HEXFILE)
FFLAGS ?= $(FFLAGS_BASE) -p

ifeq ($(RIOT_EDBG),$(FLASHER))
FLASHDEPS += $(RIOT_EDBG)
endif
RESET ?= $(EDBG)
RESET_FLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE)
FLASHER_VERIFY ?= $(EDBG)
FFLAGS_VERIFY ?= $(FFLAGS_BASE)