1 # Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/)
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 GCC4MBED_DIR=./gcc4mbed
20 #GCC4MBED_TYPE=Release
23 #MRI_UART=MRI_UART_MBED_P13_P14 MRI_UART_BAUD=115200
24 MRI_UART=MRI_UART_MBED_USB MRI_UART_SHARE
25 #MRI_UART=MRI_UART_MBED_USB
29 CONSOLE=/dev/arduino_A900K10V
31 include ./gcc4mbed/build/gcc4mbed.mk
33 .PHONY: debug-store flash upload debug console
35 debug-store: $(PROJECT).elf
36 cp $(PROJECT).elf $(PROJECT)_lastupload.elf
38 flash: $(PROJECT).hex debug-store
39 lpc21isp $< $(CONSOLE) 115200 12000
41 upload: $(PROJECT).bin debug-store
42 dfu-util -d 1d50:6015 -D $<
44 debug: $(PROJECT)_lastupload.elf
45 arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"
48 stty raw ignbrk -echo 2000000 < $(CONSOLE)
49 ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)