|
| 1 | + |
| 2 | +# Watterott AVR 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=Watterott AVR Boards |
| 9 | +version=1.0.0 |
| 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 overidde the initial value |
| 21 | +#compiler.path={runtime.ide.path}/hardware/tools/avr/bin/ |
| 22 | +compiler.path={runtime.tools.avr-gcc.path}/bin/ |
| 23 | +compiler.c.cmd=avr-gcc |
| 24 | +compiler.c.flags=-c -g -Os {compiler.warning_flags} -ffunction-sections -fdata-sections -MMD |
| 25 | +# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396 |
| 26 | +# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain |
| 27 | +compiler.c.elf.flags=-Os {compiler.warning_flags} -Wl,--gc-sections |
| 28 | +compiler.c.elf.cmd=avr-gcc |
| 29 | +compiler.S.flags=-c -g -x assembler-with-cpp |
| 30 | +compiler.cpp.cmd=avr-g++ |
| 31 | +compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD |
| 32 | +compiler.ar.cmd=avr-ar |
| 33 | +compiler.ar.flags=rcs |
| 34 | +compiler.objcopy.cmd=avr-objcopy |
| 35 | +compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 |
| 36 | +compiler.elf2hex.flags=-O ihex -R .eeprom |
| 37 | +compiler.elf2hex.cmd=avr-objcopy |
| 38 | +compiler.ldflags= |
| 39 | +compiler.size.cmd=avr-size |
| 40 | + |
| 41 | +# This can be overriden in boards.txt |
| 42 | +build.extra_flags= |
| 43 | + |
| 44 | +# These can be overridden in platform.local.txt |
| 45 | +compiler.c.extra_flags= |
| 46 | +compiler.c.elf.extra_flags= |
| 47 | +compiler.S.extra_flags= |
| 48 | +compiler.cpp.extra_flags= |
| 49 | +compiler.ar.extra_flags= |
| 50 | +compiler.objcopy.eep.extra_flags= |
| 51 | +compiler.elf2hex.extra_flags= |
| 52 | + |
| 53 | +# AVR compile patterns |
| 54 | +# -------------------- |
| 55 | + |
| 56 | +## Compile c files |
| 57 | +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}" |
| 58 | + |
| 59 | +## Compile c++ files |
| 60 | +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}" |
| 61 | + |
| 62 | +## Compile S files |
| 63 | +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}" |
| 64 | + |
| 65 | +## Create archives |
| 66 | +recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{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} -o "{build.path}/{build.project_name}.elf" {object_files} "{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 | +preproc.macros.flags=-w -x c++ -E -CC |
| 89 | +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}" |
| 90 | + |
| 91 | + |
| 92 | +# AVR Uploader/Programmers tools |
| 93 | +# ------------------------------ |
| 94 | + |
| 95 | +## AVRdude |
| 96 | +#tools.avrdude.path={runtime.ide.path}/hardware/tools/avr/ |
| 97 | +tools.avrdude.path={runtime.tools.avrdude.path} |
| 98 | +tools.avrdude.cmd.path={path}/bin/avrdude |
| 99 | +#tools.avrdude.config.path={path}/etc/avrdude.conf |
| 100 | +tools.avrdude.config.path={runtime.platform.path}/tools/avrdude.conf |
| 101 | + |
| 102 | +tools.avrdude.upload.params.verbose=-v |
| 103 | +tools.avrdude.upload.params.quiet=-q -q |
| 104 | +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" |
| 105 | + |
| 106 | +tools.avrdude.program.params.verbose=-v |
| 107 | +tools.avrdude.program.params.quiet=-q -q |
| 108 | +tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} -P{serial.port} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" |
| 109 | + |
| 110 | +tools.avrdude.erase.params.verbose=-v |
| 111 | +tools.avrdude.erase.params.quiet=-q -q |
| 112 | +tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} -P{serial.port} {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 |
| 113 | + |
| 114 | +tools.avrdude.bootloader.params.verbose=-v |
| 115 | +tools.avrdude.bootloader.params.quiet=-q -q |
| 116 | +tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} -P{serial.port} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m |
| 117 | + |
| 118 | +## Micronucleus |
| 119 | +tools.micronucleus.path={runtime.tools.micronucleus.path} |
| 120 | +tools.micronucleus.cmd=micronucleus |
| 121 | +tools.micronucleus.cmd.windows=micronucleus.exe |
| 122 | + |
| 123 | +tools.micronucleus.upload.params.verbose= |
| 124 | +tools.micronucleus.upload.params.quiet= |
| 125 | +tools.micronucleus.upload.pattern="{path}/{cmd}" --run --timeout 60 "{build.path}/{build.project_name}.hex" |
| 126 | + |
| 127 | +tools.micronucleus.program.params.verbose= |
| 128 | +tools.micronucleus.program.params.quiet= |
| 129 | +tools.micronucleus.program.pattern="{path}/{cmd}" --run --timeout 60 "{build.path}/{build.project_name}.hex" |
| 130 | + |
| 131 | +tools.micronucleus.erase.params.verbose= |
| 132 | +tools.micronucleus.erase.params.quiet= |
| 133 | +tools.micronucleus.erase.pattern= |
| 134 | +#tools.micronucleus.erase.pattern="{path}/{cmd}" --erase-only --timeout 60 |
| 135 | + |
| 136 | +tools.micronucleus.bootloader.params.verbose= |
| 137 | +tools.micronucleus.bootloader.params.quiet= |
| 138 | +tools.micronucleus.bootloader.pattern="{path}/{cmd}" --run --timeout 60 "{runtime.platform.path}/bootloaders/{bootloader.file}" |
| 139 | + |
| 140 | + |
| 141 | +# USB Default Flags |
| 142 | +# Default blank usb manufacturer will be filled it at compile time |
| 143 | +# - from numeric vendor ID, set to Unknown otherwise |
| 144 | +build.usb_manufacturer="Unknown" |
| 145 | +build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' |
| 146 | + |
0 commit comments