Arduino Platform specification
Ref: https://arduino.github.io/arduino-cli/platform-specification/
Hardware directory structure
Arduino
βββ hardware
βββ vendor/
βββ architecture/
βββ boards.txt
βββ cores/
βΒ Β βββ core_1/
βΒ Β βΒ Β βββ abi.cpp
βΒ Β βΒ Β βββ Arduino.h
βΒ Β βΒ Β βββ binary.h
βΒ Β βΒ Β βββ HardwareSerial.cpp
βΒ Β βΒ Β βββ HardwareSerial.h
β β βββ main.cpp
βΒ Β βΒ Β βββ ...
βΒ Β βββ core_2/
β βββ ...
βββ libraries/
βΒ Β βββ SPI/
βΒ Β βΒ Β βββ examples/
βΒ Β βΒ Β βββ keywords.txt
βΒ Β βΒ Β βββ library.properties
βΒ Β βΒ Β βββ src/
βΒ Β βΒ Β βββ SPI.cpp
βΒ Β βΒ Β βββ SPI.h
β βββ Wire/
βΒ Β βββ ...
βββ platform.txt
βββ programmers.txt
βββ variants/
βββ board_1/
βΒ Β βββ pins_arduino.h
βββ board_2/
βββ ...
boards.txt
boards.txt
######
# MENU
######
# λ©λ΄ μ΄λ¦
menu.menu_1=
#########
# board_1
#########
# IDE -> Tools -> Board μ νμλλ 보λ μ΄λ¦
board_1.name=
# hardware/vendor/architecture/cores μμ μ νν core μ΄λ¦
board_1.build.core=
# hardware/vendor/architecture/variants μμ μ νν variant μ΄λ¦
board_1.build.variant=
# μ»΄νμΌ μ μ μλ λ§€ν¬λ‘ -DARDUINO_{build.board} (platform.txt)
board_1.build.board=
# μ
λ‘λμ μ¬μ©ν ν΄ (platform.txt)
board_1.upload.tool=
# platform.txtμμ μ¬μ©ν λ³μ
# board_1.xxxx= (boards.txt) -> {xxxx} (platform.txt)
board_1.build.extra_flags=
board_1.compiler.cross_compile=
# λ©λ΄ μ νμ§
board_1.menu.menu_1.option_1=
# λ©λ΄ μ νμ§μ ν΄λΉνλ μ€μ
# board_1.menu.menu_1.option_1.variable_1= (boards.txt) -> {variable_1} (platform.txt)
board_1.menu.menu_1.option_1.variable_1=
#########
# board_2
#########
...
platform.txt
platform.txt
# IDE -> Tools -> Board μ νμλλ μΉ΄ν
κ³ λ¦¬
name=
###################
# compile variables
###################
compiler.path=
compiler.S.cmd=
compiler.S.flags=
compiler.c.cmd=
compiler.c.flags=
compiler.cpp.cmd=
compiler.cpp.flags=
compiler.ar.cmd=
compiler.ar.flags=
compiler.combine.cmd=
compiler.combine.flags=
compiler.xxx.cmd=
compiler.xxx.flags=
# override
# platform.local.txt, boards.txt λ±μ μν΄ λ°λλ λ³μ
build.extra_flags=
compiler.cross_compile=
compiler.S.extra_flags=
compiler.c.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.combine.extra_flags=
compiler.xxx.extra_flags=
##################
# compile patterns
##################
# λΌμ΄λΈλ¬λ¦¬ κ°μ§, ν¨μ νλ‘ν νμ
μμ±
recipe.preproc.macros="{compiler.path}{compiler.cross_compile}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -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}"
preproc.macros.flags= -w -x c++ -E -CC
# NUMBERλ 1 ~ 9 λλ 01 ~ 99 μμλλ‘ μ€ν λ¨
# recipe.hooks.sketch.prebuild.NUMBER.pattern=
# recipe.hooks.sketch.postbuild.NUMBER.pattern=
# recipe.hooks.libraries.prebuild.NUMBER.pattern=
# recipe.hooks.libraries.postbuild.NUMBER.pattern=
# recipe.hooks.core.prebuild.NUMBER.pattern=
# recipe.hooks.core.postbuild.NUMBER.pattern=
# recipe.hooks.linking.prelink.NUMBER.pattern=
# recipe.hooks.linking.postlink.NUMBER.pattern=
# recipe.hooks.objcopy.preobjcopy.NUMBER.pattern=
# recipe.hooks.objcopy.postobjcopy.NUMBER.pattern=
# recipe.hooks.savehex.presavehex.NUMBER.pattern=
# recipe.hooks.savehex.postsavehex.NUMBER.pattern=
# Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.cross_compile}{compiler.S.cmd}" {compiler.S.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
# Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.cross_compile}{compiler.c.cmd}" {compiler.c.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
# Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cross_compile}{compiler.cpp.cmd}" {compiler.cpp.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
# Archives
recipe.ar.pattern="{compiler.path}{compiler.cross_compile}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
# Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.cross_compile}{compiler.combine.cmd}" {compiler.combine.flags} {compiler.combine.extra_flags} -o "{build.path}/{build.project_name}.out" {object_files} {archive_file_path} "-L{build.path}"
# IDE-> Sketch -> Export compiled Binary
recipe.output.tmp_file={build.project_name}.out
recipe.output.save_file={build.project_name}.{build.variant}.out
#######
# tools
#######
tools.tool_1.path=
tools.tool_1.cmd=
# ν΄ patternμμ λ³μ μ¬μ© μ tools.tool_1., params. λ λΉΌκ³ μ¬μ©
# ex) {upload.verbose}
tools.tool_1.program.params.verbose=
tools.tool_1.program.params.quiet=
tools.tool_1.program.pattern=
tools.tool_1.upload.pattern=
tools.tool_1.erase.pattern=
tools.tool_1.bootloader.pattern=
programmers.txt
programmers.txt
##############
# programmer_1
##############
# IDE -> Tools -> Programmer μ νμλλ νλ‘κ·Έλλ¨Έ μ΄λ¦
programmer_1.name=Programmer 1
# μ
λ‘λμ μ¬μ©ν ν΄ (platform.txt)
programmer_1.program.tool=
programmer_1.program.extra_params=