From e1ccc0784166e7c79c9eb12cd4088a6bea6de3d1 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 14 Aug 2018 20:19:28 +0700 Subject: [PATCH] remove bootloader & dfu-bootloader target user should go to bootloader repo to upgrade bootloader --- ports/nrf/Makefile | 32 +++++++------------ .../nrf/boards/feather52832/mpconfigboard.mk | 1 - .../nrf/boards/feather52840/mpconfigboard.mk | 1 - ports/nrf/boards/pca10056/mpconfigboard.mk | 2 -- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index b62eff3dad..6614d58cd1 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -248,7 +248,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) $(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os $(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os -.phony: all flash sd binary hex bootloader +.phony: all flash sd binary hex all: binary hex uf2 @@ -266,6 +266,11 @@ hex: $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/$(OUTPUT_FILENAME).hex: $(BUILD)/$(OUTPUT_FILENAME).elf $(OBJCOPY) -O ihex $< $@ +## Create uf2 file +uf2: $(BUILD)/$(OUTPUT_FILENAME).hex + $(ECHO) "Create $(OUTPUT_FILENAME).uf2" + $(PYTHON2) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "$(BUILD)/$(OUTPUT_FILENAME).uf2" $^ + ##################### # Flash with debugger ##################### @@ -286,9 +291,6 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex nrfjprog --program $< --sectorerase -f $(MCU_VARIANT) nrfjprog --reset -f $(MCU_VARIANT) -bootloader: - nrfjprog --program $(BOOT_FILE).hex -f nrf52 --chiperase --reset - else ifeq ($(FLASHER), pyocd) flash: $(BUILD)/$(OUTPUT_FILENAME).hex @@ -303,16 +305,12 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex pyocd-flashtool -t $(MCU_SUB_VARIANT) $< --sector_erase pyocd-tool -t $(MCU_SUB_VARIANT) reset $(BOOT_SETTING_ADDR) -bootloader: - pyocd-flashtool -t $(MCU_SUB_VARIANT) $(BOOT_FILE).hex --chip_erase - pyocd-tool -t $(MCU_SUB_VARIANT) reset - endif ##################### # Flash with DFU ##################### -.phony: dfu-gen dfu-flash dfu-bootloader +.phony: dfu-gen dfu-flash ifeq ($(OS),Windows_NT) NRFUTIL = ../../lib/nrfutil/binaries/win32/nrfutil.exe @@ -327,22 +325,16 @@ __check_defined = \ $(if $(value $1),, \ $(error Undefined make flag: $1$(if $2, ($2)))) -dfu-gen: $(BUILD)/$(OUTPUT_FILENAME).hex - $(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip - +## Flash with DFU serial dfu-flash: $(BUILD)/dfu-package.zip @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) $(NRFUTIL) --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank -dfu-bootloader: - @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0) - $(NRFUTIL) --verbose dfu serial --package $(BOOT_FILE).zip -p $(SERIAL) -b 115200 +## Create DFU package file +dfu-gen: $(BUILD)/dfu-package.zip -uf2: $(BUILD)/$(OUTPUT_FILENAME).hex - $(ECHO) "Create $(OUTPUT_FILENAME).uf2" - $(PYTHON2) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "$(BUILD)/$(OUTPUT_FILENAME).uf2" $^ - -$(BUILD)/dfu-package.zip: dfu-gen +$(BUILD)/dfu-package.zip: $(BUILD)/$(OUTPUT_FILENAME).hex + $(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip $(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ) $(ECHO) "LINK $@" diff --git a/ports/nrf/boards/feather52832/mpconfigboard.mk b/ports/nrf/boards/feather52832/mpconfigboard.mk index e49026d23d..a42decd89e 100644 --- a/ports/nrf/boards/feather52832/mpconfigboard.mk +++ b/ports/nrf/boards/feather52832/mpconfigboard.mk @@ -5,7 +5,6 @@ SD ?= s132 SOFTDEV_VERSION ?= 2.0.1 LD_FILE = boards/feather52832/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION).ld -BOOT_FILE = boards/feather52832/bootloader/feather52_bootloader_$(SOFTDEV_VERSION)_s132_single BOOT_SETTING_ADDR = 0x7F000 NRF_DEFINES += -DNRF52832_XXAA diff --git a/ports/nrf/boards/feather52840/mpconfigboard.mk b/ports/nrf/boards/feather52840/mpconfigboard.mk index a59e64dc6b..3af9ff71b7 100644 --- a/ports/nrf/boards/feather52840/mpconfigboard.mk +++ b/ports/nrf/boards/feather52840/mpconfigboard.mk @@ -5,7 +5,6 @@ SD ?= s140 SOFTDEV_VERSION ?= 6.0.0 BOOT_SETTING_ADDR = 0xFF000 -BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140 ifeq ($(SD),) LD_FILE = boards/nrf52840_1M_256k.ld diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 5478069bb5..3af9ff71b7 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -5,7 +5,6 @@ SD ?= s140 SOFTDEV_VERSION ?= 6.0.0 BOOT_SETTING_ADDR = 0xFF000 -BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140 ifeq ($(SD),) LD_FILE = boards/nrf52840_1M_256k.ld @@ -13,5 +12,4 @@ else LD_FILE = boards/bluefruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_$(SOFTDEV_VERSION).ld endif - NRF_DEFINES += -DNRF52840_XXAA