This is a raw dump of my exploring using the arduino-cli with the ESP32. I wanted to find something that was better than the Arduino IDE, however, not as complex as VS Code/PlatformIO. Using arduino-cli, allows me to use my programming editor, Sublime Text as my code editor as well as some simple automation (coming later).
# install from github
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
# verify installation
arduino-cli version
# if the system is unable to find arduino-cli, see note below.
bash: command not found: arduino-cli
# add an alias to make it easier to use (add to the .bashrc file)
alias ac="arduino-cli"
# setup configuration file
arduino-cli config init
Config file written: /home/username/.arduino15/arduino-cli.yaml
# Documentation for file: https://arduino.github.io/arduino-cli/0.19/configuration/
# if using a 3rd party board, add to yaml file
board_manager:
additional_urls:
- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli board listall
arduino-cli core install esp32:esp32
Platform esp32:esp32@2.0.2 already installed
Upon installing, arduino-cli, a great way to test it is to verify its version using arduino-cli version. However if the system is unable to find arduino-cli, you will get this:
Where I demonstrate how to use the ATmega328PB Xplained Mini from Microchip to understand how to program in Standard C.
Due to its size and shape, I’m conflicted on this board. For the price, its fantastic! Why the conflicting thoughts? The good is that this board has an embedded hardware debugger which solves the controller board/debugger tool issue and it only costs $12! The bad is the board is physically large without adding extra value, thus it requires two breadboards to easily interface. All this said, I would recommend this board over any other, if you plan to do any hardware debugging.
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