2012-01-11 13:59:16 +01:00
|
|
|
|
2013-03-21 09:20:29 +01:00
|
|
|
# Arduino SAM 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
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2012-10-09 21:40:11 +02:00
|
|
|
name=Arduino ARM (32-bits) Boards
|
2015-04-27 10:55:10 +02:00
|
|
|
version=1.6.4
|
2013-03-21 09:20:29 +01:00
|
|
|
|
|
|
|
# SAM3 compile variables
|
|
|
|
# ----------------------
|
|
|
|
|
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
|
|
|
|
2015-03-13 16:07:21 +01:00
|
|
|
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
|
2012-01-11 13:59:16 +01:00
|
|
|
compiler.c.cmd=arm-none-eabi-gcc
|
2014-07-07 19:43:51 +02:00
|
|
|
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -MMD
|
2014-09-06 12:42:25 +02:00
|
|
|
compiler.c.elf.cmd=arm-none-eabi-gcc
|
2012-01-13 19:09:07 +01:00
|
|
|
compiler.c.elf.flags=-Os -Wl,--gc-sections
|
2015-05-29 14:19:54 +02:00
|
|
|
compiler.S.cmd=arm-none-eabi-gcc
|
|
|
|
compiler.S.flags=-c -g -x assembler-with-cpp -mthumb
|
2012-01-11 13:59:16 +01:00
|
|
|
compiler.cpp.cmd=arm-none-eabi-g++
|
2014-07-07 19:43:51 +02:00
|
|
|
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD
|
2012-01-11 13:59:16 +01:00
|
|
|
compiler.ar.cmd=arm-none-eabi-ar
|
|
|
|
compiler.ar.flags=rcs
|
|
|
|
compiler.objcopy.cmd=arm-none-eabi-objcopy
|
|
|
|
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 binary
|
|
|
|
compiler.elf2hex.cmd=arm-none-eabi-objcopy
|
|
|
|
compiler.ldflags=
|
|
|
|
compiler.size.cmd=arm-none-eabi-size
|
|
|
|
compiler.define=-DARDUINO=
|
2014-04-10 21:47:09 +02:00
|
|
|
|
2012-06-26 00:52:05 +02:00
|
|
|
# this can be overriden in boards.txt
|
|
|
|
build.extra_flags=
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2014-04-10 21:47:09 +02:00
|
|
|
# These can be overridden in platform.local.txt
|
|
|
|
compiler.c.extra_flags=
|
|
|
|
compiler.c.elf.extra_flags=
|
|
|
|
compiler.cpp.extra_flags=
|
2015-05-29 14:19:54 +02:00
|
|
|
compiler.S.extra_flags=
|
2014-04-10 21:47:09 +02:00
|
|
|
compiler.ar.extra_flags=
|
|
|
|
compiler.elf2hex.extra_flags=
|
|
|
|
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2012-05-25 11:47:22 +02:00
|
|
|
compiler.libsam.c.flags="-I{build.system.path}/libsam" "-I{build.system.path}/CMSIS/CMSIS/Include/" "-I{build.system.path}/CMSIS/Device/ATMEL/"
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2013-07-22 12:29:02 +02:00
|
|
|
# USB Flags
|
|
|
|
# ---------
|
2013-08-01 15:20:24 +02:00
|
|
|
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|
2013-07-22 12:29:02 +02:00
|
|
|
|
|
|
|
# Default usb manufacturer will be replaced at compile time using
|
2015-09-23 17:21:11 +02:00
|
|
|
# numeric vendor ID if available or by board's specific value.
|
2013-07-22 12:29:02 +02:00
|
|
|
build.usb_manufacturer="Unknown"
|
|
|
|
|
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
# SAM3 compile patterns
|
|
|
|
# ---------------------
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Compile c files
|
2014-04-10 21:47:09 +02:00
|
|
|
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={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} {compiler.libsam.c.flags} {includes} "{source_file}" -o "{object_file}"
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Compile c++ files
|
2014-04-10 21:47:09 +02:00
|
|
|
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={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} {compiler.libsam.c.flags} {includes} "{source_file}" -o "{object_file}"
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2015-05-29 14:19:54 +02:00
|
|
|
## Compile S files
|
|
|
|
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={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} {compiler.libsam.c.flags} {includes} "{source_file}" -o "{object_file}"
|
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Create archives
|
2014-04-10 21:47:09 +02:00
|
|
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2012-01-13 19:09:07 +01:00
|
|
|
## Combine gc-sections, archives, and objects
|
2015-09-24 01:32:03 +02:00
|
|
|
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group "{build.path}/core/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2015-02-16 14:06:20 +01:00
|
|
|
## Create output (.bin file)
|
2015-09-18 11:21:13 +02:00
|
|
|
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
|
2011-06-25 18:53:35 +02: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}.bin
|
|
|
|
recipe.output.save_file={build.project_name}.{build.variant}.bin
|
2015-01-23 04:00:46 +01:00
|
|
|
|
2012-02-13 17:58:30 +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"
|
2012-02-13 17:58:30 +01:00
|
|
|
recipe.size.regex=\.text\s+([0-9]+).*
|
2012-01-11 13:59:16 +01:00
|
|
|
|
2011-06-25 18:53:35 +02:00
|
|
|
|
2012-02-13 17:58:30 +01:00
|
|
|
# SAM3 Uploader tools
|
|
|
|
# -------------------
|
|
|
|
|
2015-09-23 17:21:11 +02:00
|
|
|
# BOSSA
|
2015-03-02 17:28:55 +01:00
|
|
|
tools.bossac.path={runtime.tools.bossac.path}
|
2012-02-13 17:58:30 +01:00
|
|
|
tools.bossac.cmd=bossac
|
2012-04-02 18:30:53 +02:00
|
|
|
tools.bossac.cmd.windows=bossac.exe
|
2012-02-13 17:58:30 +01:00
|
|
|
|
|
|
|
tools.bossac.upload.params.verbose=-i -d
|
|
|
|
tools.bossac.upload.params.quiet=
|
2015-09-18 11:21:13 +02:00
|
|
|
tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -e -w -v -b "{build.path}/{build.project_name}.bin" -R
|
2012-02-13 17:58:30 +01:00
|
|
|
|