use adafruit-nrfutil dfu as default flash target for feather nrf52840

This commit is contained in:
hathach 2019-05-29 16:56:26 +07:00
parent a619511631
commit 90fea785c6
2 changed files with 14 additions and 2 deletions

View File

@ -14,6 +14,13 @@ CP = cp
RM = rm
PYTHON ?= python
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined make flag: $1$(if $2, ($2))))
# Select the board to build for.
ifeq ($(BOARD),)
$(info You must provide a BOARD parameter with 'BOARD=')

View File

@ -50,5 +50,10 @@ JLINK_IF = swd
# For uf2 conversion
UF2_FAMILY = 0xADA52840
# flash using jlink
flash: flash-jlink
$(BUILD)/$(BOARD)-firmware.zip: $(BUILD)/$(BOARD)-firmware.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0xFFFE --application $^ $@
# flash using adafruit-nrfutil dfu
flash: $(BUILD)/$(BOARD)-firmware.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
adafruit-nrfutil --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank --touch 1200