Skip to content

Commit ed7c5ac

Browse files
committed
add mbr flash target
1 parent 0b84f42 commit ed7c5ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ SD_VERSION = 6.1.1
1717
SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION)
1818
SD_HEX = $(SD_PATH)/$(SD_FILENAME)_softdevice.hex
1919

20+
MBR_HEX = lib/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex
21+
2022
# linker by MCU and SoftDevice eg. nrf52840_s140_v6.ld
2123
LD_FILE = linker/$(MCU_SUB_VARIANT)_$(SD_NAME)_v$(word 1, $(subst ., ,$(SD_VERSION))).ld
2224

@@ -326,14 +328,25 @@ flash: $(BUILD)/$(OUT_FILE)-nosd.hex
326328
@echo Flashing: $(notdir $<)
327329
$(NRFJPROG) --program $< --sectoranduicrerase -f nrf52 --reset
328330

331+
# dfu using CDC interface
329332
dfu-flash: $(BUILD)/$(MERGED_FILE).zip
330333
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
331334
$(NRFUTIL) --verbose dfu serial --package $< -p $(SERIAL) -b 115200 --singlebank --touch 1200
332335

336+
erase:
337+
@echo Erasing flash
338+
$(NRFJPROG) -f nrf52 --eraseall
339+
340+
# flash SD only
333341
sd:
334342
@echo Flashing: $(SD_HEX)
335343
$(NRFJPROG) --program $(SD_HEX) -f nrf52 --chiperase --reset
336344

345+
# flash MBR only
346+
mbr:
347+
@echo Flashing: $(MBR_HEX)
348+
$(NRFJPROG) --program $(MBR_HEX) -f nrf52 --sectorerase
349+
337350
gdbflash: $(BUILD)/$(MERGED_FILE).hex
338351
@echo Flashing: $<
339352
@$(GDB_BMP) -nx --batch -ex 'load $<' -ex 'compare-sections' -ex 'kill'

0 commit comments

Comments
 (0)