From 41a2249ec6326e08807f1f04868a5c48bc071d4b Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 8 Oct 2019 14:11:40 +0200 Subject: [PATCH 1/2] Makefile.include: include iotlab.single.inc.mk before checking FLASHFILE This way FLASHFILE is either already defined by the board and, if not, the default one for iotlab can be used. --- Makefile.include | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile.include b/Makefile.include index 456f4da850..62a9bab9cd 100644 --- a/Makefile.include +++ b/Makefile.include @@ -283,6 +283,10 @@ export PREFIX ?= $(if $(TARGET_ARCH),$(TARGET_ARCH)-) # be done in makefile.iotlab.single.inc.mk which is included after. ifneq (,$(IOTLAB_NODE)) PROGRAMMER ?= iotlab + # iotlab uses ELFFILE by default for flashing boards, except for WSN430. + ifeq (,$(filter wsn430-%,$(BOARD))) + FLASHFILE ?= $(ELFFILE) + endif endif # Add standard include directories @@ -442,6 +446,11 @@ include $(RIOTMAKE)/modules.inc.mk # https://www.gnu.org/software/make/manual/html_node/Force-Targets.html .PHONY: FORCE +ifneq (,$(IOTLAB_NODE)) + # iot-lab serial and flasher + include $(RIOTBASE)/dist/testbed-support/makefile.iotlab.single.inc.mk +endif + ELFFILE ?= $(BINDIR)/$(APPLICATION).elf HEXFILE ?= $(ELFFILE:.elf=.hex) BINFILE ?= $(ELFFILE:.elf=.bin) @@ -807,10 +816,6 @@ ifneq (,$(filter iotlab-m3 wsn430-v1_3b wsn430-v1_4,$(BOARD))) include $(RIOTBASE)/dist/testbed-support/Makefile.iotlab endif endif -ifneq (,$(IOTLAB_NODE)) - # iot-lab serial and flasher - include $(RIOTBASE)/dist/testbed-support/makefile.iotlab.single.inc.mk -endif # Include desvirt Makefile include $(RIOTTOOLS)/desvirt/Makefile.desvirt From ffc4c84faa9a0beadd41a8faec54a196df3b1f4d Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 9 Oct 2019 15:03:34 +0200 Subject: [PATCH 2/2] dist/testbed-support: boards: remove useless IOTLAB_FLASHFILE --- boards/common/wsn430/Makefile.include | 3 --- dist/testbed-support/makefile.iotlab.single.inc.mk | 7 ++----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/boards/common/wsn430/Makefile.include b/boards/common/wsn430/Makefile.include index 8fa4aa992c..b87e3af0ee 100644 --- a/boards/common/wsn430/Makefile.include +++ b/boards/common/wsn430/Makefile.include @@ -12,6 +12,3 @@ include $(RIOTMAKE)/tools/serial.inc.mk FLASHER = mspdebug FLASHFILE ?= $(HEXFILE) FFLAGS = -d $(PORT) -j uif "prog $(FLASHFILE)" - -# Use the HEXFILE when using iot-lab.single.inc.mk -IOTLAB_FLASHFILE = $(FLASHFILE) diff --git a/dist/testbed-support/makefile.iotlab.single.inc.mk b/dist/testbed-support/makefile.iotlab.single.inc.mk index 50b7b27229..afd218988e 100644 --- a/dist/testbed-support/makefile.iotlab.single.inc.mk +++ b/dist/testbed-support/makefile.iotlab.single.inc.mk @@ -54,9 +54,6 @@ IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH)) # Optional Experiment id. Required when having multiple experiments IOTLAB_EXP_ID ?= -# File to use for flashing -IOTLAB_FLASHFILE ?= $(ELFFILE) - # Specify experiment-id option if provided _IOTLAB_EXP_ID := $(if $(IOTLAB_EXP_ID),--id $(IOTLAB_EXP_ID)) @@ -161,7 +158,7 @@ ifneq (iotlab-a8-m3,$(BOARD)) FLASHER = iotlab-node RESET = iotlab-node _NODE_FMT = --jmespath='keys(@)[0]' --format='int' - FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) --update $(IOTLAB_FLASHFILE) | $(_STDIN_EQ_0) + FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) --update $(FLASHFILE) | $(_STDIN_EQ_0) RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) $(_IOTLAB_NODELIST) --reset | $(_STDIN_EQ_0) ifeq (,$(_IOTLAB_ON_FRONTEND)) @@ -178,7 +175,7 @@ else FLASHER = iotlab-ssh RESET = iotlab-ssh _NODE_FMT = --jmespath='keys(values(@)[0])[0]' --fmt='int' - FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) flash-m3 $(_IOTLAB_NODELIST) $(IOTLAB_FLASHFILE) | $(_STDIN_EQ_0) + FFLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) flash-m3 $(_IOTLAB_NODELIST) $(FLASHFILE) | $(_STDIN_EQ_0) RESET_FLAGS = $(_NODE_FMT) $(_IOTLAB_EXP_ID) reset-m3 $(_IOTLAB_NODELIST) | $(_STDIN_EQ_0) TERMPROG = ssh