From 1efeda4283e9ee68fa18479b2f2e1fd8f97e5d4b Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Mon, 23 Nov 2015 11:28:34 -0800 Subject: [PATCH] Added the PORT make variable to the cc2538dk and Remote makefile. Fixed bug in these makefiles on OSX introduced in #1162 --- platform/cc2538dk/Makefile.cc2538dk | 9 ++++++++- platform/remote/Makefile.remote | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/platform/cc2538dk/Makefile.cc2538dk b/platform/cc2538dk/Makefile.cc2538dk index f962a0fa7..dfce1f375 100644 --- a/platform/cc2538dk/Makefile.cc2538dk +++ b/platform/cc2538dk/Makefile.cc2538dk @@ -28,11 +28,18 @@ MODULES += core/net core/net/mac \ core/net/mac/contikimac \ core/net/llsec +PYTHON = python +BSL_FLAGS += -e -w -v -a $$($(OBJDUMP) -h $*.elf | grep -B1 LOAD | grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | sort -g | head -1) + +ifdef PORT + BSL_FLAGS += -p $(PORT) +endif + BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py %.upload: %.bin %.elf ifeq ($(wildcard $(BSL)), ) @echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?" else - python $(BSL) -e -w -v -a $$($(OBJDUMP) -h $*.elf | sed -n '/\/{g;1!p;};h' | awk '{print "0x" $$5}' | sort -g | head -1) $< + $(PYTHON) $(BSL) $(BSL_FLAGS) $< endif diff --git a/platform/remote/Makefile.remote b/platform/remote/Makefile.remote index fc530967c..b91183b1e 100644 --- a/platform/remote/Makefile.remote +++ b/platform/remote/Makefile.remote @@ -36,11 +36,18 @@ MODULES += core/net core/net/mac \ core/net/mac/contikimac \ core/net/llsec +PYTHON = python +BSL_FLAGS += -e -w -v -a $$($(OBJDUMP) -h $*.elf | grep -B1 LOAD | grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | sort -g | head -1) + +ifdef PORT + BSL_FLAGS += -p $(PORT) +endif + BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py %.upload: %.bin %.elf ifeq ($(wildcard $(BSL)), ) @echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?" else - $(PYTHON) $(BSL) $(BSL_FLAGS) -a $$($(OBJDUMP) -h $*.elf | sed -n '/\/{g;1!p;};h' | awk '{print "0x" $$5}' | sort -g | head -1) $< + $(PYTHON) $(BSL) $(BSL_FLAGS) $< endif