2013-01-12 22:44:42 +00:00
|
|
|
# cc2538dk platform makefile
|
|
|
|
|
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CONTIKI_TARGET_DIRS = . dev
|
|
|
|
|
2018-02-25 18:57:35 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += leds-arch.c
|
2017-10-14 18:53:58 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += platform.c
|
2013-11-04 19:39:56 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += sensors.c smartrf-sensors.c
|
2017-11-05 18:33:05 +00:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += board-buttons.c als-sensor.c
|
2013-01-12 22:44:42 +00:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
### Define the CPU directory
|
2018-11-23 09:35:41 +00:00
|
|
|
CONTIKI_CPU=$(ARCH_PATH)/cpu/cc2538
|
2013-01-12 22:44:42 +00:00
|
|
|
include $(CONTIKI_CPU)/Makefile.cc2538
|
2013-12-05 22:56:30 +00:00
|
|
|
|
2018-02-25 23:25:22 +00:00
|
|
|
MODULES += os/storage/cfs
|
2014-02-01 23:46:45 +00:00
|
|
|
|
2015-11-23 19:28:34 +00:00
|
|
|
PYTHON = python
|
2015-11-24 13:08:12 +00:00
|
|
|
BSL_FLAGS += -e -w -v
|
2015-11-23 19:28:34 +00:00
|
|
|
|
|
|
|
ifdef PORT
|
|
|
|
BSL_FLAGS += -p $(PORT)
|
|
|
|
endif
|
|
|
|
|
2014-02-01 23:46:45 +00:00
|
|
|
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
|
|
|
|
2018-10-13 23:23:43 +00:00
|
|
|
%.upload: $(OUT_BIN) $(OUT_ELF)
|
2014-02-01 23:46:45 +00:00
|
|
|
ifeq ($(wildcard $(BSL)), )
|
|
|
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
|
|
|
else
|
2018-10-13 23:23:43 +00:00
|
|
|
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h \
|
|
|
|
$(BUILD_DIR_BOARD)/$*.elf | grep -B1 LOAD | \
|
2015-11-24 13:08:12 +00:00
|
|
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
|
|
|
sort -g | head -1))
|
|
|
|
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
2014-02-01 23:46:45 +00:00
|
|
|
endif
|
2018-04-28 00:36:14 +00:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
RENODE = mono /Applications/Renode.app/Contents/MacOS/bin/Renode.exe
|
|
|
|
else
|
|
|
|
RENODE = renode
|
|
|
|
endif
|
|
|
|
|
|
|
|
SCRIPT ?= $(notdir $(CURDIR)).resc
|
|
|
|
|
|
|
|
.PHONY: renode
|
|
|
|
|
|
|
|
renode: all
|
|
|
|
$(RENODE) $(SCRIPT)
|
|
|
|
|