program-avr-spi

CLI reference

glasgow run program-avr-spi

Identify, program, and verify Microchip AVR microcontrollers using low-voltage serial (SPI) programming.

While programming is disabled, the programming interface is tristated, so the applet can be used for in-circuit programming even if the device uses SPI itself.

The standard AVR ICSP connector layout is as follows:

CIPO @ * VCC
 SCK * * COPI
RST# * * GND

Commands that read or write memory contents derive the file format from the filename as follows:

`*.bin`                         binary; as-is
`*.hex`, `*.ihx`, `*.ihex`      Intel HEX
`-` (stdout)                    hex dump when writing to a terminal, binary otherwise
usage: glasgow run program-avr-spi [-h] [-V SPEC] [--reset PIN] [--sck PIN]
                                   [--cipo PIN] [--copi PIN] [-f FREQ]
                                   OPERATION ...
-h, --help

show this help message and exit

-V <spec>, --voltage <spec>

configure I/O port voltage to SPEC (e.g.: ‘3.3’, ‘A=5.0,B=3.3’, ‘A=SA’)

--reset <pin>

bind the applet I/O line ‘reset’ to PIN (default: ‘A0’, required)

--sck <pin>

bind the applet I/O line ‘sck’ to PIN (default: ‘A1’, required)

--cipo <pin>

bind the applet I/O line ‘cipo’ to PIN (default: ‘A2’, required)

--copi <pin>

bind the applet I/O line ‘copi’ to PIN (default: ‘A3’, required)

-f <freq>, --frequency <freq>

set SCK frequency to FREQ kHz (default: 100)

glasgow run program-avr-spi erase

usage: glasgow run program-avr-spi erase [-h]
-h, --help

show this help message and exit

glasgow run program-avr-spi identify

usage: glasgow run program-avr-spi identify [-h]
-h, --help

show this help message and exit

glasgow run program-avr-spi read

usage: glasgow run program-avr-spi read [-h] [-f] [-l] [-c] [-p FILE]
                                        [-e FILE]
-h, --help

show this help message and exit

-f, --fuses

display fuse bytes

-l, --lock-bits

display lock bits

-c, --calibration

display calibration bytes

-p <file>, --program <file>

write program memory contents to FILE (must be ‘-’ or end with: .bin, .hex, .ihx, .ihex)

-e <file>, --eeprom <file>

write EEPROM contents to FILE (must be ‘-’ or end with: .bin, .hex, .ihx, .ihex)

glasgow run program-avr-spi write-eeprom

usage: glasgow run program-avr-spi write-eeprom [-h] FILE
file

read EEPROM contents from FILE (must be ‘-’ or end with: .bin, .hex, .ihx, .ihex)

-h, --help

show this help message and exit

glasgow run program-avr-spi write-fuses

usage: glasgow run program-avr-spi write-fuses [-h] [-L BITS] [-H BITS]
                                               [-E BITS]
-h, --help

show this help message and exit

-L <bits>, --low <bits>

set low fuse to binary BITS

-H <bits>, --high <bits>

set high fuse to binary BITS

-E <bits>, --extra <bits>

set extra fuse to binary BITS

glasgow run program-avr-spi write-lock

usage: glasgow run program-avr-spi write-lock [-h] BITS
bits

write lock bits BITS

-h, --help

show this help message and exit

glasgow run program-avr-spi write-program

usage: glasgow run program-avr-spi write-program [-h] FILE
file

read program memory contents from FILE (must be ‘-’ or end with: .bin, .hex, .ihx, .ihex)

-h, --help

show this help message and exit