NAME

avr-updi - communicate with an AVR microcontroller over UPDI

SYNOPSIS

$ avr-updi [--port PORT] [--part PART] COMMAND ARGS... [COMMAND ARGS ...]

DESCRIPTION

This program contains a number of sub-commands for interacting with an AVR microcontroller using a UPDI interface.

COMMON OPTIONS

--port, -P DEVICE

Optional. Provides the USB device where the UPDI adapter is connected. If absent a default of /dev/ttyUSB0 will apply.

--part, -p PART

Required. Gives the name of the ATmega or ATtiny chip that is expected. Parts may be specified in the following ways:

ATmega4809
atmega4809
m4809

ATtiny814
attiny814
t814

Specifically, these are the same forms as recognised by avr-gcc's -mmcu option and avrdude's -p option, for convenience in Makefiles and build scripts.

--baud, -B BAUD

Optional. Sets a different baud rate for communications. If not supplied, will default to 115200.

If communications are unreliable, try setting a slower speed.

--erase, -e

Send the CHIPERASE key as well as the NVMPROG key when enabling programming for the write-fuses operation. Normally this flag is not required when writing fuses to a newly-programmed chip, but may be necessary to recover from a bad checksum or bad fuse value.

--binary

Files read from or written to will be in raw binary format, instead of Intel hex.

SUBCOMMANDS

Multiple commands may be specified simultaneously; they will be executed in the given sequence. This may be useful for writing flash and EEPROM at the same time

$ avr-updi -p t814 write-flash flash.hex write-eeprom eeprom.hex

reset

Sends a reset request.

$ avr-updi reset

Note that this command does not need the --part to be specified.

read-sib

Reads the System Information Block

$ avr-updi read-sib

Note that this command does not need the --part to be specified.

read-signature

Reads the 3-byte signature from the chip and prints it.

$ avr-updi read-signature -p t814

erase

Erases the entire chip. Normally not required because a write-flash operation will do this anyway, but this command may be handy for erasing a chip to reset it back to factory state.

$ avr-updi erase -p t814

read-flash

Reads from the flash portion of non-volatile memory ("NVM").

$ avr-updi read-flash -p t814 flash-save.hex [LENGTH]

Optionally reads only the given length.

write-flash

Writes to the flash portion of non-volatile memory ("NVM").

$ avr-updi write-flash -p t814 firmware.hex

read-eeprom

Reads from the EEPROM portion of non-volatile memory ("NVM").

$ avr-updi read-eeprom -p t814 eeprom-save.hex

write-eeprom

Writes to the EEPROM portion of non-volatile memory ("NVM").

$ avr-updi write-eeprom -p t814 data.hex

read-fuses

Reads fuse values.

$ avr-updi read-fuses -p t814
WDTCFG : 00
  WDTCFG.PERIOD    : OFF
  WDTCFG.WINDOW    : OFF
BODCFG : 00
  BODCFG.ACTIVE    : DIS
  BODCFG.LVL       : BODLEVEL0
  BODCFG.SAMPFREQ  : 1KHz
  BODCFG.SLEEP     : DIS
OSCCFG : 02
...

Decoded values of fields are also printed.

write-fuses

Writes fuse values.

$ avr-updi write-fuses -p t814 BODCFG=02 SYSCFG0.RSTPINCFG=GPIO

Fuses may be specified as numerical values for entire registers, or symbolic names for individual fields.

CONFIG FILE

If the file $HOME/.avrupdirc exists, it is opened and read as lines of name = value declarations, to define some default configuration. The following variables are recognised. Lines beginning with # are ignored as comments.

baud

Overrides the baud rate.

port

Overrides the path to the UPDI device. This value may consist of multiple paths separated by commas. The first path in the list that names a device which actually exists is used.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>