1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
ECHO = @echo
HEX_SRC = build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex
HEX_FINAL = build/firmware.hex
MBIT_VER_FILE = inc/genhdr/microbitversion.h
VER_ADDR_FILE = build/veraddr.txt
all: $(HEX_FINAL)
# Anything that depends on FORCE will be considered out-of-date
FORCE:
.PHONY: FORCE
$(HEX_FINAL): yotta $(VER_ADDR_FILE)
tools/adduicr.py $(HEX_SRC) $$(cat $(VER_ADDR_FILE)) -o $(HEX_FINAL)
@size $(HEX_SRC:.hex=)
yotta: $(MBIT_VER_FILE)
@yotta build
$(MBIT_VER_FILE): FORCE
python3 tools/makeversionhdr.py $(MBIT_VER_FILE)
$(VER_ADDR_FILE): yotta
@echo -n "0x" > $(VER_ADDR_FILE)
@objdump -x $(HEX_SRC:.hex=) | grep microbit_version_string | cut -f 1 -d' ' >> $(VER_ADDR_FILE)
deploy: $(HEX_FINAL)
$(ECHO) "Deploying $<"
@mount /dev/sdb
@sleep 1s
@cp $< /mnt/
@sleep 1s
@umount /mnt
serial:
@picocom /dev/ttyACM0 -b 115200
|