Skip to content

Commit a8c66bf

Browse files
committed
Add support for the .upload make target for platform simplelink
This commit allows users of platform simplelink to program their devices using the .upload make target. This will only work for those simplelink boards that can actually be programmed using the cc2538-bsl script. As of the time of writing this commit, this can only be done with the old `x0` devices (cc13x0 and cc26x0), but not the newer `x2` devices. Changes to the BSL script itself likely required before these platforms can be supported. Closes contiki-ng#1036
1 parent 66f542f commit a8c66bf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx

+26
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,29 @@ $(OBJECTDIR)/ccfg-conf.o: ccfg-conf.c FORCE | $(OBJECTDIR)
142142

143143
# Include the Sub-family Makefile specific for the specified device
144144
include $(CONTIKI_CPU)/$(SUBFAMILY)/Makefile.$(SUBFAMILY)
145+
146+
################################################################################
147+
### For the .upload make target
148+
PYTHON = python
149+
BSL_FLAGS += -e -w -v
150+
151+
ifdef PORT
152+
BSL_FLAGS += -p $(PORT)
153+
endif
154+
155+
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
156+
157+
ifeq ($(BOARD_SUPPORTS_BSL),1)
158+
%.upload: $(OUT_BIN)
159+
ifeq ($(wildcard $(BSL)), )
160+
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
161+
else
162+
$(PYTHON) $(BSL) $(BSL_FLAGS) $<
163+
endif
164+
else
165+
%.upload:
166+
@echo "This board cannot be programmed through the ROM bootloader and therefore does not support the .upload target."
167+
endif
168+
169+
### For the login etc targets
170+
BAUDRATE ?= 115200

0 commit comments

Comments
 (0)