PyAvrOCD

PyAvrOCD1 is the missing AVR debugging solution for Arduino IDE 2 and PlatformIO. It 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. It communicates with Microchip's debug probes, such as MPLAB Snap. In addition, it provides a pass-through service for the UNO-based debug probe dw-link and the simulation tool simavr.

ide2-6

Why another open-source GDB server for AVR MCUs? The main intention is to provide a cross-platform AVR GDB server, which can be packaged with the Arduino IDE and PlatformIO. 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.

Do 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.