From a069d0ca004bbb214e4d022e219ba8689bcf2b8c Mon Sep 17 00:00:00 2001 From: Jan Pieter Waagmeester Date: Thu, 5 Feb 2015 13:28:54 +0100 Subject: [PATCH] Add a target to download and compile the lpc21isp flash tool --- .gitignore | 1 + COMPILING.md | 7 +++---- Makefile | 17 +++++++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index e218713..97f88e3 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ Debug/ Release/ build +lpc21isp diff --git a/COMPILING.md b/COMPILING.md index 6908017..9103abe 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -16,10 +16,9 @@ make ## Flashing in Linux -Using [lpc21isp], (after entering the bootloader) it's a matter of running +The makefile has a target to download and build the [lpc21isp utility from sourceforge](http://sourceforge.net/projects/lpc21isp/). Just run ``` -./lpc21isp build/T-962-controller.hex /dev/ttyUSB0 57600 11059 +make flash ``` - -[lpc21isp]: http://sourceforge.net/projects/lpc21isp/ +and it wil be downloaded and compiled for you. diff --git a/Makefile b/Makefile index a44015a..6da5ea4 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ SRC_DIR := ./src/ BUILD_DIR := ./build/ TARGET := $(BUILD_DIR)$(BASE_NAME).axf + vpath %.c $(SRC_DIR) vpath %.o $(BUILD_DIR) vpath %.d $(BUILD_DIR) @@ -80,9 +81,21 @@ post-build: -arm-none-eabi-objcopy -v -O ihex "$(TARGET)" "$(BUILD_DIR)$(BASE_NAME).hex" -@echo ' ' -flash: axf +lpc21isp: $(BUILD_DIR)tag + -@echo '' + -@echo 'Downloading lpc21isp 1.97 source from sourceforge' + wget http://sourceforge.net/projects/lpc21isp/files/lpc21isp/1.97/lpc21isp_197.zip/download -O $(BUILD_DIR)lpc21isp.zip + unzip -qq -o $(BUILD_DIR)lpc21isp.zip -d $(BUILD_DIR) + + -@echo 'Making lpc21isp' + $(MAKE) -C $(BUILD_DIR)lpc21isp_197/ + -@echo 'Copy lpc21isp binary to current directory' + cp $(BUILD_DIR)lpc21isp_197/lpc21isp . + -@echo '' + +flash: axf lpc21isp + @echo '' @echo 'Flashing $(COLOR_GREEN)$(BASE_NAME).hex$(COLOR_END) to $(COLOR_RED)$(FLASH_TTY)$(COLOR_END)' - @echo ' ' $(FLASH_TOOL) "$(BUILD_DIR)$(BASE_NAME).hex" $(FLASH_TTY) $(FLASH_BAUD) $(MCU_CLOCK) .PHONY: clean dependents