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=
Last updated on