2011-12-30 15:46:04 +01:00
|
|
|
|
2013-03-21 09:20:29 +01:00
|
|
|
# Arduino AVR Core and platform.
|
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
# For more info:
|
|
|
|
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
|
|
|
|
|
|
|
name=Arduino AVR Boards
|
2014-02-19 18:14:31 +01:00
|
|
|
version=1.5.6
|
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
|
|
|
|
2011-12-31 14:32:48 +01:00
|
|
|
# Default "compiler.path" is correct, change only if you want to overidde the initial value
|
Explicitly define compiler.path in avr/platform.txt
Previously, this relied on an (ugly, avr-specific) magic default for the
compiler.path variable, set by the IDE. This allowed the IDE to fall
back to a system-wide toolchain when no bundled toolchain was found (by
making compiler.path empty).
However,
- this only worked for avr, not sam,
- this worked only for gcc, a system-wide avrdude would break on the
avrdude.conf path in platform.txt, and
This would mean that automatic system-wide fallback didn't work in all
situations, so you'd still have to modify platform.txt (or create
platform.local.txt). Since doing that explictly is the most reliable
way, this commit removes the partial-working ability to do this
automatically.
Note that the code to automatically set compiler.path is still kept
around, in case third-party hardware still relies on this. At some
point, this code should be removed, but for now it just shows a warning
message.
2014-04-04 12:04:57 +02:00
|
|
|
compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
|
2011-12-30 15:46:04 +01:00
|
|
|
compiler.c.cmd=avr-gcc
|
2012-05-23 09:22:52 +02:00
|
|
|
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
|
2011-12-31 14:32:48 +01:00
|
|
|
compiler.c.elf.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++
|
2012-05-23 09:22:52 +02:00
|
|
|
compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -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
|
2014-04-04 11:31:50 +02:00
|
|
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
|
|
|
## Combine gc-sections, archives, and objects
|
2014-04-04 11:31:50 +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
|
|
|
|
|
|
|
## Create eeprom
|
2014-04-04 11:31:50 +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"
|
2011-12-31 14:32:48 +01:00
|
|
|
|
|
|
|
## Create hex
|
2014-04-04 11:31:50 +02:00
|
|
|
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
|
|
|
|
2012-02-06 00:51:24 +01:00
|
|
|
## Compute size
|
2013-04-23 02:48:22 +02:00
|
|
|
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-05-25 18:29:52 +02:00
|
|
|
tools.avrdude.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude
|
|
|
|
tools.avrdude.config.path={runtime.ide.path}/hardware/tools/avr/etc/avrdude.conf
|
|
|
|
tools.avrdude.cmd.path.linux={runtime.ide.path}/hardware/tools/avrdude
|
|
|
|
tools.avrdude.config.path.linux={runtime.ide.path}/hardware/tools/avrdude.conf
|
2012-02-05 23:17:15 +01:00
|
|
|
|
2012-02-01 14:34:29 +01:00
|
|
|
tools.avrdude.upload.params.verbose=-v -v -v -v
|
|
|
|
tools.avrdude.upload.params.quiet=-q -q
|
2012-11-04 01:05:54 +01: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
|
|
|
|
|
|
|
tools.avrdude.program.params.verbose=-v -v -v -v
|
|
|
|
tools.avrdude.program.params.quiet=-q -q
|
2012-11-04 01:05:54 +01: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
|
|
|
|
2012-05-25 17:31:55 +02:00
|
|
|
tools.avrdude.erase.params.verbose=-v -v -v -v
|
|
|
|
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
|
|
|
|
2012-02-05 23:17:15 +01:00
|
|
|
tools.avrdude.bootloader.params.verbose=-v -v -v -v
|
|
|
|
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
|
|
|
|
build.usb_manufacturer=
|
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}'
|