Skip to content

Commit

Permalink
Merge pull request #53 from jieter/linux-build
Browse files Browse the repository at this point in the history
Added a target to download & compile lpc21isp utility.
  • Loading branch information
xnk committed Feb 14, 2015
2 parents 831eaf4 + a069d0c commit 4306612
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
Debug/
Release/
build
lpc21isp
7 changes: 3 additions & 4 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4306612

Please sign in to comment.