a2nr / dw-link

An Arduino-based debugWIRE hardware-debugger

Home Page:https://www.codeproject.com/Articles/5321801/Debugging-an-Arduino-project-with-GDB-on-Classic-A

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dw-link

License: GPL v3 License: CCBY4.0 Commits since latest Hit Counter Build Status

This is an Arduino sketch that turns your Arduino ATmega328 board into a hardware debugger for the classic ATtinys and some small ATmegas, such as the ATmega328. The debugger can communicate using the debugWIRE protocol, which gives access to the on-chip debugging interface of the mentioned MCUs. Over its USB port, the hardware debugger communicates with an instance of the GNU debugger avr-gdb using the GDB remote serial protocol. This means that you can use the hardware debugger to debug your program on your development machine using avr-gdb or any IDE that integrates avr-gdb, e.g., PlatformIO or Eclipse, while your program is running on the target hardware (e.g. an ATtiny). And it is all platform independent, i.e., you can use it under macOS, Linux, or Windows.

Why is this good news? The current version of the Arduino IDE does not support debugging at all. Even the new version will not provide any debugging tools for the small AVR MCUs. So, the only way to debug programs is to use additional print statements and recompile, which is very cumbersome. With this sketch, you are provided with a tool that allows you to set breakpoints, to single-step, and to inspect and change variables. Hopefully, this will make debugging much more enjoyable and will save you a lot of valuable time.

If you are interested in the background and ongoing development of dw-link, visit my blog. In particular, the blogs tagged with dw-link will be interesting for you.

This repository contains the following directories:

  • dw-link: Contains the Arduino sketch that turns your Arduino board into a hardware debugger
  • examples: Contains a tiny Arduino sketch, a PlatformIO project, and a file you need to install in the Arduino packages
  • tests: Contains some test cases and a Python script for running them semi-automatically
  • docs: Contains the documentation, in particular the manual
  • pcb: Contains design data (Eagle and Gerber) for the (optional) adapter boards

Note that the debugger is an alpha release and may contain bugs. If you encounter behavior that you think is wrong, try to be as specific as possible so that I can reproduce the behavior. For that I need a description of the problem, the source code that leads to the behavior, the way one reproduces the problem, and the type of target chip you used. I have prepared an issue form for that purpose. Current issues, known bugs, and limitations are listed in Section 8 of the manual.

About

An Arduino-based debugWIRE hardware-debugger

https://www.codeproject.com/Articles/5321801/Debugging-an-Arduino-project-with-GDB-on-Classic-A

License:GNU General Public License v3.0


Languages

Language:C++ 82.2%Language:Python 8.4%Language:C 6.3%Language:HTML 2.6%Language:Prolog 0.4%Language:Shell 0.0%