2020-01-14 22:32:59 +01:00
|
|
|
export PYTHONPATH := $(PWD)/tools/nrfutil:$(PWD)/tools/intelhex:$(PYTHONPATH)
|
|
|
|
|
|
|
|
all : bootloader micropython
|
|
|
|
|
2020-01-20 09:05:31 +01:00
|
|
|
BOARD=$(error Please set BOARD=)
|
|
|
|
|
2020-01-14 22:32:59 +01:00
|
|
|
clean :
|
|
|
|
rm -rf \
|
2020-01-20 09:05:31 +01:00
|
|
|
bootloader/_build-$(BOARD)_nrf52832 \
|
2020-01-14 22:32:59 +01:00
|
|
|
micropython/mpy-cross/build \
|
2020-01-20 09:05:31 +01:00
|
|
|
micropython/ports/nrf/build-$(BOARD)-s132
|
2020-01-14 22:32:59 +01:00
|
|
|
|
|
|
|
submodules :
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
|
|
|
bootloader:
|
2020-01-20 09:05:31 +01:00
|
|
|
$(MAKE) -C bootloader/ BOARD=$(BOARD)_nrf52832 all genhex
|
2020-01-20 09:06:16 +01:00
|
|
|
python3 -m nordicsemi dfu genpkg \
|
|
|
|
--bootloader bootloader/_build-$(BOARD)_nrf52832/$(BOARD)_nrf52832_bootloader-*-nosd.hex \
|
|
|
|
--softdevice bootloader/lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex \
|
|
|
|
bootloader.zip
|
2020-01-14 22:32:59 +01:00
|
|
|
python3 tools/hexmerge.py \
|
2020-01-20 09:05:31 +01:00
|
|
|
bootloader/_build-$(BOARD)_nrf52832/$(BOARD)_nrf52832_bootloader-*-nosd.hex \
|
2020-01-14 22:32:59 +01:00
|
|
|
bootloader/lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex \
|
|
|
|
-o bootloader.hex
|
|
|
|
|
2020-01-20 09:07:35 +01:00
|
|
|
softdevice:
|
|
|
|
micropython/ports/nrf/drivers/bluetooth/download_ble_stack.sh
|
|
|
|
|
2020-01-14 22:32:59 +01:00
|
|
|
micropython:
|
2020-01-20 09:05:31 +01:00
|
|
|
$(MAKE) -C micropython/mpy-cross
|
2020-01-21 23:10:50 +01:00
|
|
|
$(MAKE) -C micropython/ports/nrf \
|
|
|
|
BOARD=$(BOARD) SD=s132 \
|
|
|
|
FROZEN_MPY_DIR=$(PWD)/wasp
|
2020-01-14 22:32:59 +01:00
|
|
|
python3 -m nordicsemi dfu genpkg \
|
|
|
|
--dev-type 0x0052 \
|
2020-01-20 09:05:31 +01:00
|
|
|
--application micropython/ports/nrf/build-$(BOARD)-s132/firmware.hex \
|
2020-01-14 22:32:59 +01:00
|
|
|
micropython.zip
|
2020-01-20 09:07:35 +01:00
|
|
|
|
2020-01-14 22:32:59 +01:00
|
|
|
dfu:
|
|
|
|
python3 -m nordicsemi dfu serial --package micropython.zip --port /dev/ttyACM0
|
|
|
|
|
|
|
|
flash:
|
2020-01-20 09:08:22 +01:00
|
|
|
pyocd erase -t nrf52 --mass-erase
|
|
|
|
pyocd flash -t nrf52 bootloader.hex
|
2020-01-14 22:32:59 +01:00
|
|
|
|
|
|
|
.PHONY: bootloader micropython
|
|
|
|
|