platform (1).txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # Arduino AVR Core and platform.
  2. # ------------------------------
  3. #
  4. # For more info:
  5. # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
  6. name=Arduino AVR Boards
  7. version=1.6.16
  8. # AVR compile variables
  9. # ---------------------
  10. compiler.warning_flags=-w
  11. compiler.warning_flags.none=-w
  12. compiler.warning_flags.default=
  13. compiler.warning_flags.more=-Wall
  14. compiler.warning_flags.all=-Wall -Wextra
  15. # Default "compiler.path" is correct, change only if you want to override the initial value
  16. compiler.path={runtime.tools.avr-gcc.path}/bin/
  17. compiler.c.cmd=avr-gcc
  18. compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects
  19. compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections
  20. compiler.c.elf.cmd=avr-gcc
  21. compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD
  22. compiler.cpp.cmd=avr-g++
  23. compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto
  24. compiler.ar.cmd=avr-gcc-ar
  25. compiler.ar.flags=rcs
  26. compiler.objcopy.cmd=avr-objcopy
  27. compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
  28. compiler.elf2hex.flags=-O ihex -R .eeprom
  29. compiler.elf2hex.cmd=avr-objcopy
  30. compiler.ldflags=
  31. compiler.size.cmd=avr-size
  32. # This can be overridden in boards.txt
  33. build.extra_flags=
  34. # These can be overridden in platform.local.txt
  35. compiler.c.extra_flags=
  36. compiler.c.elf.extra_flags=
  37. compiler.S.extra_flags=
  38. compiler.cpp.extra_flags=
  39. compiler.ar.extra_flags=
  40. compiler.objcopy.eep.extra_flags=
  41. compiler.elf2hex.extra_flags=
  42. # AVR compile patterns
  43. # --------------------
  44. ## Compile c files
  45. 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}"
  46. ## Compile c++ files
  47. 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}"
  48. ## Compile S files
  49. 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}"
  50. ## Create archives
  51. # archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
  52. archive_file_path={build.path}/{archive_file}
  53. recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
  54. ## Combine gc-sections, archives, and objects
  55. 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
  56. ## Create output files (.eep and .hex)
  57. 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"
  58. 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"
  59. ## Save hex
  60. recipe.output.tmp_file={build.project_name}.hex
  61. recipe.output.save_file={build.project_name}.{build.variant}.hex
  62. ## Compute size
  63. recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
  64. recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
  65. recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
  66. recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
  67. ## Preprocessor
  68. preproc.includes.flags=-w -x c++ -M -MG -MP
  69. 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}"
  70. preproc.macros.flags=-w -x c++ -E -CC
  71. 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}"
  72. # AVR Uploader/Programmers tools
  73. # ------------------------------
  74. tools.avrdude.path={runtime.tools.avrdude.path}
  75. tools.avrdude.cmd.path={path}/bin/avrdude
  76. tools.avrdude.config.path={path}/etc/avrdude.conf
  77. tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
  78. tools.avrdude.upload.params.verbose=-v
  79. tools.avrdude.upload.params.quiet=-q -q
  80. # 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
  81. tools.avrdude.upload.verify=
  82. tools.avrdude.upload.params.noverify=-V
  83. 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"
  84. tools.avrdude.program.params.verbose=-v
  85. tools.avrdude.program.params.quiet=-q -q
  86. # 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
  87. tools.avrdude.program.verify=
  88. tools.avrdude.program.params.noverify=-V
  89. 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"
  90. tools.avrdude.erase.params.verbose=-v
  91. tools.avrdude.erase.params.quiet=-q -q
  92. 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
  93. tools.avrdude.bootloader.params.verbose=-v
  94. tools.avrdude.bootloader.params.quiet=-q -q
  95. 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
  96. tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu}
  97. 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}
  98. # USB Default Flags
  99. # Default blank usb manufacturer will be filled in at compile time
  100. # - from numeric vendor ID, set to Unknown otherwise
  101. build.usb_manufacturer="Unknown"
  102. build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'