summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2020-01-14 21:32:59 (GMT)
committerDaniel Thompson <daniel.thompson@linaro.org>2020-01-14 21:32:59 (GMT)
commit88e736c9e91d02178a11a15ff572cab99c910ad1 (patch)
treef7af8f634d41768f9750b5054bd8c10af57e9478 /Makefile
Initial revision
This is a just a rather hacky combined build environment.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8d57c1e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+export PYTHONPATH := $(PWD)/tools/nrfutil:$(PWD)/tools/intelhex:$(PYTHONPATH)
+
+JOBS = -j $(shell nproc)
+
+all : bootloader micropython
+
+clean :
+ rm -rf \
+ bootloader/_build-nitrogen_nrf52832 \
+ micropython/mpy-cross/build \
+ micropython/ports/nrf/build-dsd6-s132
+
+submodules :
+ git submodule update --init --recursive
+
+bootloader:
+ make -C bootloader/ BOARD=nitrogen_nrf52832 $(JOBS) all genhex
+ python3 tools/hexmerge.py \
+ bootloader/lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex \
+ bootloader/_build-nitrogen_nrf52832/nitrogen_nrf52832_bootloader-*-nosd.hex \
+ -o bootloader.hex
+
+micropython:
+ make -C micropython/mpy-cross $(JOBS)
+ make -C micropython/ports/nrf BOARD=dsd6 SD=s132 $(JOBS)
+ python3 -m nordicsemi dfu genpkg \
+ --dev-type 0x0052 \
+ --application micropython/ports/nrf/build-dsd6-s132/firmware.hex \
+ micropython.zip
+
+dfu:
+ python3 -m nordicsemi dfu serial --package micropython.zip --port /dev/ttyACM0
+
+flash:
+ cp bootloader.hex /run/media/$(USER)/MBED
+
+.PHONY: bootloader micropython
+