Breakpoint debugging for the Arduino Uno, Nano, Leonardo and many more AVR boards in the Arduino IDE 2.x, with the IDE's own debug button and no extra hardware, just the normal USB cable. Also available as an extension for VS Code, see ArduDebug for VS Code. Based on Arduino AVR Boards V1.8.8.
π What's new?
- 14.11.2026 Release V1.8.8-5: Serial Monitor and Serial Plotter keep working while you debug, and debug builds are readable in the Serial Monitor without a debug session.
-- More news? Check the newsblog.
All boards of Arduino AVR Boards can be selected under Tools β Board β ArduDebug AVR Boards (except Gemma: its ATtiny85 has no serial connection to the computer). Only some of them have been tested so far:
| Board | Chip | Status |
|---|---|---|
| Arduino Uno | ATmega328P | tested |
| Arduino Nano | ATmega328P | tested |
| Arduino Leonardo | ATmega32U4 | tested |
| Micro, Esplora, YΓΊn, LilyPad USB and other ATmega32U4 boards | ATmega32U4 | untested |
| Mini, Pro, Ethernet, Fio, BT, LilyPad and other ATmega328P/168 boards | ATmega328P/168 | untested |
| Arduino NG or older | ATmega8/168 | untested |
| Arduino Mega 2560, Mega ADK | ATmega2560 | untested |
| Arduino Mega with ATmega1280 (Tools β Processor) | ATmega1280 | untested |
ArduDebug is tested on Linux and Windows with the Uno, the Nano and the Leonardo, in the Arduino IDE and in VS Code. Help is welcome for:
- macOS (Apple Silicon and Intel): the package includes macOS builds, but they have never been tried.
- Mega 2560 and other untested boards from the list above.
If you can test one of these, please open an issue and tell me what happened, whether it works or not.
- avr8-stub (by Jan Dolinay) runs on the board and speaks the GDB protocol over the serial line, on the Leonardo and other ATmega32U4 boards directly over USB.
- The stub is built into the core and only included when Sketch β Optimize for Debugging is enabled. Your sketch needs no debug code.
- A small bridge program, started by the IDE, finds the board automatically and connects GDB to it.
- ArduDebug brings its own Serial Monitor. Without a debug session it works like the IDE's own one; during a debug session it shows the output of your sketch that the bridge passes on.
Pause stops at the line of your sketch the program is working on. The marked line is always the next line to run. Most of the time a sketch waits in delay(): then the wait ends at once, and you see the line after the delay(). The Arduino core (main.cpp, wiring.c and so on) is never shown.
During a debug session the serial port belongs to the debugger. Your sketch can still use Serial as usual: the Serial Monitor keeps showing the output, and what you type there arrives in Serial.read(). While the Serial Monitor is closed, the output appears in the gdb-server tab at the bottom of the IDE instead, and you can type there too (followed by Enter). In VS Code the output appears in the Debug Console; input to Serial.read() is not available there.
- Each line you type ends with a newline (
\n). - Input typed while the program is stopped is delivered as soon as it continues.
- The receive buffer holds 63 characters, like the normal
Serial. - During a debug session the baud rate in
Serial.begin()is ignored. - Without a debug session, a debug build behaves like a normal build: the Serial Monitor shows the output at the baud rate of
Serial.begin(). So you can leave a debug build on the board.
While the program is stopped, the Cortex Peripherals section of the debug sidebar shows the hardware registers of the chip (ATmega328P, ATmega32U4 or ATmega2560): ports, timers, ADC, SPI, TWI, EEPROM, external interrupts and more, with every bit named. You can also change them: set PORTB to 0x20 (Uno) or PORTC to 0x80 (Leonardo) and the LED on pin 13 lights up, while the program is still stopped.
USART0is read-only on Uno and Mega: it is the connection to the debugger.- Data registers like
UDR0andSPDRare not shown, because reading them changes the hardware state. The USB registers of the ATmega32U4 are not shown either.
Agentuino brings agentic coding into the Arduino IDE and VS Code, and its agent uses ArduDebug: it stops your sketch on the board at a line, reads the variables and finds the bug, without adding a single Serial.println(). It asks before it uploads a debug build and brings the normal sketch back when the bug is fixed. While debugging it also reads the Serial output and can send input to Serial.read(). In the Arduino IDE, install ArduDebug as described below; in VS Code, ArduDebug comes along with Agentuino from the Marketplace and sets up its board package itself.
Agents on the command line, like Claude Code or Codex, can use the debugger too. The bridge in the board package has two commands for them:
ardudebug-bridge run --break sketch.ino:25 --print counter,line --locals
ardudebug-bridge serial --seconds 10 --send hello
run stops the sketch at a line (or with --pause wherever it is), prints the values and lets the program run on. serial reads the Serial output for a fixed time and can send input to Serial.read(). Both need nothing but the board package; run also needs arduino-cli, from the PATH or the one inside the Arduino IDE. ardudebug-bridge run --help lists all options.
For Claude Code, copy the folder skills/ardudebug to ~/.claude/skills/. The skill tells the agent where the bridge is, how to use it and that it must ask before it uploads anything.
- Arduino IDE 2.3 or newer (Linux or Windows), or VS Code with the ArduDebug extension (see below)
- A supported board and a USB cable β nothing else
- Open File β Preferences.
- Add this URL to Additional boards manager URLs (one URL per line if there are already others):
https://raw.githubusercontent.com/NikolaiRadke/ArduDebug/main/package_ardudebug_index.json
- Open Tools β Board β Boards Manager, search for ArduDebug and click Install. ArduDebug brings everything it needs, including its own GDB.
- Select Tools β Board β ArduDebug AVR Boards β Arduino Uno (or your board) and the port.
- Open the Blink example and enable Sketch β Optimize for Debugging (important!).
- Upload the sketch.
- Click left of a line number in
loop()to set a breakpoint (red dot). - Click the debug button. The program stops at the start of
loop(); press Continue (F5) to run to your breakpoint.
Tip
- Global variables are easiest to inspect in the Watch view: click + and enter the variable name.
- Debug builds are always made without LTO, whatever Tools β LTO says, so all your variables are visible. The LTO setting only applies to normal uploads.
- The Serial Monitor can stay open while you debug. Stop the debug session before uploading.
The extension brings everything it needs: the board package, the Arduino CLI and the debugger. You don't need the Arduino IDE.
- Install ArduDebug from the VS Code Marketplace, or download the file for your system from the releases and install it via Extensions β β¦ β Install from VSIX.
- Open a sketch (
.inofile), set a breakpoint and press F5.
Verify, Upload, Serial Monitor and the board, port and baud rate settings are in the ArduDebug menu (circuit board icon) at the top right of the editor. More in the extension's README.
Version numbers follow the core ArduDebug is based on: 1.8.8-X is built on Arduino AVR Boards 1.8.8, X counts the ArduDebug releases.
Updates appear in the Boards Manager. If a new version doesn't show up, the IDE is still using a cached package list: delete package_ardudebug_index.json in your Arduino15 folder and restart the IDE.
- Linux:
~/.arduino15 - Windows:
%LOCALAPPDATA%\Arduino15
- "Port β¦ busy" or "Access denied": another program is using the port, e.g. a terminal program. On Windows, also check the Task Manager (Details) for a leftover
ardudebug-bridge.exeand end it. - Upload fails during debugging: stop the debug session first, then upload.
- "The program on the board does not match this sketch": the board runs another program than the one you debug, e.g. because the sketch was changed after the upload or uploaded to another port. Upload it again with Optimize for Debugging enabled and check the selected port.
- Breakpoints are hollow grey circles: either the debug session isn't running properly (see above), or breakpoints are deactivated β click Activate Breakpoints in the Breakpoints view.
- Linux: no access to the port: add your user to the
dialoutgroup (sudo usermod -aG dialout $USER) and log in again. - Reporting a problem: please attach
ardudebug-bridge.logfrom your temp folder (Linux/macOS:/tmp, Windows:%TEMP%). It records the communication of the last debug session.
- The stub needs about 3 KB of flash and up to about 270 bytes of RAM in debug builds. Normal builds are unaffected. On boards with an ATmega168 (16 KB flash, 1 KB RAM) this leaves less room for the sketch.
- In debug builds, some pins belong to the debugger:
- Uno, Nano and other ATmega328P/168 boards: pins 0 and 1 (serial) and pin 2 (INT0).
attachInterrupt()works on pin 3, but not on pin 2. - Leonardo and other ATmega32U4 boards: pin 7 (INT6).
Serial1on pins 0 and 1 is free. - Mega: pins 0 and 1 (serial). The debugger uses INT6, which has no pin on the Mega.
- Uno, Nano and other ATmega328P/168 boards: pins 0 and 1 (serial) and pin 2 (INT0).
- Up to 8 breakpoints at a time.
- While breakpoints are set, the program runs much slower: the debugger checks the position after every instruction. Timing-critical code may behave differently.
- Breakpoints inside interrupt routines, e.g. a function attached with
attachInterrupt(), are never hit: while an interrupt routine runs, the debugger cannot stop the program. - No watchpoints (stopping when a variable changes).
- While the program is stopped or single-stepping, interrupts do not run: millis() does not count on, and Servo pulses or tone() stop. Hardware PWM (analogWrite) keeps running.
- Local variables are often shown as optimized out, because debug builds are still optimized for size.
- A step over the last line of
loop()takes you back to the start ofloop(). Step Out ofloop(), however, leads into the core'smain.cppin the Arduino IDE (VS Code handles this and returns to the start ofloop()). - Pause ends a running
delay()early. If you continue afterwards, that one wait is shorter. - Sketches with their own
main()instead ofsetup()/loop()can be debugged as long as they callinit(). After clicking the debug button, the program stops insideinit(); press Continue (F5) to run to your breakpoint. Pause stops wherever the program is. - When the debug session starts or you click Restart, the board is reset and your sketch starts from the beginning. When the session ends, the board is reset again and the sketch runs normally. Without a debug session, a debug build runs normally.
| Folder | Content |
|---|---|
core/avr |
The board core, based on Arduino AVR Boards 1.8.8, with avr8-stub |
bridge |
Source of the bridge and the Serial Monitor (Go) |
skills |
Skill for Claude Code and other AI agents |
tests/sim |
Simulator test of the stub (simavr), runs on every push |
scripts |
Build script for the Boards Manager package |
- Agentuino β agentic coding for Arduino beginners; its agent debugs with ArduDebug
- AI.duino β AI support for the Arduino IDE with many providers
- The release packages contain binaries of avr-gdb (GNU GDB 17.2, GPL-3.0-or-later):
- Linux and macOS: built from the GNU GDB sources with statically linked GMP and MPFR (LGPL), see
.github/workflows/gdb.yml. - Windows: from the AVR-GCC builds by Zak Kemble (16.1.0).
- Linux and macOS: built from the GNU GDB sources with statically linked GMP and MPFR (LGPL), see
- ATmega328P.svd, ATmega32U4.svd and ATmega2560.svd are generated from Microchipβs device files (ATDF, Apache-2.0).
- avr8-stub / avr_debug by Jan Dolinay
- Arduino AVR Boards by Arduino
- go.bug.st/serial by Cristian Maglie (BSD-3-Clause)
ArduDebug is free and open source. If it saved your day, consider buying me a coffee! β
Every contribution helps keep this project alive! π

