diff --git a/platform/cc2538dk/Makefile.cc2538dk b/platform/cc2538dk/Makefile.cc2538dk index 5c3fd77ec..f962a0fa7 100644 --- a/platform/cc2538dk/Makefile.cc2538dk +++ b/platform/cc2538dk/Makefile.cc2538dk @@ -30,9 +30,9 @@ MODULES += core/net core/net/mac \ BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py -%.upload: %.bin +%.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 $< + python $(BSL) -e -w -v -a $$($(OBJDUMP) -h $*.elf | sed -n '/\/{g;1!p;};h' | awk '{print "0x" $$5}' | sort -g | head -1) $< endif diff --git a/platform/remote/Makefile.remote b/platform/remote/Makefile.remote index a9acc1dbc..3d351bfdd 100644 --- a/platform/remote/Makefile.remote +++ b/platform/remote/Makefile.remote @@ -38,9 +38,9 @@ MODULES += core/net core/net/mac \ BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py -%.upload: %.bin +%.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) $< + $(PYTHON) $(BSL) $(BSL_FLAGS) -a $$($(OBJDUMP) -h $*.elf | sed -n '/\/{g;1!p;};h' | awk '{print "0x" $$5}' | sort -g | head -1) $< endif