diff options
| author | hathach <[email protected]> | 2019-05-29 16:56:26 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-29 16:56:26 +0700 |
| commit | 90fea785c6aa60fdfd398fee262bb06c69a010b7 (patch) | |
| tree | 29076d760ec54c3da10b6922e7123c3754650748 | |
| parent | a619511631ea3ece5d419c5503b26d973c7016fa (diff) | |
use adafruit-nrfutil dfu as default flash target for feather nrf52840
| -rw-r--r-- | examples/make.mk | 7 | ||||
| -rw-r--r-- | hw/bsp/feather_nrf52840_express/board.mk | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/examples/make.mk b/examples/make.mk index 73e339d84..6706294ad 100644 --- a/examples/make.mk +++ b/examples/make.mk @@ -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=') diff --git a/hw/bsp/feather_nrf52840_express/board.mk b/hw/bsp/feather_nrf52840_express/board.mk index 427e06e2e..40cb45d42 100644 --- a/hw/bsp/feather_nrf52840_express/board.mk +++ b/hw/bsp/feather_nrf52840_express/board.mk @@ -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 |
