arduino-builder
Compile Arduino sketches for various boards
TLDR
Compile a sketch
Specify the debug level (default: 5)
Specify a custom build directory
Use a build option file, instead of specifying -hardware, -tools, etc. manually every time
Enable verbose mode
SYNOPSIS
arduino-builder [options]
PARAMETERS
-fqbn=
Fully qualified board name (e.g., arduino:avr:uno).
-hardware=
Path to the hardware definition directory.
-tools=
Path to the tools definition directory.
-libraries=
Path to the libraries directory.
-build-path=
Path to the build directory.
-build-cache=
Path to the build cache directory.
-prefs=
Set a preference (e.g., compiler.warning_level=all).
-verbose
Enable verbose output.
-verify
Verify the sketch after compilation.
DESCRIPTION
The `arduino-builder` command is a crucial component of the Arduino development environment. It's a command-line tool responsible for compiling and building Arduino sketches (source code). It takes an Arduino sketch as input, preprocesses the code, compiles it using the appropriate compiler for the target Arduino board, links the compiled code with necessary libraries, and generates a final executable file (usually a `.hex` file) suitable for uploading to the Arduino board. The builder handles dependencies automatically, incorporates libraries included in the sketch, and applies compiler flags specific to the chosen board and configuration. It simplifies the build process and hides the complexity of the underlying compilation toolchain. This allows developers to focus on writing code rather than managing build configurations. It plays a crucial role in converting human-readable Arduino code into machine-executable instructions for the microcontroller.
CAVEATS
Incorrectly configured paths for hardware, tools, or libraries can lead to build failures. The build path must be writable. The FQBN is board and core dependent and must be correct or you'll get cryptic build errors. Make sure the correct board is installed in the Arduino IDE board manager to know what boards are available.
BOARD FQBN
The Fully Qualified Board Name (FQBN) specifies the board architecture. It is a string that uniquely identifies a specific board type and its associated architecture and core. The format is generally `