Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
makefile@3:f151d08d335c, 2014-03-02 (annotated)
- Committer:
- Bigcheese
- Date:
- Sun Mar 02 06:33:08 2014 +0000
- Revision:
- 3:f151d08d335c
- Parent:
- 2:1df0b61d3b5a
Bunch of stuff. Need to locally merge in updated USB changes.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Michael J. Spencer |
2:1df0b61d3b5a | 1 | PROJECT=main |
Michael J. Spencer |
2:1df0b61d3b5a | 2 | BUILD_DIR=../build |
Michael J. Spencer |
2:1df0b61d3b5a | 3 | DEVICES=lpc1768 |
Michael J. Spencer |
2:1df0b61d3b5a | 4 | |
Michael J. Spencer |
2:1df0b61d3b5a | 5 | # BUILD_TYPE can be set to the following values: |
Michael J. Spencer |
2:1df0b61d3b5a | 6 | # Checked - Optimizations enabled with MRI debug monitor support. (Recommended Type) |
Michael J. Spencer |
2:1df0b61d3b5a | 7 | # Release - Optimizations enabled. |
Michael J. Spencer |
2:1df0b61d3b5a | 8 | # Debug - Optimization disabled with MRI debug monitor support. |
Michael J. Spencer |
2:1df0b61d3b5a | 9 | BUILD_TYPE=Checked |
Michael J. Spencer |
2:1df0b61d3b5a | 10 | |
Michael J. Spencer |
2:1df0b61d3b5a | 11 | # Set to 1 to tag each heap allocation with the caller's return address. |
Michael J. Spencer |
2:1df0b61d3b5a | 12 | # NOTE: Can't be enabled with latest build as not compatible with newlib nano. |
Michael J. Spencer |
2:1df0b61d3b5a | 13 | HEAP_TAGS=0 |
Michael J. Spencer |
2:1df0b61d3b5a | 14 | |
Michael J. Spencer |
2:1df0b61d3b5a | 15 | # Set to 1 configure MPU to disable write buffering and eliminate imprecise bus faults. |
Michael J. Spencer |
2:1df0b61d3b5a | 16 | WRITE_BUFFER_DISABLE=0 |
Michael J. Spencer |
2:1df0b61d3b5a | 17 | |
Michael J. Spencer |
2:1df0b61d3b5a | 18 | # Set to non zero value if you want checks to be enabled which reserve a |
Michael J. Spencer |
2:1df0b61d3b5a | 19 | # specific amount of space for the stack. The heap's growth will be |
Michael J. Spencer |
2:1df0b61d3b5a | 20 | # constrained to reserve this much space for the stack and the stack won't be |
Michael J. Spencer |
2:1df0b61d3b5a | 21 | # able to grow larger than this amount. |
Michael J. Spencer |
2:1df0b61d3b5a | 22 | STACK_SIZE=3072 |
Michael J. Spencer |
2:1df0b61d3b5a | 23 | |
Michael J. Spencer |
2:1df0b61d3b5a | 24 | # Set to 1 to allow MRI debug monitor to take full control of UART0 and use it |
Michael J. Spencer |
2:1df0b61d3b5a | 25 | # as a dedicated debug channel. If you are using the USB based serial port for |
Michael J. Spencer |
2:1df0b61d3b5a | 26 | # the console then this should cause you no problems. Set MRI_BREAK_ON_INIT to |
Michael J. Spencer |
2:1df0b61d3b5a | 27 | # 0 if you don't want to break into GDB at startup. |
Michael J. Spencer |
2:1df0b61d3b5a | 28 | ENABLE_DEBUG_MONITOR?=0 |
Michael J. Spencer |
2:1df0b61d3b5a | 29 | |
Michael J. Spencer |
2:1df0b61d3b5a | 30 | ifeq "$(ENABLE_DEBUG_MONITOR)" "1" |
Michael J. Spencer |
2:1df0b61d3b5a | 31 | # Can add MRI_UART_BAUD=115200 to next line if GDB fails to connect to MRI. |
Michael J. Spencer |
2:1df0b61d3b5a | 32 | # Tends to happen on some Linux distros but not Windows and OS X. |
Michael J. Spencer |
2:1df0b61d3b5a | 33 | MRI_UART=MRI_UART_0 |
Michael J. Spencer |
2:1df0b61d3b5a | 34 | MRI_BREAK_ON_INIT=1 |
Michael J. Spencer |
2:1df0b61d3b5a | 35 | MRI_SEMIHOST_STDIO=1 |
Michael J. Spencer |
2:1df0b61d3b5a | 36 | else |
Michael J. Spencer |
2:1df0b61d3b5a | 37 | MRI_UART=MRI_UART_0 MRI_UART_SHARE |
Michael J. Spencer |
2:1df0b61d3b5a | 38 | MRI_BREAK_ON_INIT=0 |
Michael J. Spencer |
2:1df0b61d3b5a | 39 | MRI_SEMIHOST_STDIO=0 |
Michael J. Spencer |
2:1df0b61d3b5a | 40 | endif |
Michael J. Spencer |
2:1df0b61d3b5a | 41 | |
Michael J. Spencer |
2:1df0b61d3b5a | 42 | # generate a git version string, sorry only on linux and mac osx |
Michael J. Spencer |
2:1df0b61d3b5a | 43 | ifneq "$(OS)" "Windows_NT" |
Michael J. Spencer |
2:1df0b61d3b5a | 44 | DEFINES += -D__GITVERSIONSTRING__=\"$(shell ./generate-version.sh)\" |
Michael J. Spencer |
2:1df0b61d3b5a | 45 | else |
Michael J. Spencer |
2:1df0b61d3b5a | 46 | DEFINES += -D__GITVERSIONSTRING__=\"placeholder\" |
Michael J. Spencer |
2:1df0b61d3b5a | 47 | endif |
Michael J. Spencer |
2:1df0b61d3b5a | 48 | |
Michael J. Spencer |
2:1df0b61d3b5a | 49 | # use c++11 features for the checksums |
Michael J. Spencer |
2:1df0b61d3b5a | 50 | DEFINES += -DCHECKSUM_USE_CPP |
Michael J. Spencer |
2:1df0b61d3b5a | 51 | |
Michael J. Spencer |
2:1df0b61d3b5a | 52 | # add any modules that you do not want included in the build |
Michael J. Spencer |
2:1df0b61d3b5a | 53 | export EXCLUDED_MODULES = tools/touchprobe |
Michael J. Spencer |
2:1df0b61d3b5a | 54 | # e.g for a CNC machine |
Michael J. Spencer |
2:1df0b61d3b5a | 55 | #export EXCLUDED_MODULES = tools/touchprobe tools/laser tools/temperaturecontrol tools/extruder |
Michael J. Spencer |
2:1df0b61d3b5a | 56 | |
Michael J. Spencer |
2:1df0b61d3b5a | 57 | # set to not compile in any network support |
Michael J. Spencer |
2:1df0b61d3b5a | 58 | #export NONETWORK = 1 |
Michael J. Spencer |
2:1df0b61d3b5a | 59 | |
Michael J. Spencer |
2:1df0b61d3b5a | 60 | include $(BUILD_DIR)/build.mk |
Michael J. Spencer |
2:1df0b61d3b5a | 61 | |
Michael J. Spencer |
2:1df0b61d3b5a | 62 | CONSOLE?=/dev/arduino |
Michael J. Spencer |
2:1df0b61d3b5a | 63 | BAUD?=1000000 |
Michael J. Spencer |
2:1df0b61d3b5a | 64 | |
Michael J. Spencer |
2:1df0b61d3b5a | 65 | .PHONY: debug-store flash upload debug console dfu |
Michael J. Spencer |
2:1df0b61d3b5a | 66 | |
Michael J. Spencer |
2:1df0b61d3b5a | 67 | debug-store: ../LPC1768/$(PROJECT).elf |
Michael J. Spencer |
2:1df0b61d3b5a | 68 | cp ../LPC1768/$(PROJECT).elf ../LPC1768/$(PROJECT)_lastupload.elf |
Michael J. Spencer |
2:1df0b61d3b5a | 69 | |
Michael J. Spencer |
2:1df0b61d3b5a | 70 | flash: ../LPC1768/$(PROJECT).hex debug-store |
Michael J. Spencer |
2:1df0b61d3b5a | 71 | lpc21isp $< $(CONSOLE) 115200 12000 |
Michael J. Spencer |
2:1df0b61d3b5a | 72 | |
Michael J. Spencer |
2:1df0b61d3b5a | 73 | dfu: ../LPC1768/$(PROJECT).bin |
Michael J. Spencer |
2:1df0b61d3b5a | 74 | dfu-util -D $< -R |
Michael J. Spencer |
2:1df0b61d3b5a | 75 | |
Michael J. Spencer |
2:1df0b61d3b5a | 76 | upload: ../LPC1768/$(PROJECT).bin debug-store |
Michael J. Spencer |
2:1df0b61d3b5a | 77 | dfu-util -R -d 1d50:6015 -D $< |
Michael J. Spencer |
2:1df0b61d3b5a | 78 | |
Michael J. Spencer |
2:1df0b61d3b5a | 79 | debug: ../LPC1768/$(PROJECT)_lastupload.elf |
Michael J. Spencer |
2:1df0b61d3b5a | 80 | arm-none-eabi-gdb $< -ex "set target-charset ASCII" -ex "set remotelogfile mri.log" -ex "target remote $(CONSOLE)" |
Michael J. Spencer |
2:1df0b61d3b5a | 81 | |
Michael J. Spencer |
2:1df0b61d3b5a | 82 | console: |
Michael J. Spencer |
2:1df0b61d3b5a | 83 | stty raw ignbrk -echo $(BAUD) < $(CONSOLE) |
Michael J. Spencer |
2:1df0b61d3b5a | 84 | ( cat <&3 & cat >&3 ; kill %% ) 3<>$(CONSOLE) |