Skip to content

Commit

Permalink
Merge pull request contiki-os#1 from g-oikonomou/contrib/change-bsl-a…
Browse files Browse the repository at this point in the history
…ddr-calculation

Remove duplicate block and define the argument of -a using $(shell)
  • Loading branch information
JelmerT committed Nov 24, 2015
2 parents 1efeda4 + e75bdd0 commit ff6e559
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 5 additions & 2 deletions platform/cc2538dk/Makefile.cc2538dk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MODULES += core/net core/net/mac \
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)
BSL_FLAGS += -e -w -v

ifdef PORT
BSL_FLAGS += -p $(PORT)
Expand All @@ -41,5 +41,8 @@ BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
ifeq ($(wildcard $(BSL)), )
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
else
$(PYTHON) $(BSL) $(BSL_FLAGS) $<
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h $*.elf | grep -B1 LOAD | \
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
sort -g | head -1))
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
endif
12 changes: 4 additions & 8 deletions platform/remote/Makefile.remote
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,14 @@ 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) $<
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h $*.elf | grep -B1 LOAD | \
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
sort -g | head -1))
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
endif

0 comments on commit ff6e559

Please sign in to comment.