Where I provide hints on using avr-gdb and bloom to debug code on the ATmega328P.
Where I show some examples as to how to use Bloom and avr-gdb to debug code on the ATmega328P.
In a previous entry, I discussed how to setup Bloom and gdb using an MPLAB Snap. Given the power of Bloom’s feature called Insight, I want to present some examples of how to use Insight to debug the AVR8 family of microcontrollers.
Where I illustrate how to setup using avr-gdb to debug code on the ATmega328P and replacing avarice with Bloom and the Atmel Dragon with the Microchip Snap.
In a previous entry, I discussed using an Atmel Dragon (no longer available), avarice (an older application managing communication between the Dragon and gdb), and avr-gdb to debug a program running on a Uno (ATmega328P). My goal has been to find a suitable board which replaces the Dragon, however, at a reasonable (<$50) price point. The board would need to work with avarice or I need to find a replacement for avarice as well. This new combination needs to provide both the ability to debug as well as program the 328P.
Where I illustrate debugging code for the ATmega328P using the Atmel Dragon, avr-gdb and avarice. This is a overview of a hardware debugger approach, for a more detailed view on Linux using Bloom, follow this guide.
Update (Feb 2022): I also recommend reviewing this tutorial as it is quite detailed and offers another method for using gdb. While it does use PlatformIO and VS Code, I believe its helpful to review the author’s approach to using gdb.
Where I setup the advanced, Standard C tool chain (avr-gcc) for the ATmega328P on Windows.
If you are looking to install the AVR toolchain for C using Windows Subsystem for Linux, don’t bother.
Note: This tutorial hasn’t been strictly tested by me on Windows 11 system, that said, it has been performed on numerous other Windows 11 systems without issues.
Windows has two different operating environments, Windows (the Graphical User Interface or GUI) and the command line interface (CLI). The former is the typical method of using Windows, particularly when using applications such as Word, Excel and Powerpoint. The latter is used for program automation and Windows program development and it is typically entered by typing cmd
Where I illustrate developing multitasking code for the ATmega328P using a new Standard C framework.
The value of using multitasking on an embedded microcontroller, is that it allows you to do “multiple things at once”, hence the term multitasking. It also allows you to separate specific tasks into functions. Then debug each function separately to ensure your board works as bug free as possible.
Where I illustrate developing code for the ATmega328P using the new Standard C framework.
The Github repository referenced above is a new Standard C framework which mimics a subset of the Arduino framework. [Note: Standard C refers to using a standardized version of C, in this case, avr-gcc (ANSI C) as compared to Arduino C++, which is a combination of C, C++ and Arduino classes and templates. Many universities have an expectation of their students to understand C in the context of ANSI C.] The intent of the repository is to provide the capability for someone to use Standard C in programming an Arduino Uno (or similar type of microcontroller.)
DEPRECATED: Due to Microsoft’s inability to enable serial ports in WSL 2, attempting to perform embedded development in WSL is futile. I strongly recommend Linux, macOS or Windows, instead.
Where I setup the Standard C tool chain (avr-gcc) for the ATmega328P on Windows 10 using Windows Subsystem for Linux (WSL1).
If you are looking to install the AVR toolchain for C using Windows 10 (and not WSL), go here.
Windows has two different operating environments, Windows (the Graphical User Interface or GUI) and the command line, otherwise known as the command prompt. The former is the typical method of using Windows and the latter is used for program automation and Windows program development. It is entered by typing cmd
Where I setup the Standard C toolchain (avr-gcc) for the ATmega328P on macOS using homebrew.
After performing these steps on multiple machines, I’ve found it best to install and test using the Arduino IDE before going forward with the installation instructions below. This will reduce the errors to something more manageable and having the Arduino IDE is handy for its Serial Monitor as well it provides an easy method to which port the Uno is connected.
Where I setup the Standard C toolchain for the ATmega328P for Linux, with specific emphasis on the Raspberry Pi.
Note: If you have a GUI interface to your Linux PC, by all means, install the Arduino Legacy IDE (1.8.19). In the steps regarding the Raspberry Pi, the interface will be the terminal and can’t use the Arduino IDE GUI. After performing these steps on multiple machines, I’ve found it best to install and test using the Arduino IDE before going forward with the installation instructions below. This will reduce the errors to something more manageable and having the Arduino IDE is handy for its Serial Monitor as well it provides an easy method to which port the Uno is connected.