2016-02-11 00:34:08 +00:00
|
|
|
# openmote-cc2538 platform makefile
|
|
|
|
|
2016-12-29 11:10:21 +00:00
|
|
|
### Allow the OpenMote-CC2538 platform to support different CC2538 chip revisions
|
|
|
|
ifeq ($(findstring REV_A1,$(BOARD_REVISION)),REV_A1)
|
|
|
|
CFLAGS+=-DCC2538_DEV_CONF=CC2538_DEV_CC2538SF23
|
|
|
|
endif
|
|
|
|
|
2016-02-11 00:34:08 +00:00
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
### Configure the build for the board and pull in board-specific sources
|
|
|
|
CONTIKI_TARGET_DIRS += . dev
|
2017-06-28 13:57:13 +00:00
|
|
|
PLATFORM_ROOT_DIR = $(CONTIKI)/arch/platform/$(TARGET)
|
2016-02-11 00:34:08 +00:00
|
|
|
|
|
|
|
### Include
|
2017-10-15 00:14:45 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += platform.c board.c
|
2017-11-05 18:46:35 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += leds-arch.c board-buttons.c openmote-sensors.c
|
2016-02-11 00:34:08 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += antenna.c adxl346.c max44009.c sht21.c tps62730.c
|
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
### Define the CPU directory
|
2017-06-28 13:57:13 +00:00
|
|
|
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
|
2016-02-11 00:34:08 +00:00
|
|
|
include $(CONTIKI_CPU)/Makefile.cc2538
|
|
|
|
|
2018-02-25 23:25:22 +00:00
|
|
|
MODULES += os/storage/cfs
|
2016-02-11 00:34:08 +00:00
|
|
|
|
|
|
|
PYTHON = python
|
2017-01-10 09:59:06 +00:00
|
|
|
BSL_FLAGS += -e --bootloader-invert-lines -w -v -b 450000
|
2016-02-11 00:34:08 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
$(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
|