2018-02-13 00:26:34 -05:00
|
|
|
MCU_SERIES = m4
|
|
|
|
MCU_VARIANT = nrf52
|
|
|
|
MCU_SUB_VARIANT = nrf52840
|
|
|
|
SOFTDEV_VERSION ?= 6.0.0-6.alpha
|
|
|
|
|
2018-02-13 01:25:37 -05:00
|
|
|
LD_FILE = boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld
|
|
|
|
BOOTLOADER_FILENAME = boards/feather52840/bootloader/feather52840_bootloader_6.0.0_s140_single
|
2018-02-13 00:26:34 -05:00
|
|
|
|
|
|
|
NRF_DEFINES += -DNRF52840_XXAA
|
2018-02-13 01:25:37 -05:00
|
|
|
|
2018-02-13 02:52:17 -05:00
|
|
|
CFLAGS += -DADAFRUIT_FEATHER52840
|
2018-02-13 01:25:37 -05:00
|
|
|
|
|
|
|
ifeq ($(SD), )
|
|
|
|
INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION)_API/include
|
|
|
|
INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION)_API/include/$(MCU_VARIANT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
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))))
|
|
|
|
|
|
|
|
.PHONY: dfu-gen dfu-flash boot-flash
|
|
|
|
|
|
|
|
dfu-gen:
|
|
|
|
nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip
|
|
|
|
|
|
|
|
dfu-flash:
|
|
|
|
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
|
|
|
|
nrfutil --verbose dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL) -b 115200
|
|
|
|
|
|
|
|
#boot-flash:
|
|
|
|
# @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
|
|
|
|
# nrfutil dfu serial --package $(BOOTLOADER_PKG) -p $(SERIAL) -b 115200
|
|
|
|
|
|
|
|
boot-flash:
|
|
|
|
nrfjprog --program $(BOOTLOADER_FILENAME).hex -f nrf52 --chiperase --reset
|