Commit | Line | Data |
---|---|---|
4cff3ded AW |
1 | # Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/)\r |
2 | #\r | |
3 | # Licensed under the Apache License, Version 2.0 (the "License");\r | |
4 | # you may not use this file except in compliance with the License.\r | |
5 | # You may obtain a copy of the License at\r | |
6 | #\r | |
7 | # http://www.apache.org/licenses/LICENSE-2.0\r | |
8 | #\r | |
9 | # Unless required by applicable law or agreed to in writing, software\r | |
10 | # distributed under the License is distributed on an "AS IS" BASIS,\r | |
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r | |
12 | # See the License for the specific language governing permissions and\r | |
13 | # limitations under the License.\r | |
14 | PROJECT=main\r | |
4eb9c745 | 15 | GCC4MBED_DIR=./gcc4mbed\r |
4cff3ded AW |
16 | INCDIRS=\r |
17 | LIBS_PREFIX=\r | |
18 | LIBS_SUFFIX=\r | |
b6c86164 | 19 | SRC=./src\r |
b00f1a6b AG |
20 | \r |
21 | #GCC4MBED_TYPE=Debug\r | |
4464301d | 22 | #GCC4MBED_TYPE=Release\r |
6c79da43 | 23 | GCC4MBED_TYPE=Checked\r |
b00f1a6b | 24 | \r |
dc2de456 AG |
25 | # Set to 1 to tag each heap allocation with the caller's return address.\r |
26 | HEAP_TAGS=1\r | |
27 | \r | |
65eee97a AG |
28 | # Set to 1 configure MPU to disable write buffering and eliminate imprecise bus faults.\r |
29 | WRITE_BUFFER_DISABLE=1\r | |
30 | \r | |
b00f1a6b AG |
31 | # Set to 1 to allow MRI debug monitor to take full control of UART0 and use it\r |
32 | # as a dedicated debug channel. If you are using the USB based serial port for\r | |
33 | # the console then this should cause you no problems. Set MRI_BREAK_ON_INIT to\r | |
34 | # 0 if you don't want to break into GDB at startup.\r | |
7e7cae44 | 35 | ENABLE_DEBUG_MONITOR?=0\r |
b00f1a6b | 36 | \r |
ddf5038e AG |
37 | # Set to non zero value if you want checks to be enabled which reserve a\r |
38 | # specific amount of space for the stack. The heap's growth will be\r | |
39 | # constrained to reserve this much space for the stack and the stack won't be\r | |
40 | # able to grow larger than this amount.\r | |
41 | STACK_SIZE=3072\r | |
42 | \r | |
b00f1a6b AG |
43 | ifeq "$(ENABLE_DEBUG_MONITOR)" "1"\r |
44 | # Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI.\r | |
45 | # Tends to happen on some Linux distros but not Windows and OS X.\r | |
46 | MRI_UART=MRI_UART_0\r | |
47 | MRI_BREAK_ON_INIT=1\r | |
48 | MRI_SEMIHOST_STDIO=1\r | |
49 | else\r | |
50 | MRI_UART=MRI_UART_0 MRI_UART_SHARE\r | |
6c79da43 AG |
51 | MRI_BREAK_ON_INIT=0\r |
52 | MRI_SEMIHOST_STDIO=0\r | |
b00f1a6b | 53 | endif\r |
4cff3ded | 54 | \r |
38cf3dc6 | 55 | CONSOLE=/dev/ttyUSB0\r |
14d4726b | 56 | \r |
4cff3ded AW |
57 | include ./gcc4mbed/build/gcc4mbed.mk\r |
58 | \r | |
15d0cdbc MM |
59 | .PHONY: debug-store flash upload debug console\r |
60 | \r | |
61 | debug-store: $(PROJECT).elf\r | |
62 | cp $(PROJECT).elf $(PROJECT)_lastupload.elf\r | |
63 | \r | |
64 | flash: $(PROJECT).hex debug-store\r | |
5cdad772 | 65 | lpc21isp $< $(CONSOLE) 115200 12000\r |
a33de4b2 | 66 | \r |
15d0cdbc | 67 | upload: $(PROJECT).bin debug-store\r |
38cf3dc6 | 68 | dfu-util -d 1d50:6015 -R -D $<\r |
0144b869 | 69 | \r |
15d0cdbc | 70 | debug: $(PROJECT)_lastupload.elf\r |
14d4726b | 71 | arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)"\r |
0144b869 MM |
72 | \r |
73 | console:\r | |
14d4726b MM |
74 | stty raw ignbrk -echo 2000000 < $(CONSOLE)\r |
75 | ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE)\r |