Merge branch 'nrf52_remove_boot_target' into nrf52_dfu_touch1200
This commit is contained in:
commit
1c4accfa39
@ -248,7 +248,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
|||||||
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
|
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
|
||||||
$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_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
|
all: binary hex uf2
|
||||||
|
|
||||||
@ -266,6 +266,11 @@ hex: $(BUILD)/$(OUTPUT_FILENAME).hex
|
|||||||
$(BUILD)/$(OUTPUT_FILENAME).hex: $(BUILD)/$(OUTPUT_FILENAME).elf
|
$(BUILD)/$(OUTPUT_FILENAME).hex: $(BUILD)/$(OUTPUT_FILENAME).elf
|
||||||
$(OBJCOPY) -O ihex $< $@
|
$(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
|
# Flash with debugger
|
||||||
#####################
|
#####################
|
||||||
@ -286,9 +291,6 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex
|
|||||||
nrfjprog --program $< --sectorerase -f $(MCU_VARIANT)
|
nrfjprog --program $< --sectorerase -f $(MCU_VARIANT)
|
||||||
nrfjprog --reset -f $(MCU_VARIANT)
|
nrfjprog --reset -f $(MCU_VARIANT)
|
||||||
|
|
||||||
bootloader:
|
|
||||||
nrfjprog --program $(BOOT_FILE).hex -f nrf52 --chiperase --reset
|
|
||||||
|
|
||||||
else ifeq ($(FLASHER), pyocd)
|
else ifeq ($(FLASHER), pyocd)
|
||||||
|
|
||||||
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
|
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||||
@ -303,16 +305,12 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex
|
|||||||
pyocd-flashtool -t $(MCU_SUB_VARIANT) $< --sector_erase
|
pyocd-flashtool -t $(MCU_SUB_VARIANT) $< --sector_erase
|
||||||
pyocd-tool -t $(MCU_SUB_VARIANT) reset $(BOOT_SETTING_ADDR)
|
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
|
endif
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Flash with DFU
|
# Flash with DFU
|
||||||
#####################
|
#####################
|
||||||
.phony: dfu-gen dfu-flash dfu-bootloader
|
.phony: dfu-gen dfu-flash
|
||||||
|
|
||||||
NRFUTIL = adafruit-nrfutil
|
NRFUTIL = adafruit-nrfutil
|
||||||
|
|
||||||
@ -329,22 +327,16 @@ __check_defined = \
|
|||||||
$(if $(value $1),, \
|
$(if $(value $1),, \
|
||||||
$(error Undefined make flag: $1$(if $2, ($2))))
|
$(error Undefined make flag: $1$(if $2, ($2))))
|
||||||
|
|
||||||
dfu-gen: $(BUILD)/$(OUTPUT_FILENAME).hex
|
## Flash with DFU serial
|
||||||
$(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip
|
|
||||||
|
|
||||||
dfu-flash: $(BUILD)/dfu-package.zip
|
dfu-flash: $(BUILD)/dfu-package.zip
|
||||||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
|
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
|
||||||
$(NRFUTIL) --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank $(DFU_TOUCH)
|
$(NRFUTIL) --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank $(DFU_TOUCH)
|
||||||
|
|
||||||
dfu-bootloader:
|
## Create DFU package file
|
||||||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
dfu-gen: $(BUILD)/dfu-package.zip
|
||||||
$(NRFUTIL) --verbose dfu serial --package $(BOOT_FILE).zip -p $(SERIAL) -b 115200
|
|
||||||
|
|
||||||
uf2: $(BUILD)/$(OUTPUT_FILENAME).hex
|
$(BUILD)/dfu-package.zip: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||||
$(ECHO) "Create $(OUTPUT_FILENAME).uf2"
|
$(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip
|
||||||
$(PYTHON2) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "$(BUILD)/$(OUTPUT_FILENAME).uf2" $^
|
|
||||||
|
|
||||||
$(BUILD)/dfu-package.zip: dfu-gen
|
|
||||||
|
|
||||||
$(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
|
$(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
|
||||||
$(ECHO) "LINK $@"
|
$(ECHO) "LINK $@"
|
||||||
|
@ -5,7 +5,6 @@ SD ?= s132
|
|||||||
SOFTDEV_VERSION ?= 2.0.1
|
SOFTDEV_VERSION ?= 2.0.1
|
||||||
|
|
||||||
LD_FILE = boards/feather52832/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION).ld
|
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
|
BOOT_SETTING_ADDR = 0x7F000
|
||||||
NRF_DEFINES += -DNRF52832_XXAA
|
NRF_DEFINES += -DNRF52832_XXAA
|
||||||
|
@ -5,7 +5,6 @@ SD ?= s140
|
|||||||
SOFTDEV_VERSION ?= 6.0.0
|
SOFTDEV_VERSION ?= 6.0.0
|
||||||
|
|
||||||
BOOT_SETTING_ADDR = 0xFF000
|
BOOT_SETTING_ADDR = 0xFF000
|
||||||
BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140
|
|
||||||
|
|
||||||
ifeq ($(SD),)
|
ifeq ($(SD),)
|
||||||
LD_FILE = boards/nrf52840_1M_256k.ld
|
LD_FILE = boards/nrf52840_1M_256k.ld
|
||||||
|
@ -5,7 +5,6 @@ SD ?= s140
|
|||||||
SOFTDEV_VERSION ?= 6.0.0
|
SOFTDEV_VERSION ?= 6.0.0
|
||||||
|
|
||||||
BOOT_SETTING_ADDR = 0xFF000
|
BOOT_SETTING_ADDR = 0xFF000
|
||||||
BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140
|
|
||||||
|
|
||||||
ifeq ($(SD),)
|
ifeq ($(SD),)
|
||||||
LD_FILE = boards/nrf52840_1M_256k.ld
|
LD_FILE = boards/nrf52840_1M_256k.ld
|
||||||
@ -13,5 +12,4 @@ else
|
|||||||
LD_FILE = boards/bluefruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_$(SOFTDEV_VERSION).ld
|
LD_FILE = boards/bluefruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_$(SOFTDEV_VERSION).ld
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
NRF_DEFINES += -DNRF52840_XXAA
|
NRF_DEFINES += -DNRF52840_XXAA
|
||||||
|
Loading…
Reference in New Issue
Block a user