|
@@ -1,5 +1,5 @@
|
1
|
1
|
|
2
|
|
-# Marlin AVR Core and platform.
|
|
2
|
+# Arduino AVR Core and platform.
|
3
|
3
|
# ------------------------------
|
4
|
4
|
|
5
|
5
|
# For more info:
|
|
@@ -7,3 +7,113 @@
|
7
|
7
|
|
8
|
8
|
name=Marlin AVR Boards
|
9
|
9
|
version=1.5.6
|
|
10
|
+
|
|
11
|
+# AVR compile variables
|
|
12
|
+# ---------------------
|
|
13
|
+
|
|
14
|
+# Default "compiler.path" is correct, change only if you want to overidde the initial value
|
|
15
|
+compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
|
|
16
|
+compiler.c.cmd=avr-gcc
|
|
17
|
+compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
|
|
18
|
+# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
|
|
19
|
+# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
|
|
20
|
+compiler.c.elf.flags=-w -Os -Wl,--gc-sections
|
|
21
|
+compiler.c.elf.cmd=avr-gcc
|
|
22
|
+compiler.S.flags=-c -g -x assembler-with-cpp
|
|
23
|
+compiler.cpp.cmd=avr-g++
|
|
24
|
+compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
|
|
25
|
+compiler.ar.cmd=avr-ar
|
|
26
|
+compiler.ar.flags=rcs
|
|
27
|
+compiler.objcopy.cmd=avr-objcopy
|
|
28
|
+compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
|
|
29
|
+compiler.elf2hex.flags=-O ihex -R .eeprom
|
|
30
|
+compiler.elf2hex.cmd=avr-objcopy
|
|
31
|
+compiler.ldflags=
|
|
32
|
+compiler.size.cmd=avr-size
|
|
33
|
+
|
|
34
|
+# This can be overriden in boards.txt
|
|
35
|
+build.extra_flags=
|
|
36
|
+
|
|
37
|
+# These can be overridden in platform.local.txt
|
|
38
|
+compiler.c.extra_flags=
|
|
39
|
+compiler.c.elf.extra_flags=
|
|
40
|
+compiler.S.extra_flags=
|
|
41
|
+compiler.cpp.extra_flags=
|
|
42
|
+compiler.ar.extra_flags=
|
|
43
|
+compiler.objcopy.eep.extra_flags=
|
|
44
|
+compiler.elf2hex.extra_flags=
|
|
45
|
+
|
|
46
|
+# AVR compile patterns
|
|
47
|
+# --------------------
|
|
48
|
+
|
|
49
|
+## Compile c files
|
|
50
|
+recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
51
|
+
|
|
52
|
+## Compile c++ files
|
|
53
|
+recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {compiler.cpp.extra_flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
54
|
+
|
|
55
|
+## Compile S files
|
|
56
|
+recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
|
57
|
+
|
|
58
|
+## Create archives
|
|
59
|
+recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
|
60
|
+
|
|
61
|
+## Combine gc-sections, archives, and objects
|
|
62
|
+recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
|
|
63
|
+
|
|
64
|
+## Create eeprom
|
|
65
|
+recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
|
|
66
|
+
|
|
67
|
+## Create hex
|
|
68
|
+recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
|
|
69
|
+
|
|
70
|
+## Compute size
|
|
71
|
+recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
|
72
|
+recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
|
|
73
|
+recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
|
|
74
|
+recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+# AVR Uploader/Programmers tools
|
|
78
|
+# ------------------------------
|
|
79
|
+
|
|
80
|
+tools.avrdude.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude
|
|
81
|
+tools.avrdude.config.path={runtime.ide.path}/hardware/tools/avr/etc/avrdude.conf
|
|
82
|
+
|
|
83
|
+tools.avrdude.upload.params.verbose=-v
|
|
84
|
+tools.avrdude.upload.params.quiet=-q -q
|
|
85
|
+tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"
|
|
86
|
+
|
|
87
|
+tools.avrdude.program.params.verbose=-v
|
|
88
|
+tools.avrdude.program.params.quiet=-q -q
|
|
89
|
+tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i"
|
|
90
|
+
|
|
91
|
+tools.avrdude.erase.params.verbose=-v
|
|
92
|
+tools.avrdude.erase.params.quiet=-q -q
|
|
93
|
+tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
|
|
94
|
+
|
|
95
|
+tools.avrdude.bootloader.params.verbose=-v
|
|
96
|
+tools.avrdude.bootloader.params.quiet=-q -q
|
|
97
|
+tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.path}/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m
|
|
98
|
+
|
|
99
|
+tools.hidloader.cmd.path=/usr/local/bin/HIDUploader
|
|
100
|
+
|
|
101
|
+tools.hidloader.upload.params.verbose=-v
|
|
102
|
+tools.hidloader.upload.params.quiet=
|
|
103
|
+tools.hidloader.upload.pattern="{cmd.path}" --upload -mmcu={build.mcu} {upload.verbose} -w "{build.path}/{build.project_name}.hex"
|
|
104
|
+tools.nativehid.program.params.verbose=-v
|
|
105
|
+tools.nativehid.program.params.quiet=-q -q
|
|
106
|
+
|
|
107
|
+tools.hidloader.program.params.verbose=-v
|
|
108
|
+tools.hidloader.program.params.quiet=-q -q
|
|
109
|
+tools.hidloader.program.pattern="{cmd.path}" -mmcu={build.mcu} {upload.verbose} -w "{build.path}/{build.project_name}.hex"
|
|
110
|
+
|
|
111
|
+tools.hidloader.erase.params.verbose=-v
|
|
112
|
+tools.hidloader.erase.params.quiet=-q -q
|
|
113
|
+tools.hidloader.erase.pattern="{cmd.path}" --erase "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
|
|
114
|
+
|
|
115
|
+# USB Default Flags
|
|
116
|
+# Default blank usb manufacturer will be filled it at compile time
|
|
117
|
+# - from numeric vendor ID, set to Unknown otherwise
|
|
118
|
+build.usb_manufacturer=
|
|
119
|
+build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|