Macos ships a quite old version of bash (3.x) which does not have associative arrays (declare -A) yet. As the test-avrdude script only uses one associative array for a static mapping of one character strings to one word strings, this can be easily replaced by a shell function containing a "case" statement. Before this fix: 2024-08-15T15:39:59.9596380Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip 2024-08-15T15:40:00.5796130Z ✅ 0.155 s: flash raw format -T/-U write/verify cola-vending-machine.raw 2024-08-15T15:40:00.7006170Z ✅ 0.111 s: flash extended address and hole test 2024-08-15T15:40:00.7057180Z ./tools/test-avrdude: line 322: declare: -A: invalid option 2024-08-15T15:40:00.7057750Z declare: usage: declare [-afFirtx] [-p] [name[=value] ...] 2024-08-15T15:40:00.9218810Z ✅ 0.212 s: flash writing R numbers 2024-08-15T15:40:01.1793950Z ✅ 0.240 s: flash reading and verifying R numbers 2024-08-15T15:40:01.3661060Z ✅ 0.173 s: flash writing R numbers 2024-08-15T15:40:01.6317540Z ✅ 0.254 s: flash reading and verifying R numbers 2024-08-15T15:40:01.8235780Z ✅ 0.182 s: flash writing R numbers 2024-08-15T15:40:02.0724260Z ✅ 0.239 s: flash reading and verifying R numbers 2024-08-15T15:40:02.2713120Z ✅ 0.188 s: flash writing R numbers 2024-08-15T15:40:02.4497490Z ✅ 0.162 s: flash reading and verifying R numbers 2024-08-15T15:40:02.5897960Z ✅ 0.128 s: flash writing R numbers 2024-08-15T15:40:02.8667350Z ✅ 0.263 s: flash reading and verifying R numbers 2024-08-15T15:40:03.0635260Z ✅ 0.181 s: flash writing srec format 2024-08-15T15:40:03.2152560Z ✅ 0.142 s: flash reading and verifying srec format file After this fix: 2024-08-15T17:23:24.5161820Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip 2024-08-15T17:23:25.1088990Z ✅ 0.162 s: flash raw format -T/-U write/verify cola-vending-machine.raw 2024-08-15T17:23:25.2742090Z ✅ 0.157 s: flash extended address and hole test 2024-08-15T17:23:25.4795650Z ✅ 0.196 s: flash writing binary numbers 2024-08-15T17:23:25.6721130Z ✅ 0.180 s: flash reading and verifying binary numbers 2024-08-15T17:23:25.8423490Z ✅ 0.161 s: flash writing octal numbers 2024-08-15T17:23:26.0901770Z ✅ 0.235 s: flash reading and verifying octal numbers 2024-08-15T17:23:26.2308860Z ✅ 0.127 s: flash writing decimal numbers 2024-08-15T17:23:26.4667010Z ✅ 0.228 s: flash reading and verifying decimal numbers 2024-08-15T17:23:26.6574670Z ✅ 0.180 s: flash writing hexadecimal numbers 2024-08-15T17:23:26.8651240Z ✅ 0.200 s: flash reading and verifying hexadecimal numbers 2024-08-15T17:23:27.0446640Z ✅ 0.168 s: flash writing R numbers 2024-08-15T17:23:27.3074230Z ✅ 0.250 s: flash reading and verifying R numbers 2024-08-15T17:23:27.4962750Z ✅ 0.179 s: flash writing srec format 2024-08-15T17:23:27.6594570Z ✅ 0.150 s: flash reading and verifying srec format file
AVRDUDE
AVRDUDE - AVR Downloader Uploader - is a program for downloading and uploading the on-chip memories of Microchip’s AVR microcontrollers. It can program the Flash and EEPROM, and where supported by the programming protocol, it can program fuse and lock bits. AVRDUDE also supplies a direct instruction mode allowing one to issue any programming instruction to the AVR chip regardless of whether AVRDUDE implements that specific feature of a particular chip.
AVRDUDE was originally written in 2003 by Brian S. Dean. Since 2006, AVRDUDE has been maintained by Jörg Wunsch, with the help of various contributors.
The latest version of AVRDUDE is always available here:
https://github.com/avrdudes/avrdude
Documentation
Documentation for current and previous releases is on Github Pages. Git main is documented only with the most recent avrdude.pdf.
Getting AVRDUDE for Windows
To get AVRDUDE for Windows, install the latest version from the Releases page.
Alternatively, you may build AVRDUDE yourself from source.
Getting AVRDUDE for Linux
To install AVRDUDE for Linux, install the package avrdude using the software package manager. For example, under Debian/Ubuntu, you can use the following commands:
sudo apt-get install avrdude
Alternatively, you may build AVRDUDE yourself from source.
Getting AVRDUDE for macOS
On macOS, AVRDUDE can be installed through MacPorts or Homebrew.
Alternatively, you may build AVRDUDE yourself from source.
Using AVRDUDE
AVRDUDE is a command-line application. Run the command avrdude without any arguments for a list of options.
A typical command to program your HEX file into your AVR microcontroller looks like this:
avrdude -c <programmer> -p <part> -U flash:w:<file>:i
For instance, to program an Arduino Uno connected to the serial port COM1 with a HEX file called blink.hex,
you would run the following command:
avrdude -c arduino -P COM1 -b 115200 -p atmega328p -D -U flash:w:objs/blink.hex:i
There are many different programmers and options that may be required for the programming to succeed.
For more information, refer to the AVRDUDE documentation.
Using the AVRDUDE GUI demonstrator
Starting with version 8, a GUI implementation has been added, to demonstrate the functionality of libavrdude is suitable to implement a native GUI (as opposed to CLI wrapper).
The GUI is based on the Qt toolkit and its Python bindings, called PySide. Either Qt5 with PySide2, or Qt6 with PySide6 are supported.
A script named avrdude-gui is installed into the same location as the AVRDUDE CLI program. It can be used to start the GUI. There is a builtin help describing the usage.