| 1 |
|
| 2 |
# Arduino AVR Core and platform. |
| 3 |
# ------------------------------ |
| 4 |
# |
| 5 |
# For more info: |
| 6 |
# https://arduino.github.io/arduino-cli/latest/platform-specification/ |
| 7 |
|
| 8 |
name=Arduino AVR Boards |
| 9 |
version=1.8.7 |
| 10 |
|
| 11 |
# AVR 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 |
# Default "compiler.path" is correct, change only if you want to override the initial value |
| 21 |
compiler.path={runtime.tools.avr-gcc.path}/bin/ |
| 22 |
compiler.c.cmd=avr-gcc |
| 23 |
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects |
| 24 |
compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections |
| 25 |
compiler.c.elf.cmd=avr-gcc |
| 26 |
compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD |
| 27 |
compiler.cpp.cmd=avr-g++ |
| 28 |
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto |
| 29 |
compiler.ar.cmd=avr-gcc-ar |
| 30 |
compiler.ar.flags=rcs |
| 31 |
compiler.objcopy.cmd=avr-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 ihex -R .eeprom |
| 34 |
compiler.elf2hex.cmd=avr-objcopy |
| 35 |
compiler.ldflags= |
| 36 |
compiler.libraries.ldflags= |
| 37 |
compiler.size.cmd=avr-size |
| 38 |
|
| 39 |
# This can be overridden in boards.txt |
| 40 |
build.extra_flags= |
| 41 |
|
| 42 |
# These can be overridden in platform.local.txt |
| 43 |
compiler.c.extra_flags= |
| 44 |
compiler.c.elf.extra_flags= |
| 45 |
compiler.S.extra_flags= |
| 46 |
compiler.cpp.extra_flags= |
| 47 |
compiler.ar.extra_flags= |
| 48 |
compiler.objcopy.eep.extra_flags= |
| 49 |
compiler.elf2hex.extra_flags= |
| 50 |
|
| 51 |
# AVR compile patterns |
| 52 |
# -------------------- |
| 53 |
|
| 54 |
## Compile c files |
| 55 |
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}" |
| 56 |
|
| 57 |
## Compile c++ files |
| 58 |
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}" |
| 59 |
|
| 60 |
## Compile S files |
| 61 |
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}" |
| 62 |
|
| 63 |
## Create archives |
| 64 |
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value |
| 65 |
archive_file_path={build.path}/{archive_file} |
| 66 |
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" |
| 67 |
|
| 68 |
## Combine gc-sections, archives, and objects |
| 69 |
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm |
| 70 |
|
| 71 |
## Create output files (.eep and .hex) |
| 72 |
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" |
| 73 |
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" |
| 74 |
|
| 75 |
## Save hex |
| 76 |
recipe.output.tmp_file={build.project_name}.hex |
| 77 |
recipe.output.save_file={build.project_name}.{build.variant}.hex |
| 78 |
|
| 79 |
## Compute size |
| 80 |
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" |
| 81 |
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* |
| 82 |
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* |
| 83 |
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* |
| 84 |
|
| 85 |
## Preprocessor |
| 86 |
preproc.includes.flags=-w -x c++ -M -MG -MP |
| 87 |
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}" |
| 88 |
|
| 89 |
preproc.macros.flags=-w -x c++ -E -CC |
| 90 |
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}" |
| 91 |
|
| 92 |
# Required discoveries and monitors |
| 93 |
# --------------------------------- |
| 94 |
pluggable_discovery.required.0=builtin:serial-discovery |
| 95 |
pluggable_discovery.required.1=builtin:mdns-discovery |
| 96 |
pluggable_monitor.required.serial=builtin:serial-monitor |
| 97 |
|
| 98 |
# AVR Uploader/Programmers tools |
| 99 |
# ------------------------------ |
| 100 |
|
| 101 |
tools.avrdude.path={runtime.tools.avrdude.path} |
| 102 |
tools.avrdude.cmd.path={path}/bin/avrdude |
| 103 |
tools.avrdude.config.path={path}/etc/avrdude.conf |
| 104 |
|
| 105 |
tools.avrdude.upload.params.verbose=-v |
| 106 |
tools.avrdude.upload.params.quiet=-q -q |
| 107 |
# tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value |
| 108 |
tools.avrdude.upload.verify= |
| 109 |
tools.avrdude.upload.params.noverify=-V |
| 110 |
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} "-P{serial.port}" -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" |
| 111 |
|
| 112 |
tools.avrdude.program.params.verbose=-v |
| 113 |
tools.avrdude.program.params.quiet=-q -q |
| 114 |
# tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value |
| 115 |
tools.avrdude.program.verify= |
| 116 |
tools.avrdude.program.params.noverify=-V |
| 117 |
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" |
| 118 |
|
| 119 |
tools.avrdude.erase.params.verbose=-v |
| 120 |
tools.avrdude.erase.params.quiet=-q -q |
| 121 |
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 |
| 122 |
|
| 123 |
tools.avrdude.bootloader.params.verbose=-v |
| 124 |
tools.avrdude.bootloader.params.quiet=-q -q |
| 125 |
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 |
| 126 |
|
| 127 |
tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} |
| 128 |
|
| 129 |
# The following rule is deprecated by pluggable discovery. |
| 130 |
# We keep it to avoid breaking compatibility with the Arduino Java IDE. |
| 131 |
tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA |
| 132 |
tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} |
| 133 |
|
| 134 |
# arduino ota |
| 135 |
tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA |
| 136 |
tools.arduino_ota.upload.pattern="{cmd}" -address {upload.port.address} -port {upload.port.properties.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.port.properties.endpoint_upload} -sync {upload.port.properties.endpoint_sync} -reset {upload.port.properties.endpoint_reset} -sync_exp {upload.port.properties.sync_return} |
| 137 |
|
| 138 |
# USB Default Flags |
| 139 |
# Default blank usb manufacturer will be filled in at compile time |
| 140 |
# - from numeric vendor ID, set to Unknown otherwise |
| 141 |
build.usb_manufacturer="Unknown" |
| 142 |
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' |