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/tools/uf2conv.inc.mk: partial riotboot support #16323

Merged
merged 1 commit into from
Jun 2, 2022
Merged
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
19 changes: 17 additions & 2 deletions makefiles/boot/riotboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ riotboot/flash-bootloader: riotboot/bootloader/flash
# avoid circular dependency against clean
riotboot/bootloader/%: $$(if $$(filter riotboot/bootloader/clean,$$@),,$$(BUILDDEPS) pkg-prepare)
$(Q)/usr/bin/env -i \
QUIET=$(QUIET) PATH="$(PATH)"\
QUIET=$(QUIET) PATH="$(PATH)" USER="$(USER)"\
EXTERNAL_BOARD_DIRS="$(EXTERNAL_BOARD_DIRS)" BOARD=$(BOARD)\
DEBUG_ADAPTER_ID=$(DEBUG_ADAPTER_ID) \
IOTLAB_NODE=$(IOTLAB_NODE) \
Expand Down Expand Up @@ -155,7 +155,22 @@ riotboot/flash: riotboot/flash-slot0 riotboot/flash-bootloader
# make applications that use the riotboot feature default to actually using it
# Target 'all' will generate the combined file directly.
# It also makes 'flash' and 'flash-only' work without specific command.
FLASHFILE = $(RIOTBOOT_EXTENDED_BIN)
#
# Special case for uf2conv where bootloader and slot0 are both flashed
# independently
ifneq (,$(filter uf2conv,$(PROGRAMMER)))
ifneq (,$(filter riotboot/flash-extended-slot0 riotboot/flash-combined-slot0,$(MAKECMDGOALS)))
$(error riotboot/flash-extended-slot0 riotboot/flash-combined-slot0 are not supported with uf2conv)
endif
FLASHFILE = $(BOOTLOADER_BIN)/riotboot.bin
riotboot/flash-slot0-remount: riotboot/flash-slot0
sleep $(TERM_DELAY)
$(PREFLASHER_PREFIX)$(PREFLASHER) $(PREFFLAGS)
sleep $(PREFLASH_DELAY)
flash: riotboot/flash-slot0-remount
else
FLASHFILE = $(RIOTBOOT_EXTENDED_BIN)
endif

else
riotboot:
Expand Down
4 changes: 3 additions & 1 deletion makefiles/tools/uf2conv.inc.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FLASHFILE ?= $(HEXFILE)

IMAGE_OFFSET ?= $(ROM_OFFSET)

FLASHER ?= $(RIOTTOOLS)/uf2/uf2conv.py
FFLAGS ?= $(UF2CONV_FLAGS) $(FLASHFILE)
FFLAGS ?= $(UF2CONV_FLAGS) $(FLASHFILE) --base $(IMAGE_OFFSET)

PREFLASH_DELAY ?= 2

Expand Down