|
| 1 | + |
| 2 | +# Arduino SAM Core and platform. |
| 3 | +# ------------------------------ |
| 4 | +# |
| 5 | +# For more info: |
| 6 | +# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification |
| 7 | + |
| 8 | +name=Arduino ARM (32-bits) Boards |
| 9 | +version=1.6.9 |
| 10 | + |
| 11 | +# SAM3 compile variables |
| 12 | +# ---------------------- |
| 13 | + |
| 14 | +compiler.warning_flags=-w |
| 15 | +compiler.warning_flags.none=-w |
| 16 | +compiler.warning_flags.default= |
| 17 | +compiler.warning_flags.more=-Wall |
| 18 | +compiler.warning_flags.all=-Wall -Wextra |
| 19 | + |
| 20 | +compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ |
| 21 | +compiler.c.cmd=arm-none-eabi-gcc |
| 22 | +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 |
| 23 | +compiler.c.elf.cmd=arm-none-eabi-gcc |
| 24 | +compiler.c.elf.flags=-Os -Wl,--gc-sections |
| 25 | +compiler.S.cmd=arm-none-eabi-gcc |
| 26 | +compiler.S.flags=-c -g -x assembler-with-cpp |
| 27 | +compiler.cpp.cmd=arm-none-eabi-g++ |
| 28 | +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 |
| 29 | +compiler.ar.cmd=arm-none-eabi-ar |
| 30 | +compiler.ar.flags=rcs |
| 31 | +compiler.objcopy.cmd=arm-none-eabi-objcopy |
| 32 | +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 |
| 33 | +compiler.elf2hex.flags=-O binary |
| 34 | +compiler.elf2hex.cmd=arm-none-eabi-objcopy |
| 35 | +compiler.ldflags= |
| 36 | +compiler.size.cmd=arm-none-eabi-size |
| 37 | +compiler.define=-DARDUINO= |
| 38 | +compiler.combine.flags=-u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid |
| 39 | + |
| 40 | +# This can be overridden in boards.txt |
| 41 | +build.extra_flags= |
| 42 | + |
| 43 | +# These can be overridden in platform.local.txt |
| 44 | +compiler.c.extra_flags= |
| 45 | +compiler.c.elf.extra_flags= |
| 46 | +compiler.cpp.extra_flags= |
| 47 | +compiler.S.extra_flags= |
| 48 | +compiler.ar.extra_flags= |
| 49 | +compiler.elf2hex.extra_flags= |
| 50 | + |
| 51 | + |
| 52 | +compiler.libsam.c.flags="-I{build.system.path}/libsam" "-I{build.system.path}/CMSIS/CMSIS/Include/" "-I{build.system.path}/CMSIS/Device/ATMEL/" |
| 53 | + |
| 54 | +# USB Flags |
| 55 | +# --------- |
| 56 | +build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' |
| 57 | + |
| 58 | +# Default usb manufacturer will be replaced at compile time using |
| 59 | +# numeric vendor ID if available or by board's specific value. |
| 60 | +build.usb_manufacturer="Unknown" |
| 61 | + |
| 62 | + |
| 63 | +# SAM3 compile patterns |
| 64 | +# --------------------- |
| 65 | + |
| 66 | +## Compile c files |
| 67 | +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mcpu={build.mcu} -mthumb -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}" |
| 68 | + |
| 69 | +## Compile c++ files |
| 70 | +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mcpu={build.mcu} -mthumb -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}" |
| 71 | + |
| 72 | +## Compile S files |
| 73 | +recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={build.mcu} -mthumb -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}" |
| 74 | + |
| 75 | +## Create archives |
| 76 | +# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value |
| 77 | +archive_file_path={build.path}/{archive_file} |
| 78 | +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" |
| 79 | + |
| 80 | +## Combine gc-sections, archives, and objects |
| 81 | +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} "-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}" -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 {compiler.combine.flags} {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc |
| 82 | + |
| 83 | +## Create output (.bin file) |
| 84 | +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" |
| 85 | + |
| 86 | +## Save hex |
| 87 | +recipe.output.tmp_file={build.project_name}.bin |
| 88 | +recipe.output.save_file={build.project_name}.{build.variant}.bin |
| 89 | + |
| 90 | +## Compute size |
| 91 | +recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" |
| 92 | +recipe.size.regex=\.text\s+([0-9]+).* |
| 93 | + |
| 94 | + |
| 95 | +# SAM3 Uploader tools |
| 96 | +# ------------------- |
| 97 | + |
| 98 | +# BOSSA |
| 99 | +tools.bossac.path={runtime.tools.bossac.path} |
| 100 | +tools.bossac.cmd=bossac |
| 101 | +tools.bossac.cmd.windows=bossac.exe |
| 102 | + |
| 103 | +tools.bossac.upload.params.verbose=-i -d |
| 104 | +tools.bossac.upload.params.quiet= |
| 105 | +tools.bossac.upload.params.verify=-v |
| 106 | +tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -e -w {upload.verify} -b "{build.path}/{build.project_name}.bin" -R |
| 107 | + |
| 108 | +tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v -b /tmp/sketch.bin -R |
0 commit comments