PyAvrOCD

PyAvrOCD1 is a Python GDB server2 for 8-bit AVR MCUs, enabling you to debug programs running on these MCUs using the GNU Project Debugger GDB. PyAvrOCD communicates with Microchip's debug probes, such as MPLAB Snap and the embedded debuggers on Explained and Curiosity boards. 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).

ide2-6

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:

  1. Installing and configuring the appropriate debugging software
  2. Preparing the target board for debugging
  3. Setting the right fuses
  4. Connecting the debug probe to the target
  5. Compiling the program to be tested
  6. Invoking the GDB server
  7. Debugging a program on the target
  8. Restoring the target board to its original state

Do not be discouraged by this long list. In your day-to-day business only steps 5-7 are relevant. And they will become routine after a while.

You have feedback? Send it immediately!


  1. 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'. 

  2. The term GDB server is loosely used for programs that provide an interface similar to what the program gdbserver does in the context of the GNU Project Debugger GDB. gdbserver runs 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.