1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #16323 from fjmolinas/pr_uf2_riotboot_initial

makefiles/tools/uf2conv.inc.mk: partial riotboot support
This commit is contained in:
benpicco 2022-06-02 10:00:52 +02:00 committed by GitHub
commit 25d7234a1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -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) \
@ -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:

View File

@ -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