nrf5: Makefile option to set FLASHER when doing flash target. If defined in board .mk file, this will be used, else nrfjprog will be used by default (segger). This opens up for using pyocd flashtool and still run 'make flash'.
This commit is contained in:
parent
4b6a12a251
commit
31569dc952
|
@ -175,6 +175,10 @@ $(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os
|
|||
|
||||
all: $(BUILD)/firmware.elf binary hex
|
||||
|
||||
FLASHER ?=
|
||||
|
||||
ifeq ($(FLASHER),)
|
||||
|
||||
flash: $(BUILD)/firmware.elf
|
||||
nrfjprog --program $(BUILD)/firmware.hex --sectorerase -f $(MCU_VARIANT)
|
||||
nrfjprog --pinreset -f $(MCU_VARIANT)
|
||||
|
@ -185,6 +189,13 @@ sd:
|
|||
nrfjprog --program $(BUILD)/firmware.hex --sectorerase -f $(MCU_VARIANT)
|
||||
nrfjprog --pinreset -f $(MCU_VARIANT)
|
||||
|
||||
else ifeq ($(FLASHER), pyocd)
|
||||
|
||||
flash: $(BUILD)/firmware.elf
|
||||
pyocd-flashtool -t $(MCU_VARIANT) $(BUILD)/firmware.hex
|
||||
|
||||
endif
|
||||
|
||||
$(BUILD)/firmware.elf: $(OBJ)
|
||||
$(ECHO) "LINK $@"
|
||||
$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
||||
|
|
Loading…
Reference in New Issue