1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-31 09:21:19 +01:00

Merge pull request #11089 from cladmi/pr/riotboot/use_flashfile

tests/riotboot: use FLASHFILE for the generated file
This commit is contained in:
Francisco Acosta 2019-03-05 14:29:02 +01:00 committed by GitHub
commit 52d2851747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 15 deletions

View File

@ -407,6 +407,11 @@ ELFFILE ?= $(BINDIR)/$(APPLICATION).elf
HEXFILE ?= $(ELFFILE:.elf=.hex)
BINFILE ?= $(ELFFILE:.elf=.bin)
# include bootloaders support. It should be included early to allow using
# variables defined in `riotboot.mk` for `FLASHFILE` before it is evaluated.
# It should be included after defining 'BINFILE' for 'riotboot.bin' handling.
include $(RIOTMAKE)/boot/riotboot.mk
# Targets to get given file
elffile: $(ELFFILE)
hexfile: $(HEXFILE)
@ -442,11 +447,6 @@ else
_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGS) $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map
endif # BUILDOSXNATIVE
# include bootloaders support. When trying to overwrite one variable
# like HEXFILE, the value will already have been evaluated when declaring
# the link target. Therefore, it must be placed before `link`.
include $(RIOTMAKE)/boot/riotboot.mk
ifeq ($(BUILD_IN_DOCKER),1)
link: ..in-docker-container
else

View File

@ -35,8 +35,7 @@ SLOT0_RIOT_BIN = $(BINDIR_APP)-slot0.riot.bin
SLOT1_RIOT_BIN = $(BINDIR_APP)-slot1.riot.bin
SLOT_RIOT_BINS = $(SLOT0_RIOT_BIN) $(SLOT1_RIOT_BIN)
# For slot generation only link is needed
$(BINDIR_APP)-%.elf: link
$(BINDIR_APP)-%.elf: $(BASELIBS)
$(Q)$(_LINK) -o $@
# Slot 0 and 1 firmware offset, after header
@ -118,9 +117,12 @@ riotboot/flash-extended-slot0: HEXFILE=$(RIOTBOOT_EXTENDED_BIN)
# Flashing rule for openocd to flash combined/extended binaries
riotboot/flash-combined-slot0: ELFFILE=$(RIOTBOOT_COMBINED_BIN)
riotboot/flash-extended-slot0: ELFFILE=$(RIOTBOOT_EXTENDED_BIN)
riotboot/flash-combined-slot0: FLASHFILE=$(RIOTBOOT_COMBINED_BIN)
riotboot/flash-combined-slot0: $(RIOTBOOT_COMBINED_BIN) $(FLASHDEPS)
$(FLASHER) $(FFLAGS)
riotboot/flash-extended-slot0: FLASHFILE=$(RIOTBOOT_EXTENDED_BIN)
riotboot/flash-extended-slot0: $(RIOTBOOT_EXTENDED_BIN) $(FLASHDEPS)
$(FLASHER) $(FFLAGS)
@ -130,6 +132,7 @@ riotboot/flash-slot0: export IMAGE_OFFSET=$(SLOT0_OFFSET)
riotboot/flash-slot0: HEXFILE=$(SLOT0_RIOT_BIN)
# openocd
riotboot/flash-slot0: ELFFILE=$(SLOT0_RIOT_BIN)
riotboot/flash-slot0: FLASHFILE=$(SLOT0_RIOT_BIN)
riotboot/flash-slot0: $(SLOT0_RIOT_BIN) $(FLASHDEPS)
$(FLASHER) $(FFLAGS)
@ -139,6 +142,7 @@ riotboot/flash-slot1: export IMAGE_OFFSET=$(SLOT1_OFFSET)
riotboot/flash-slot1: HEXFILE=$(SLOT1_RIOT_BIN)
# openocd
riotboot/flash-slot1: ELFFILE=$(SLOT1_RIOT_BIN)
riotboot/flash-slot1: FLASHFILE=$(SLOT1_RIOT_BIN)
riotboot/flash-slot1: $(SLOT1_RIOT_BIN) $(FLASHDEPS)
$(FLASHER) $(FFLAGS)

View File

@ -18,17 +18,15 @@ DEVELHELP ?= 1
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1
all: riotboot
# Target 'all' will generate the combined file directly.
# It also makes 'flash' and 'flash-only' work without specific command.
FLASHFILE = $(RIOTBOOT_COMBINED_BIN)
include ../Makefile.tests_common
include $(RIOTBASE)/Makefile.include
# Make 'flash' and 'flash-only' work without specific command.
# This is currently hacky as there is no way of specifiying a FLASHFILE
all: riotboot/combined-slot0
# This is currently hacky as the flasher are not using 'FLASHFILE'
# openocd
ELFFILE = $(BINDIR_APP)-slot0-combined.bin
ELFFILE = $(FLASHFILE)
# edbg
HEXFILE = $(BINDIR_APP)-slot0-combined.bin
# murdock uses ':=' to get the flashfile variable so should also be overwritten
FLASHFILE = $(BINDIR_APP)-slot0-combined.bin
HEXFILE = $(FLASHFILE)