2011-12-30 15:46:04 +01:00
|
|
|
|
2013-03-21 09:20:29 +01:00
|
|
|
# Arduino AVR Core and platform.
|
|
|
|
# ------------------------------
|
2015-04-13 12:22:37 +02:00
|
|
|
#
|
2013-03-21 09:20:29 +01:00
|
|
|
# For more info:
|
2015-08-01 00:54:22 +02:00
|
|
|
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
|
2013-03-21 09:20:29 +01:00
|
|
|
|
|
|
|
name=Arduino AVR Boards
|
2016-03-04 14:56:09 +01:00
|
|
|
version=1.6.10
|
2013-03-21 09:20:29 +01:00
|
|
|
|
2011-12-31 14:32:48 +01:00
|
|
|
# AVR compile variables
|
|
|
|
# ---------------------
|
2011-12-30 15:46:04 +01:00
|
|
|
|
2015-04-24 09:06:30 +02:00
|
|
|
compiler.warning_flags=-w
|
2015-04-13 12:22:37 +02:00
|
|
|
compiler.warning_flags.none=-w
|
2015-04-13 17:18:23 +02:00
|
|
|
compiler.warning_flags.default=
|
|
|
|
compiler.warning_flags.more=-Wall
|
|
|
|
compiler.warning_flags.all=-Wall -Wextra
|
2015-04-13 12:22:37 +02:00
|
|
|
|
2011-12-31 14:32:48 +01:00
|
|
|
# Default "compiler.path" is correct, change only if you want to overidde the initial value
|
2015-03-13 16:07:21 +01:00
|
|
|
compiler.path={runtime.tools.avr-gcc.path}/bin/
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.c.cmd=avr-gcc
|
2014-07-07 19:43:51 +02:00
|
|
|
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD
|
2014-04-29 10:39:25 +02:00
|
|
|
# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
|
|
|
|
# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
|
2015-04-13 12:22:37 +02:00
|
|
|
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.c.elf.cmd=avr-gcc
|
2014-01-21 21:57:35 +01:00
|
|
|
compiler.S.flags=-c -g -x assembler-with-cpp
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.cpp.cmd=avr-g++
|
2014-07-07 19:43:51 +02:00
|
|
|
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.ar.cmd=avr-ar
|
|
|
|
compiler.ar.flags=rcs
|
|
|
|
compiler.objcopy.cmd=avr-objcopy
|
2011-12-31 14:32:48 +01:00
|
|
|
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
|
|
|
|
compiler.elf2hex.flags=-O ihex -R .eeprom
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.elf2hex.cmd=avr-objcopy
|
|
|
|
compiler.ldflags=
|
2012-02-06 00:51:24 +01:00
|
|
|
compiler.size.cmd=avr-size
|
2014-04-04 11:31:50 +02:00
|
|
|
|
|
|
|
# This can be overriden in boards.txt
|
2012-06-26 00:52:05 +02:00
|
|
|
build.extra_flags=
|
2011-12-30 15:46:04 +01:00
|
|
|
|
2014-04-04 11:31:50 +02:00
|
|
|
# These can be overridden in platform.local.txt
|
|
|
|
compiler.c.extra_flags=
|
|
|
|
compiler.c.elf.extra_flags=
|
|
|
|
compiler.S.extra_flags=
|
|
|
|
compiler.cpp.extra_flags=
|
|
|
|
compiler.ar.extra_flags=
|
|
|
|
compiler.objcopy.eep.extra_flags=
|
|
|
|
compiler.elf2hex.extra_flags=
|
|
|
|
|
2011-12-31 14:32:48 +01:00
|
|
|
# AVR compile patterns
|
|
|
|
# --------------------
|
|
|
|
|
|
|
|
## Compile c files
|
2014-04-04 11:31:50 +02:00
|
|
|
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}"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
|
|
|
## Compile c++ files
|
2014-04-04 11:31:50 +02:00
|
|
|
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
2013-07-12 21:09:45 +02:00
|
|
|
## Compile S files
|
2014-04-04 11:31:50 +02:00
|
|
|
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}"
|
2013-07-12 21:09:45 +02:00
|
|
|
|
2011-12-31 14:32:48 +01:00
|
|
|
## Create archives
|
2016-03-22 11:31:10 +01:00
|
|
|
archive_file_path={build.path}/{archive_file}
|
2015-09-24 11:28:02 +02:00
|
|
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
|
|
|
## Combine gc-sections, archives, and objects
|
2015-09-18 11:21:13 +02:00
|
|
|
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
|
2011-12-31 14:32:48 +01:00
|
|
|
|
2015-02-16 14:06:20 +01:00
|
|
|
## Create output files (.eep and .hex)
|
2015-09-18 11:21:13 +02:00
|
|
|
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"
|
|
|
|
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"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
2015-01-23 04:00:46 +01:00
|
|
|
## Save hex
|
2015-02-09 23:24:48 +01:00
|
|
|
recipe.output.tmp_file={build.project_name}.hex
|
|
|
|
recipe.output.save_file={build.project_name}.{build.variant}.hex
|
2015-01-23 04:00:46 +01:00
|
|
|
|
2012-02-06 00:51:24 +01:00
|
|
|
## Compute size
|
2015-09-18 11:21:13 +02:00
|
|
|
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
2013-04-23 02:48:22 +02:00
|
|
|
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
|
|
|
|
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
|
|
|
|
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
|
2012-02-06 00:51:24 +01:00
|
|
|
|
2015-09-15 12:15:48 +02:00
|
|
|
## Preprocessor
|
|
|
|
preproc.includes.flags=-w -x c++ -M -MG -MP
|
2015-09-18 13:32:25 +02:00
|
|
|
recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"
|
2015-09-15 12:15:48 +02:00
|
|
|
|
|
|
|
preproc.macros.flags=-w -x c++ -E -CC
|
2015-11-18 09:34:33 +01:00
|
|
|
recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
2012-02-01 14:34:29 +01:00
|
|
|
# AVR Uploader/Programmers tools
|
2013-03-21 09:20:29 +01:00
|
|
|
# ------------------------------
|
2012-02-01 14:34:29 +01:00
|
|
|
|
2015-03-02 17:28:55 +01:00
|
|
|
tools.avrdude.path={runtime.tools.avrdude.path}
|
2015-03-02 17:41:37 +01:00
|
|
|
tools.avrdude.cmd.path={path}/bin/avrdude
|
|
|
|
tools.avrdude.config.path={path}/etc/avrdude.conf
|
2012-02-05 23:17:15 +01:00
|
|
|
|
2014-04-10 11:54:25 +02:00
|
|
|
tools.avrdude.upload.params.verbose=-v
|
2012-02-01 14:34:29 +01:00
|
|
|
tools.avrdude.upload.params.quiet=-q -q
|
2015-09-18 11:21:13 +02:00
|
|
|
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"
|
2012-02-01 14:34:29 +01:00
|
|
|
|
2014-04-10 11:54:25 +02:00
|
|
|
tools.avrdude.program.params.verbose=-v
|
2012-02-01 14:34:29 +01:00
|
|
|
tools.avrdude.program.params.quiet=-q -q
|
2015-09-18 11:21:13 +02:00
|
|
|
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"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
2014-04-10 11:54:25 +02:00
|
|
|
tools.avrdude.erase.params.verbose=-v
|
2012-05-25 17:31:55 +02:00
|
|
|
tools.avrdude.erase.params.quiet=-q -q
|
2012-11-04 01:05:54 +01:00
|
|
|
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
|
2012-05-25 17:31:55 +02:00
|
|
|
|
2014-04-10 11:54:25 +02:00
|
|
|
tools.avrdude.bootloader.params.verbose=-v
|
2012-02-05 23:17:15 +01:00
|
|
|
tools.avrdude.bootloader.params.quiet=-q -q
|
2014-01-05 12:42:27 +01:00
|
|
|
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.file}:i" -Ulock:w:{bootloader.lock_bits}:m
|
2012-05-25 11:47:22 +02:00
|
|
|
|
2013-04-24 09:49:24 +02:00
|
|
|
|
|
|
|
# USB Default Flags
|
|
|
|
# Default blank usb manufacturer will be filled it at compile time
|
|
|
|
# - from numeric vendor ID, set to Unknown otherwise
|
2015-03-06 12:46:21 +01:00
|
|
|
build.usb_manufacturer="Unknown"
|
2013-08-01 15:20:24 +02:00
|
|
|
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|