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

makefiles: add FAST_FLASH option to speed up flashing #21161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 16 additions & 1 deletion dist/tools/edbg/edbg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ do_flash() {
IMAGE_FILE=$1
test_imagefile

# Configure edbg flash flags
local _fflags="${EDBG_ARGS} --verbose --file ${IMAGE_FILE}"

# flash device
sh -c "${EDBG} ${_fflags} --program" && echo 'Done flashing'
}

do_flash_verify() {
IMAGE_FILE=$1
test_imagefile

# Configure edbg flash flags
local _fflags="${EDBG_ARGS} --verbose --file ${IMAGE_FILE} --verify"

Expand All @@ -36,9 +47,13 @@ shift # pop $1 from $@

case "${ACTION}" in
flash)
echo "### Flashing Target ###"
echo "### Flashing Target (quick) ###"
do_flash "$@"
;;
flash_verify)
echo "### Flashing Target ###"
do_flash_verify "$@"
;;
reset)
echo "### Resetting Target ###"
do_reset
Expand Down
6 changes: 5 additions & 1 deletion makefiles/boot/riotboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ ifneq (,$(filter uf2conv,$(PROGRAMMER)))
sleep $(PREFLASH_DELAY)
flash: riotboot/flash-slot0-remount
else
FLASHFILE = $(RIOTBOOT_EXTENDED_BIN)
ifeq (1, $(FAST_FLASH))
FLASHFILE = $(RIOTBOOT_COMBINED_BIN)
else
FLASHFILE = $(RIOTBOOT_EXTENDED_BIN)
endif
endif

else
Expand Down
6 changes: 5 additions & 1 deletion makefiles/tools/edbg.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ $(call target-export-variables,$(EDBG_TARGETS),EDBG_ARGS)

# Set flasher and reset for the RIOT build system
FLASHER ?= $(RIOTTOOLS)/edbg/edbg.sh
FFLAGS ?= flash $(FLASHFILE)
ifeq (1, $(FAST_FLASH))
FFLAGS ?= flash $(FLASHFILE)
else
FFLAGS ?= flash_verify $(FLASHFILE)
endif

RESET ?= $(RIOTTOOLS)/edbg/edbg.sh
RESET_FLAGS ?= reset
Expand Down
4 changes: 4 additions & 0 deletions makefiles/tools/openocd.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ ifneq (,$(OPENOCD_DEBUG_ADAPTER))
endif
endif

ifeq (1, $(FAST_FLASH))
OPENOCD_SKIP_VERIFY = 1
endif

OPENOCD_CONFIG ?= $(BOARDDIR)/dist/openocd.cfg

OPENOCD_TARGETS = debug% flash% reset
Expand Down
Loading