SoT for Arduino

Arduino in VS Code, without the Arduino IDE. Compile, upload, serial monitor, board packages and libraries,
built on the official arduino-cli.
Everything the toolchain needs lives in one folder of your choice, the single source of truth.
Sync it, and every computer has the same setup.

Why SoT for Arduino
- One portable folder. arduino-cli, board packages, libraries and settings in one place, nothing in AppData or
Documents. A new computer only needs the folder.
- Many projects, one workspace. Board, port and options per project. The active project follows the file you
edit.
- Your projects keep working. Uses
.vscode/arduino.json, the project file of the former Arduino extension.
- Native and fast. Status bar, tree views and quick picks, no webviews, no dependencies. Starts from the last
known state and asks arduino-cli only when something changed.
- Shares packages with the Arduino IDE 2. Point the IDE at the SoT folder, and both use one copy of every
board package.
- English and German.
Quick start
- Open a folder with a sketch, or run Arduino: New Sketch.
- In the sidebar click Set Up SoT for Arduino and choose a folder. arduino-cli is downloaded, and the basic
setup is offered: Arduino AVR Boards and the standard libraries, about 150 MB. Install Basic Setup in either
view adds any missing parts later.
- Pick board and port in the status bar and upload with Ctrl+Alt+U.
Uninstall the Arduino Community extension (vscode-arduino) if it is installed. It uses the same shortcuts and
the same project file.
Features
Build and upload
- Compile Ctrl+Alt+R, upload Ctrl+Alt+U
(macOS ⌥⌘), upload using a programmer, burn the bootloader.
- Boards without a bootloader (ATtiny85 "No bootloader") upload with the programmer automatically, like the
Arduino IDE.
- Errors and warnings in the Problems view, clickable, also in
.ino files.
- Flash and RAM usage in the status bar, highlighted from 90 %.
- Long tasks show their last output line and the elapsed time, and can be cancelled.
Board and port
- Board, port, board options and programmer per project, in the status bar or the Project view.
- Plug in a board and the port shows up. A port that is not connected is marked.
IntelliSense
c_cpp_properties.json from the real compiler flags of the board, so the
C/C++ extension knows every include
path and define.
Serial monitor
- Input line at the bottom of the terminal, line ending and timestamp selectable.
- Pauses for an upload and comes back afterwards.
Board packages and libraries
- Search, install, update, choose another version, remove. Update All with one click.
- The list is there at once. The catalogs are checked for updates once a day in the background.
- Add a board source (additional URL) in an input field, no YAML editing.
Coming from the Arduino IDE
- Board sources of an installed Arduino IDE are taken over automatically.
- Import Board Packages / Libraries from Arduino IDE copies instead of downloading again
(IDE 2, IDE 1.8, Microsoft Store version).
- Let Arduino IDE Use the SoT Folder points the IDE 2 at the SoT folder. Its old data folder, often several GB,
can be deleted afterwards.
All commands are in the Command Palette under Arduino:.
Settings
| Setting |
Default |
Description |
arduinoSot.root |
|
The SoT folder. ~ and relative paths start in the home folder. |
arduinoSot.buildOutput |
normal |
detailed adds build steps and libraries, verbose shows everything. |
arduinoSot.newSketchFolder |
|
Empty: Name/Name.ino. code: Name/code/code.ino. |
arduinoSot.defaultBaudrate |
115200 |
Serial monitor, until one is chosen per project. |
arduinoSot.monitorLineEnding |
lf |
Sent with Enter: lf, crlf, cr, none. |
arduinoSot.monitorTimestamp |
false |
Time before every received line. |
arduinoSot.statusBar |
full |
compact: only board · port, compile and upload. |
arduinoSot.statusBarAlignment |
left |
right moves the entries to the right. |
arduinoSot.statusBarColor |
true |
Entries in Arduino teal (theme color arduinoSot.statusBarForeground). |
Project file
A project is a folder with .vscode/arduino.json. The extension writes board, port and options, the rest is
optional.
{
"sketch": "Blink.ino",
"board": "arduino:avr:nano",
"configuration": "cpu=atmega328old",
"port": "COM3",
"programmer": "arduinoasisp",
"output": "build",
"prebuild": "",
"postbuild": "",
"buildPreferences": [["build.extra_flags", "-DDEBUG"]]
}
prebuild and postbuild are shell commands around the build, buildPreferences are passed as --build-property.
The SoT folder
<SoT>/
arduino-cli.yaml board sources and other arduino-cli settings
cli/ arduino-cli
boards/ board packages, toolchains, catalogs
libraries/ your libraries
downloads/ download cache, safe to delete
arduino-cli.yaml contains no paths, so the folder can be moved or synced freely.
Good to know
- Installs the arduino-cli version it was tested with (currently 1.6.0). Arduino: Install/Update arduino-cli
also offers the latest version, marked as untested.
- Needs VS Code 1.90 or newer and an internet connection for the setup and for installing packages.
- No serial plotter, no debugger, no examples browser. How it compares with the Arduino IDE, PlatformIO and other
extensions: docs/comparison.md.
- Tested on Windows with AVR and ESP32 boards, ATtiny compiles. Linux, macOS and network (OTA) uploads are
untested. Board packages can only be imported from an Arduino IDE on the same operating system.
Contributing and license
Building, tests and code structure: contributing.md. Bugs and ideas:
issues.
MIT. SoT for Arduino is an independent project, not affiliated with or endorsed by Arduino.
"Arduino" is a trademark of Arduino SA.
| |