2017-04-25 18:18:10 -04:00
|
|
|
MCU_SERIES = m4
|
|
|
|
MCU_VARIANT = nrf52
|
|
|
|
MCU_SUB_VARIANT = nrf52832
|
2017-11-10 03:17:24 -05:00
|
|
|
SOFTDEV_VERSION ?= 2.0.1
|
2017-04-24 17:25:09 -04:00
|
|
|
|
2017-11-10 03:17:24 -05:00
|
|
|
LD_FILE = boards/feather52/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION).ld
|
|
|
|
BOOTLOADER_PKG = boards/feather52/bootloader/feather52_bootloader_$(SOFTDEV_VERSION)_s132_single.zip
|
2017-04-24 17:25:09 -04:00
|
|
|
|
2017-04-25 18:18:10 -04:00
|
|
|
NRF_DEFINES += -DNRF52832_XXAA
|
2017-04-24 17:25:09 -04:00
|
|
|
|
2018-02-07 14:36:19 -05:00
|
|
|
ifeq ($(SD), )
|
|
|
|
INC += -Idrivers/bluetooth/s132_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s132_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include
|
|
|
|
INC += -Idrivers/bluetooth/s132_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s132_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include/$(MCU_VARIANT)
|
|
|
|
endif
|
|
|
|
|
2017-12-21 07:49:14 -05:00
|
|
|
CFLAGS += -DADAFRUIT_FEATHER52
|
2017-11-10 03:17:24 -05:00
|
|
|
|
2017-06-03 15:42:42 -04:00
|
|
|
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))))
|
|
|
|
|
2017-11-10 03:17:24 -05:00
|
|
|
.PHONY: dfu-gen dfu-flash boot-flash
|
2017-04-24 17:25:09 -04:00
|
|
|
|
2017-04-25 18:18:10 -04:00
|
|
|
dfu-gen:
|
|
|
|
nrfutil dfu genpkg --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip
|
|
|
|
|
|
|
|
dfu-flash:
|
2017-06-03 15:42:42 -04:00
|
|
|
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
|
2017-11-10 03:17:24 -05:00
|
|
|
nrfutil 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
|