Added JLink flash scripts

This commit is contained in:
Kristian Sloth Lauszus
2018-05-02 10:37:27 +02:00
parent 0c4c736552
commit 66252eabf0
5 changed files with 39 additions and 2 deletions

View File

@@ -29,10 +29,24 @@ PROJECT_OBJ = $(BUILD_DIR)/$(PROJECT_NAME).axf
# Set the prefix for the tools to use.
PREFIX ?= arm-none-eabi
# Set WIN=1 manually for Windows Subsystem for Linux.
WIN ?= 0
# Determine if we are on a Windows machine and set the .exe suffix.
# We can not use the suffix command, as the PREFIX might contain spaces.
UNAME_S := $(shell uname -s)
ifeq ($(OS),Windows_NT) # Native Windows.
WIN = 1
endif
# Set J-Link executable.
ifeq ($(WIN),1)
JLINK := JLink.exe
else
JLINK := JLinkExe
endif
# We can not use the suffix command, as the PREFIX might contain spaces.
ifeq ($(WIN),1)
SUFFIX := .exe
endif
@@ -148,7 +162,7 @@ ifeq ($(INTERACTIVE),1)
color_purple = \033[38;5;097m
endif
.PHONY: all clean flash
.PHONY: all clean flash flash-jlink
# The default rule, which causes the project to be built.
all: $(PROJECT_OBJ)
@@ -161,6 +175,9 @@ clean:
flash: all
@$(FLASH_CMD) || exit 1
flash-jlink: all
$(JLINK) -if SWD -CommandFile $(JLINK_SCRIPT) || exit 1
# Rebuild all objects when the Makefiles change.
$(OBJS): $(MAKEFILE_LIST)

7
scripts/flash-left.jlink Normal file
View File

@@ -0,0 +1,7 @@
speed 4000
device MKL03Z32xxx4
connect
loadfile build_make/uhk_left.hex
RSetType 2
r
qc

View File

@@ -0,0 +1,7 @@
speed 4000
device MK22FN512xxx12
connect
loadfile build_make/uhk_right.hex
RSetType 2
r
qc