PyAvrOCD
PyAvrOCD1 is a Python GDB server2 for 8-bit AVR MCUs (currently only classic ATtinys and ATmegas), enabling you to debug programs running on these MCUs using the GNU Project Debugger GDB. PyAvrOCD communicates with Microchip's debug probes, such as Atmel-ICE and MPLAB Snap, using the software infrastructure provided by pymcuprog and pyedgblib. In addition, it provides a pass-through service for the UNO-based debug probe dw-link and the simulation tool simavr.
Why another open-source GDB server for AVR MCUs (others are AVaRICE and Bloom)? The main intention is to provide a cross-platform AVR GDB server. In other words, it is the missing AVR debugging solution for Arduino IDE 2 and PlatformIO. In particular, the integration with the Arduino IDE 2 is pretty tight, allowing one to start debugging without much hassle (see quickstart guides).

In addition to being cross-platform, PyAvrOCD offers some enhancements over its "competitors", particularly in terms of flash wear and single-stepping.
After installing the package, the following steps are necessary for successful debugging:
- Installing and configuring the appropriate debugging software
- Preparing the target board for debugging
- Setting the right fuses
- Connecting the debug probe to the target
- Invoking the GDB server
- Debugging a program on the target
- Restoring the target board to its original state
Once you have a symbolic debugger connected to the GDB server, you can control the server's behavior using monitor commands.
While the package appears to function as intended, there is always the chance of a bug, the documentation may need improvements, or a feature may be missing. Or you simply have a question or an idea. We are always happy to receive contributions along those lines.
-
How to pronounce PyAvrOCD? Since AVR and OCD are both initialisms, the canonical pronunciations would be Pie-Ay-Vee-Ar-Oh-See-Dee. However, you are free to pronounce it as 'Piaf rocked'. ↩
-
The term GDB server is often loosely used for programs that provide an interface similar to what the program
gdbserverdoes in the context of the GNU Project Debugger GDB.gdbserverruns on the target machine, controlling the program to be debugged and communicating with the GDB on the host machine using the remote serial protocol (RSP). In contrast to that, a GDB server in the context of embedded debugging usually does not run on the target machine, but either on the hardware debug adapter or on the host. However, it also uses RSP for communicating with GDB. ↩