AVRDUDE(1)
๐ฆ AVRDUDE(1) โ LOCAL ๐ฆ
๐ NAME ๐
avrdude โ driver program for ``simple'' Atmel AVR MCU programmer. That's the whole vibe, bestie: it's the tool that talks to your AVR chip and moves on-chip memory around. ๐ซถ
โจ SYNOPSIS โจ
avrdude [-p, --part partname] [-b, --baud baudrate]
[-B, --bitclock bitclock] [-c, --programmer programmer-id]
[-C, --config config-file] [-N, --noconfig] [-A] [-D, --noerase]
[-e, --erase] [-E exitspec[,exitspec]] [-F] [-i delay]
[-l, --logfile logfile] [-n, --test-memory] [-O, --osccal]
[-P, --port port] [-r, --reconnect] [-q, --quell] [-T cmd]
[-t, --terminal] [-U, --memory memory:op:filename:filefmt]
[-v, --verbose] [-x extended_param] [-V, --noverify-memory]
[--version]
๐ DESCRIPTION ๐
Okay so bestie, avrdude is literally the program for downloading and uploading on-chip memories of Atmel AVR microcontrollers. ๐พโจ
It supports a whole roster of programmers, and no cap, it's giving โevery adapter you've ever met at a makerspaceโ:
- Atmel's STK500 programmer
- Atmel's AVRISP and AVRISP mkII devices
- Atmel's STK600
- Atmel's JTAG ICE (mkI, mkII and 3, the latter two also in ISP mode)
- programmers complying to AppNote AVR910 and AVR109 (including the Butterfly)
- a simple hard-wired programmer connected directly to a
ppi(4)orparport(4)parallel port, or to a standard serial port
In the simplest case, the hardware consists just of a cable connecting the respective AVR signal lines to the parallel port. ๐
The MCU is programmed in serial programming mode, so, for the ppi(4) based programmer, the MCU signals โ/RESETโ, โSCKโ, โSDIโ and โSDOโ of the AVR's SPI interface need to be connected to the parallel port; older boards might use the labels MOSI for SDO or MISO for SDI. Optionally, some otherwise unused output pins of the parallel port can be used to supply power for the MCU part, so it is also possible to construct a passive stand-alone programming device. Some status LEDs indicating the current operating state of the programmer can be connected, and a signal is available to control a buffer/driver IC 74LS367 (or 74HCT367). The latter can be useful to decouple the parallel port from the MCU when in-system programming is used. ๐
A number of equally simple bit-bang programming adapters that connect to a serial port are supported as well, among them the popular Ponyprog serial adapter, and the DASA and DASA3 adapters that used to be supported by uisp(1).
Note: these adapters are meant to be attached to a physical serial port. Connecting to a serial port emulated on top of USB is likely to not work at all, or to work abysmally slow. ๐ญ
If you happen to have a Linux system with at least 4 hardware GPIOs available (like almost all embedded Linux boards) you can do without any additional hardware โ just connect them to the SDO, SDI, RESET and SCK pins on the AVR and use the linuxgpio programmer type. It bitbangs the lines using the Linux sysfs GPIO interface. Of course, care should be taken about voltage level compatibility. Also, although not strictly required, it is strongly advisable to protect the GPIO pins from overcurrent situations in some way. The simplest would be to just put some resistors in series or better yet use a 3-state buffer driver like the 74HC244. Have a look at https://kolev.info/blog/2013/01/06/avrdude-linuxgpio/ for a more detailed tutorial about using this programmer type. ๐ง
Under a Linux installation with direct access to the SPI bus and GPIO pins, such as would be found on a Raspberry Pi, the ``linuxspi'' programmer type can be used to directly connect to and program a chip using the built in interfaces on the computer. The requirements to use this type are that an SPI interface is exposed along with one GPIO pin. The GPIO serves as the reset output since the Linux SPI drivers do not hold chip select down when a transfer is not occurring and thus it cannot be used as the reset pin. A readily available level translator should be used between the SPI bus/reset GPIO and the chip to avoid potentially damaging the computer's SPI controller in the event that the chip is running at 5V and the SPI runs at 3.3V. The GPIO chosen for reset can be configured in the avrdude configuration file using the reset entry under the linuxspi programmer, or directly in the port specification. An external pull-up resistor should be connected between the AVR's reset pin and Vcc. If Vcc is not the same as the SPI voltage, this should be done on the AVR side of the level translator to protect the hardware from damage. ๐
The -P portname option for this programmer defaults to /dev/spidev0.0:/dev/gpiochip0.
Atmel's STK500 programmer is also supported and connects to a serial port. Both, firmware versions 1.x and 2.x can be handled, but require a different programmer type specification (by now). Using firmware version 2, high-voltage programming is also supported, both parallel and serial (programmer types stk500pp and stk500hvsp). ๐ฅ
Wiring boards (e.g. Arduino Mega 2560 Rev3) are supported, utilizing STK500 V2.x protocol, but a simple DTR/RTS toggle is used to set the boards into programming mode. The programmer type is ``wiring''. Note that the -D option will likely be required in this case, because the bootloader will rewrite the program memory, but no true chip erase can be performed. ๐ง
Serial bootloaders that run a skeleton of the STK500 1.x protocol are supported via their own programmer type ``arduino''. This programmer works for the Arduino Uno Rev3 or any AVR that runs the Optiboot bootloader. ๐
Urprotocol is a leaner version of the STK500 1.x protocol that is designed to be backwards compatible with STK500 v1.x, and allows bootloaders to be much smaller, e.g., as implemented in the urboot project https://github.com/stefanrueger/urboot. The programmer type ``urclock'' caters for these urboot programmers. Owing to its backward compatibility, bootloaders that can be served by the arduino programmer can normally also be served by the urclock programmer. This may require specifying the size of (to avrdude) unknown bootloaders in bytes using the -x bootsize=<n> option, which is necessary for the urclock programmer to enable it to protect the bootloader from being overwritten. If an unknown bootloader has EEPROM read/write capability then the option -x eepromrw informs avrdude -c urclock of that capability. ๐ฆ
The BusPirate is a versatile tool that can also be used as an AVR programmer. A single BusPirate can be connected to up to 3 independent AVRs. See the section on extended parameters below for details. ๐ดโโ ๏ธ
Atmel's STK600 programmer is supported in ISP and high-voltage programming modes, and connects through the USB. For ATxmega devices, the STK600 is supported in PDI mode. For ATtiny4/5/9/10 devices, the STK600 and AVRISP mkII are supported in TPI mode. ๐
The simple serial programmer described in Atmel's application note AVR910, and the bootloader described in Atmel's application note AVR109 (which is also used by the AVR Butterfly evaluation board), are supported on a serial port. ๐ฆ
Atmel's JTAG ICE (mkI, mkII, and 3) is supported as well to uploading and download memory areas of an AVR target (no support for on-chip debugging). For the JTAG ICE mkII, JTAG, debugWIRE and ISP mode are supported, provided it has a firmware revision of at least 4.14 (decimal). JTAGICE3 also supports all of JTAG, debugWIRE, and ISP mode. See below for the limitations of debugWIRE. For ATxmega devices, the JTAG ICE mkII is supported in PDI mode, provided it has a revision 1 hardware and firmware version of at least 5.37 (decimal). For ATxmega devices, the JTAGICE3 is supported in PDI mode. ๐
Atmel-ICE (ARM/AVR) is supported in all modes (JTAG, PDI for Xmega, debugWIRE, ISP, UPDI). ๐
Atmel's XplainedPro boards, using the EDBG protocol (CMSIS-DAP compatible), are supported using the "jtag3" programmer type. ๐ธ
Atmel's XplainedMini boards, using the mEDBG protocol, are also supported using the "jtag3" programmer type. ๐
The AVR Dragon is supported in all modes (ISP, JTAG, HVSP, PP, debugWIRE). When used in JTAG and debugWIRE mode, the AVR Dragon behaves similar to a JTAG ICE mkII, so all device-specific comments for that device will apply as well. When used in ISP mode, the AVR Dragon behaves similar to an AVRISP mkII (or JTAG ICE mkII in ISP mode), so all device-specific comments will apply there. In particular, the Dragon starts out with a rather fast ISP clock frequency, so the -B bitclock option might be required to achieve a stable ISP communication. For ATxmega devices, the AVR Dragon is supported in PDI mode, provided it has a firmware version of at least 6.11 (decimal). ๐
The USBasp ISP, USBtinyISP, avrftdi and CH341A adapters are also supported, provided avrdude has been compiled with libusb support. USBasp ISP and USBtinyISP both feature simple firmware-only USB implementations, running on an ATmega8 (or ATmega88), or ATtiny2313, respectively. CH341A programmers connect directly to the AVR target. Their SPI bit clock is approximately 1.7 MHz and cannot be changed. As a consequence, the AVR target must have a CPU frequency of 6.8 MHz or more: factory-set AVR parts, which typically run on an internal oscillator between 1 MHz and 1.6 MHz, cannot be programmed using -c ch341a.
Heads up: if libftdi has has been compiled in avrdude, the avrftdi device adds support for many programmers using FTDI's 2232C/D/H and 4232H parts running in MPSSE mode, which hard-codes (in the chip) SCK to bit 1, SDO to bit 2, and SDI to bit 3. Reset is usually bit 4. ๐ฅ
The Atmel DFU bootloader is supported in both, FLIP protocol version 1 (AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices). See below for some hints about FLIP version 1 protocol behaviour. ๐พ
The MPLAB(R) PICkit 4/5 and MPLAB(R) SNAP, are supported in JTAG, TPI, ISP, PDI and UPDI mode. The Curiosity Nano board is supported in UPDI mode. It is dubbed โPICkit on Boardโ, thus the name pkobn_updi. ๐
SerialUPDI programmer implementation is based on Microchip's pymcuprog https://github.com/microchip-pic-avr-tools/pymcuprog utility, but it also contains some performance improvements included in Spence Konde's DxCore Arduino core https://github.com/SpenceKonde/DxCore. In a nutshell, this programmer consists of simple USB->UART adapter, diode and couple of resistors. It uses serial connection to provide UPDI interface. See the texinfo documentation for more details and known issues. ๐
The jtag2updi programmer is supported, and can program AVRs with a UPDI interface. Jtag2updi is just a firmware that can be loaded onto an AVR, which enables it to interface with avrdude using the jtagice mkii protocol via a serial link. https://github.com/ElTangas/jtag2updi ๐
okay so the Micronucleus bootloader โ it's supported for both protocol version V1 and V2 ๐ and that's genuinely the whole vibe. But heads up bestie: this bootloader does not support reading from flash memory, so you've gotta use the -V option to stop AVRDUDE from verifying the flash memory. Also go peek at the section on extended parameters for the Micronucleus specific options, iykyk โจ
The Teensy bootloader is supported for all AVR boards, slay. And same deal as above: the bootloader doesn't support reading from flash memory, so use -V to prevent AVRDUDE from verifying the flash memory. The section on extended parameters has the Teensy specific options too ๐ซถ
So here's what you can actually do with files: input files can be provided, and output files can be written in different file formats โ like raw binary files containing the data to write to the chip, Intel Hex format, or Motorola S-Record format ๐. There are a bunch of tools out there that produce those files, like asl(1) as a standalone assembler, or avr-objcopy(1) for the final stage of the GNU toolchain for the AVR microcontroller. Iconic little pipeline, honestly.
Provided libelf(3) was present when compiling avrdude, the input file can also be the final ELF file as produced by the linker ๐ฅ. The appropriate ELF section(s) will be examined, according to the memory area to write to. Fancy.
Avrdude can program the EEPROM and flash ROM memory cells of supported AVR parts. Where supported by the serial instruction set, fuse bits and lock bits can be programmed as well ๐
. These are implemented within avrdude as separate memory types and can be programmed using data from a file (see the -U option) or from terminal mode (see the dump and write commands). It is also possible to read the chip (provided it has not been code-protected previously, of course ๐) and store the data in a file. And finally, a โterminalโ mode is available that allows one to interactively communicate with the MCU, and to display or program individual memory cells โจ. On some programmers some settings of the programmer itself can be examined and changed from within terminal mode as well; see the Terminal mode section.
โจ Options โจ
so in order to control all the different operation modi (yes, modi, we're being fancy today ๐ ), a number of options need to be specified to avrdude. Let's go through them one by one, bestie:
-p --part partnameโ This one specifies the MCU connected to the programmer ๐ฏ. The MCU descriptions are read from the config file. Wanna see a list of currently supported MCUs? Use?as partname, which will print the part ids and official part names. Depending on the used shell,?may need to be quoted as in"?"or\?(globbing jumpscare, we've all been there ๐ญ). In connection with-v, this will also print a list of variant part names followed by an optional colon, the package code and some absolute maximum ratings ๐. The part id, their official part name, any of the full variant part names or their initial part up to a dash can be used to specify a part with the-poption. If-p ?is specified with a specific programmer, see-cbelow, then only those parts are output that the programmer expects to be able to handle, together with the programming interface(s) that can be used in that combination. In reality there can be deviations from this list, particularly if programming is directly via a bootloader ๐.
The following parts need special attention, fr fr:
AT90S1200โ The ISP programming protocol of the AT90S1200 differs in subtle ways from that of other AVRs. Thus, not all programmers support this device. Known to work are all direct bitbang programmers, and all programmers talking the STK500v2 protocol ๐AT90S2343โ The AT90S2323 and ATtiny22 use the same algorithm.ATmega2560,ATmega2561โ Flash addressing above 128 KB may not be supported by all programming hardware ๐ฌATtiny11โ The ATtiny11 can only be programmed in high-voltage serial mode.
-p --part wildcard/flagsโ Run developer options for MCUs that are matched by wildcard ๐ง Whilst their main use is for developers some flags can be of utility for users, e.g.,avrdude -p m328p/Soutputs AVRDUDE's understanding of ATmega328P MCU properties; for more information runavrdude -p x/h. iykyk โจ-b --baud baudrateโ Override the RS-232 connection baud rate specified in the respective programmer's entry of the configuration file or defined by thedefault_baudrateentry in your user configuration file${HOME}/.config/avrdude/avrdude.rcor${HOME}/.avrdudercif no baudrate was defined for this programmer ๐ก-r --reconnectโ Opens the serial port at 1200 baud and immediately closes it, waits 400 ms for each-ron the command line and then establishes communication with the programmer ๐ This is commonly known as a "1200bps touch", and is used to trigger programming mode for certain boards like Arduino Leonardo, Arduino Micro/Pro Micro and the Arduino Nano Every ๐ธ Longer waits, and therefore multiple-roptions, are sometimes needed for slower, less powerful hosts. (Slow laptop girlies, this one's for us ๐ญ)-B --bitclock bitclockโ Specify the bit clock period for the JTAG, PDI, TPI, UPDI, or ISP interface โฑ๏ธ The value is a floating-point number in microseconds. Alternatively, the value might be suffixed with"Hz","kHz"or"MHz"in order to specify the bit clock frequency rather than a period. Some programmers default their bit clock value to a 1 microsecond bit clock period, suitable for target MCUs running at 4 MHz clock and above. Slower MCUs need a correspondingly higher bit clock period ๐ข Some programmers reset their bit clock value to the default value when the programming software signs off, whilst others store the last used bit clock value. It is recommended to always specify the bit clock if read/write speed is important. You can use the'default_bitclock'keyword in your${HOME}/.config/avrdude/avrdude.rcor${HOME}/.avrdudercfile to assign a default value to keep from having to specify this option on every invocation ๐
Note that some official Microchip programmers store the bitclock setting and will continue to use it until a different value is provided ๐ This applies to "2nd gen" programmers (AVRISPmkII,AVR Dragon,JTAG ICE mkII,STK600) and "3rd gen" programmers (JTAGICE3,Atmel ICE,Power Debugger). "4th gen" programmers (PICkit 4,MPLAB SNAP) will store the last user-specified bitclock until the programmer is disconnected from the computer ๐ฆ
-c --programmer programmer-idโ Use the programmer specified by the argument ๐ Programmers and their pin configurations are read from the config file (see the-Coption). New pin configurations can be easily added or modified through the use of a config file to make avrdude work with different programmers as long as the programmer supports the Atmel AVR serial program method. You can use the'default_programmer'keyword in your${HOME}/.config/avrdude/avrdude.rcor${HOME}/.avrdudercfile to assign a default programmer to keep from having to specify this option on every invocation โจ A full list of all supported programmers is output to the terminal by using?as programmer-id. Depending on the used shell,?may need to be quoted as in"?"or\?. If-c ?is specified with a specific part, see-pabove, then only those programmers are output that expect to be able to handle this part, together with the programming interface(s) that can be used in that combination. In reality there can be deviations from this list, particularly if programming is directly via a bootloader ๐-c --programmer wildcard/flagsโ Run developer options for programmers that are matched by wildcard ๐ง Whilst their main use is for developers some flags can be of utility for users, e.g.,avrdude -c usbtiny/Sshows AVRDUDE's understanding of usbtiny's properties; for more information runavrdude -c x/h๐ฅ-C --config config-fileโ Use the specified config file to load configuration data ๐ This file contains all programmer and part definitions that avrdude knows about. See the config file, located at${PREFIX}/etc/avrdude.conf, which contains a description of the format.
If config-file is written as +filename then this file is read after the system wide and user configuration files ๐ซถ This can be used to add entries to the configuration without patching your system wide configuration file. It can be used several times, the files are read in same order as given on the command line. Organized queen behaviour, honestly.
-N --noconfigโ Do not load the personal configuration file that is usually located at~/.config/avrdude/avrdude.rc,~/.avrdudercor in the same directory as the avrdude executable ๐ โโ๏ธ no config for you today-Aโ Disable the automatic removal of trailing-0xFF sequences in file input that is to be programmed to flash and in AVR reads from flash memory ๐ Normally, trailing 0xFFs can be discarded, as flash programming requires the memory be erased to 0xFF beforehand.-Ashould be used when the programmer hardware, or bootloader software for that matter, does not carry out chip erase and instead handles the memory erase on a page level. Popular Arduino bootloaders exhibit this behaviour; for this reason-Ais engaged by default when specifying-c arduino๐-D,--noeraseโ turns off auto-erase for flash โจ. So like, normally when you use-U --memoryto write to any flash memory, avrdude does a whole chip erase first before starting any of the programming ops, because honestly programming flash without erasing first is generally a mistake. This flag says "no thanks, skip that." Quick notes bestie: auto-erase is not used for ATxmega parts, nor for the UPDI (AVR8X family) parts, since those can just use page erase before writing each page, so no explicit chip erase is needed. But โ and this is important โ any flash page not affected by the current operation will keep its previous contents. Also, setting-Dimplies-A๐ .-e,--eraseโ makes a chip erase happen ๐งน. This resets the contents of the flash ROM and EEPROM to the value'0xff', and clears all lock bits. Except for ATxmega and UPDI (AVR8X family) devices (which can all use page erase), it's basically a prerequisite command before the flash ROM can be reprogrammed again. The only exception would be if the new contents would exclusively cause bits to be programmed from the value'1'to'0'. This option carries out the chip erase at the beginning, before any of the-U,-Tor-toptions are processed. If you need a chip erase at a certain position within the sequence of-U,-Tor-toptions, it's recommended to use-T eraseinstead, since that one is processed in the given command line order ๐ซถ.
If there's no explicit -e or -D option, avrdude tries to augur from the command line whether or not the chip should be auto-erased at the beginning. If avrdude detects a -U command that writes to flash, then auto-erase will be carried out before any other programming โ unless a -T erase command has been detected beforehand, and unless flash is read before writing to it. For the purpose of this analysis, any terminal command is considered to possibly read flash ๐.
And note that for reprogramming EEPROM cells, no explicit prior chip erase is required, since the MCU provides an auto-erase cycle in that case before programming the cell. Slay, EEPROM ๐.
-Eexitspec[,exitspec] โ passes exitspec to the chosen programmer ๐. The interpretation of the exitspec parameter depends on the programmer itself. See below for a list of programmers that accept exitspec parameter options, or issueavrdude -E help ...to see the options of the chosen programmer.-Fโ okay so normally avrdude tries to verify that the device signature read from the part is reasonable before continuing. But since it can happen from time to time that a device has a broken (erased or overwritten) device signature while otherwise operating normally, this option exists to override the check ๐. Also, for programmers like the Atmel STK500 and STK600, which can adjust parameters local to the programming tool (independent of an actual connection to a target controller), this option can be used together with-tto continue in terminal mode. Moreover, the option allows you to continue despite failed initialization of the connection between a programmer and a target ๐.-idelay โ for bitbang-type programmers, delay for approximately delay microseconds between each bit state change โฑ๏ธ. If the host system is very fast, or the target runs off a slow clock (like a 32 kHz crystal, or the 128 kHz internal RC oscillator), this can become necessary to satisfy the requirement that the ISP clock frequency must not be higher than 1/4 of the CPU clock frequency. It's implemented as a spin-loop delay so that even very short delays are possible. On Unix-style operating systems, the spin loop is initially calibrated against a system timer, so the number of microseconds might be rather realistic, assuming a constant system load while avrdude is running. On Win32 operating systems, a preconfigured number of cycles per microsecond is assumed, which might be off a bit for very fast or very slow machines ๐-l,--logfilelogfile โ use logfile rather thanstderrfor diagnostics output ๐. Note that initial diagnostic messages (during option parsing) are still written tostderranyway. Can't win 'em all.-n,--test-memoryโ no-write mode, bestie: disables writing data to the MCU whilst processing-U(useful for debuggingavrdude). Just so you know, the terminal mode continues to write to the device ๐ .-O,--osccalโ performs an RC oscillator run-time calibration according to Atmel application note AVR053 โก. This is only supported on the STK500v2, AVRISP mkII, and JTAG ICE mkII hardware. Note that the result will be stored in the EEPROM cell at address0.-P,--portport โ use port to identify the connection through which the programmer is attached ๐. This can be a parallel, serial, spi or linuxgpio connection. The programmer normally specifies the connection type; in the absence of a-Pspecification, the system-dependent default valuesdefault_parallel,default_serial,default_spi, ordefault_linuxgpiofrom the configuration file are used. If you need to use a different port, use this option to specify the alternate port name.
If avrdude has been configured with libserialport support, a serial port can be specified using a predefined serial adapter type in avrdude.conf or .avrduderc, e.g. ch340 or ft232r. If more than one serial adapter of the same type is connected, they can be distinguished by appending a serial number, e.g. ft232r:12345678. Note that the USB to serial chip has to have a serial number for this to work. Avrdude can check for leading and trailing serial number matches as well โ in the above example, ft232r:1234 would also result in a match, and so would ft232r:...5678 โจ. If the USB to serial chip is not known to avrdude, it can be specified using the hexadecimal USB vendor ID, hexadecimal product ID and an optional serial number, following the serial number matching rules described above, e.g. usb:0x2341:0x0043 or usb:2341:0043:12345678. To see a list of currently plugged-in serial ports use -P ?s. In order to see a list of all possible serial adapters known to avrdude use -P ?sa. Depending on the used shell, ? may need to be quoted as in "?" or \? ๐.
On Win32 operating systems, the parallel ports are referred to as lpt1 through lpt3, referring to the addresses 0x378, 0x278, and 0x3BC, respectively. If the parallel port can be accessed through a different address, this address can be specified directly, using the common C language notation (i.e., hexadecimal values are prefixed by '0x').
For the JTAG ICE mkII and JTAGICE3, if avrdude has been configured with libusb support, port can alternatively be specified as usb[:serialno]. This will cause avrdude to search the programmer on USB. If serialno is also specified, it will be matched against the serial number read from any JTAG ICE mkII found on USB. The match is done after stripping any existing colons from the given serial number, and right-to-left, so only the least significant bytes from the serial number need to be given ๐.
As the AVRISP mkII device can only be talked to over USB, the very same method of specifying the port is required there.
For the USB programmer "AVR-Doper" running in HID mode, the port must be specified as avrdoper. Libhidapi support is required on Unix and Mac OS but not on Windows. For more information about AVR-Doper see https://www.obdev.at/products/vusb/avrdoper.html ๐ฆ.
For the USBtinyISP, which is a simplistic device not implementing serial numbers, multiple devices can be distinguished by their location in the USB hierarchy. See the respective Troubleshooting entry in the detailed documentation for examples.
For the XBee programmer the target MCU is to be programmed wirelessly over a ZigBee mesh using the XBeeBoot bootloader ๐. The ZigBee 64-bit address for the target MCU's own XBee device must be supplied as a 16-character hexadecimal value as a port prefix, followed by the '@' character, and the serial device to connect to a second directly contactable XBee device associated with the same mesh (with a default baud rate of 9600). This may look similar to:
0013a20000000001@/dev/tty.serial
For diagnostic purposes, if the target MCU with an XBeeBoot bootloader is connected directly to the serial port, the 64-bit address field can be omitted. In this mode the default baud rate will be 19200 ๐ฅ.
For programmers that attach to a serial port using some kind of higher-level protocol (as opposed to bit-bang style programmers), port can be specified as net:host:port. ๐
In that case, instead of trying to open a local device, a TCP network connection to (TCP) port on host is established. You can pop square brackets around host to make it read nicer for numeric IPv6 addresses โ like net:[2001:db8::42]:1337. The remote endpoint is assumed to be a terminal or console server that connects the network stream to a local serial port where the actual programmer has been attached to. And that port is assumed to be properly configured, for example using a transparent 8-bit data connection without parity at 115200 Baud for a STK500. ๐ซถ
Note: the ability to handle IPv6 hostnames and addresses is limited to Posix systems (by now). ๐ญ
-q,--quellโ disables (or quells, iconic word) the output of the progress bar while reading from or writing to the device. Specify it more often for even quieter operations. ๐-Tcmd โ runs the terminal line cmd when it's its turn, in relation to other-tinteractive terminals,-Tterminal commands and-Umemory operations. Except for the simplest of terminal commands, the argument cmd will most likely need to be set in quotes โ see your OS shell manual for the details. See below for a detailed description of all terminal commands. โจ-t,--terminalโ tells avrdude to run an interactive terminal when it's its turn, in relation to other-tinteractive terminals,-Tterminal commands and-Umemory operations. ๐-U,--memorymemory:op:filename[:format] โ performs a memory operation as indicated, when it's its turn in relation to other-tinteractive terminals,-Tterminal commands and-Umemory operations.
The memory field specifies the memory to operate on. From version 8.0 the memory field can also be a comma-separated list of memories, e.g. flash,eeprom; also, Intel Hex or Motorola S-Record files generated by AVRDUDE can store multiple memories. ๐
The special memory ALL expands to all memories that a part has, while all expands to all memories with the exception of sub-memories. etc is the same as all โ and this one's lowkey a trick for changing the order in which memories are written to or read from a file, e.g. signature,etc is a list of all memories such that the signature memory comes first. ๐ฆ You can also remove a memory from the list so far by preceding it with a minus or backslash, e.g. all,-calibration. The available memory types are device-dependent; the actual configuration can be viewed with the part command in terminal mode.
Typically, a device's memory configuration at least contains the memories flash, eeprom, signature and lock, which is sometimes known as lockbits. The signature memory contains the three device signature bytes, which should be โ but not always are โ unique for the part. The lock memory of one or four bytes typically details whether or not external reading/writing of the flash memory, or parts of it, is allowed. And after you've restricted access via the lock memory, often the only way to unlock memory is via a chip erase. ๐ญ Parts will also typically have fuse bytes, which are read/write memories for configuration of the device, and calibration memories that typically contain read-only factory calibration values.
The flash memory, being physically implemented as NOR-memory, is special in the sense that it is normally only possible to program bits to change from 1 to 0. Before reprogramming takes place, normally flash memory has to be erased. Older parts would only offer a chip erase to do so, which also erases EEPROM unless a fuse configuration preserves its contents. If AVRDUDE detects a -U option that writes to a flash memory it will automatically trigger a chip erase for these older parts. ATxmegas or UPDI parts (AVR8X family) offer a page erase, and AVRDUDE takes advantage of that by erasing pages before programming them โ unless -e (chip erase) or -D (do not erase before writing) was requested. It should be noted that in absence of the -e chip erase option, any ATxmega or UPDI flash pages not affected by the programming will retain their previous content. ๐ง
For a list of all known memories, please refer to the full documentation, e.g. https://github.com/avrdudes/avrdude/blob/main/avrdude.pdf
The op field specifies what operation to perform:
rโ read device memory and write to the specified filewโ read data from the specified file and write to the device memories in the list; read-only memories in a memory list are skipped, as are fuses and lock bits when the programmer is a bootloader; writing to single read-only memories fails only if the contents differs between the file and memoryvโ read data from both the device and the specified file and perform a verify
The filename field indicates the name of the file to read or write. The format field is optional and contains the format of the file to read or write. format can be one of:
iโ Intel HexIโ Intel Hex with comments on reading from, and tolerance of checksum errors, writing to the AVRsโ Motorola S-Recordrโ raw binary; little-endian byte order, in the case of the flash dataeโ ELF (Executable and Linkable Format, for input only)mโ immediate mode; actual byte values are specified on the command line, separated by commas or spaces, in place of the filename field of the-Uoption. This is useful for programming fuse bytes without having to create a single-byte file or enter terminal mode. ๐ฅaโ auto detect; valid for input only, and only if the input is not provided at stdin.dโ decimal; this and the following formats generate one line of output for the respective memory section, forming a comma-separated list of the values. This can be particularly useful for subsequent processing, like for fuse bit settings.hโ hexadecimal; each value will get the string0xprepended.oโ octal; each value will get a0prepended unless it is less than 8, in which case it gets no prefix.bโ binary; each value will get the string0bprepended.
When used as input, the m, d, h, o and b formats will use the same code for reading lists of numbers separated by white space and/or commas. The read routine handles decimal, hexadecimal, octal or binary numbers on a number-by-number basis, and the list of numbers can therefore be of mixed type. In fact the syntax is the same as for data used by the terminal write command โ i.e. the file's input data can also be 2-byte short integers, 4-byte long integers or 8-byte long long integers, 4-byte floating point numbers, 8-byte double precision numbers, C-type strings with a terminating nul or C-like characters such as ''. Numbers are written as little endian to memory. When using 0x hexadecimal or 0b binary input, leading zeros are used to determine the size of the integer โ e.g. 0x002a will occupy two bytes and write a 0x2a to memory followed by 0x00, and 0x01234 will occupy 4 bytes. See the description of the terminal write command for more details. ๐
In absence of an explicit file format, the default is to use auto detection for input files, raw binary format for output files from a single memory read, and Intel Hex with comments when an output file is generated from a list of memories. Note that while avrdude will generate a single output file from a memory list for all formats with the exception of elf (:e), it only recognises Intel hex (:I or :i), Motorola S-Record (:s) or elf files (:e, generated by the compiler) as valid multi-memory files when reading a file for verifying or writing memories. Note also that if a filename contains a colon as penultimate character, the format field is no longer optional โ since the last character would otherwise be misinterpreted as format. ๐
When reading any kind of flash memory area (including the various sub-areas in Xmega devices), the resulting output file will be truncated to not contain trailing 0xFF bytes which indicate unprogrammed (erased) memory. So if the entire memory is unprogrammed, this will result in an output file that has no contents at all. ๐ This behaviour can be overridden with the -A option.
As an abbreviation, the form -U filename is equivalent to specifying -U flash:w:filename:a. This will only work if filename does not have a pair of colons in it that sandwich a single character โ as otherwise the first part might be interpreted as memory, and the single character as memory operation. โญ
- A file name used for writing to flash that starts with
urboot:autogenerates an urboot bootloader file. Like, try-c dryrun -U urboot:helpfor a list of features that determine what goes into the bootloader. Other than that, there's detailed documentation for autogenerated files in the AVRDUDE pdf manual, eg, athttps://github.com/avrdudes/avrdude/blob/main/avrdude.pdf. And bestie, writingurboot:...files to flash using-Uhas the desired side-effect of also writing all necessary fuse configurations so the bootloader actually works ๐ -v,--verboseโ turns on verbose output. Stack more-voptions to crank the verbosity level higher and higher ๐๏ธ-V,--noverify-memoryโ disables the automatic verify check when writing data to the AVR with-U. (Yes, capital V and lowercase v are two completely different vibes, don't mix them up ๐)--versionโ prints the version and dips โ๏ธ-xextended_param โ passes extended_param to the chosen programmer implementation as an extended parameter. How that parameter gets interpreted is entirely up to the programmer itself, no cap. See below for a list of programmers that accept extended parameters, or runavrdude -x help ...to see the extended options of whatever programmer you chose ๐
๐ฅ๏ธ Terminal mode ๐ฅ๏ธ
Okay so in this mode, avrdude literally just initializes communication with the MCU and then sits there waiting for you to type commands on standard input. Main character energy, honestly. Commands and parameters may be abbreviated down to the shortest unambiguous form. And terminal mode gives you a command history via readline(3), so all your previously entered command lines can be recalled and edited โ no more retyping that whole thing ๐ซถ
The addr and len parameters of the dump, read, disasm, write, save and erase commands can be negative, using the same syntax as substring computations in perl or python. Here's the tea on what they mean, with respect to an example memory of size sz=0x800 (2048 bytes):
- addr
0/positive, len positive โ[addr, addr+len-1]โ note:len = end-start+1 - addr
0/positive, len negative โ[addr, sz+len]โ the end is|len|bytes below memory sizesz - addr negative, len positive โ
[sz+addr, sz+addr+len-1]โ the start is|addr|bytes below memory size - addr negative, len negative โ
[sz+addr, sz+len]โ literally combining the two cases above - addr any, len
0โ empty set โ no action
And the worked examples, because seeing it is believing โจ
0x700/12โ[0x700, 0x70b]โ conventional use1024/-257โ[0x400, 0x6ff]โ size of memory is2048or0x800-512/512โ[0x600, 0x7ff]โ last 512 bytes-256/-1โ[0x700, 0x7ff]โ last 256 bytes0/49โ[0, 48]โ first 49 bytes0/-49โ[0, 1999]โ all but the last 48 =|len+1|bytes0/-1โ[0, 0x7ff]โ all memory without knowing its size
The following commands are implemented for all programmers:
dump memory addr lenโ reads from the specified memory interval (see above) and displays it in the usual hexadecimal and ASCII form. Classic, iconic, we love her ๐dump memory addrโ reads from memory addr as many bytes as the most recentdump memory addr lencommand with this very memory had specified (default256bytes), and displays themdump memoryโ keeps dumping the contents from the same memory where the previousdump memorycommand left off. Continuation queen ๐dumpโ continues dumping from the memory and location where the most recentdumpcommand left off; if no previousdumpcommand has addressed a memory, an error message will be shown ๐dump memory addr ...โ reads all bytes from the specified memory starting at address addr and displays them (deprecated: usedump memory addr -1)dump memory ...โ reads all bytes from the specified memory and displays them (deprecated: usedump memory 0 -1)readโ can be used as an alias fordump. Same girl, different name ๐ฆdisasm [opts] [arguments]โ likedump, thedisasmcommand displays a part of the specified memory, except it interprets the memory contents as AVR opcodes and shows them as assembler source code. Unlikedump,disasmhas options, and those options control how it displays its result (see below). Other than that, the syntax for specifying the memory and its to-be-processed interval is virtually the same asdump: except the default disasm length is32bytes, though, and sometimes the length can be slightly shorter or longer than requested, so that the memory section for disasm aligns with opcodes. Disasm options, once set, stay in force until switched off โ typically by changing the case of the option. That way, a plaindisasmwith no further options can be used to step through memory keeping the same appearance. So convenient, ngl ๐ธ
Disasm knows the following options:
-gโ generate avr-gcc source: this sets-sOFQand outputs a.textpreamble and amainsymbol unless the disassembly emits one itself;-G(the default) switches off-gand stops outputting a preamble-Aโ do not show addresses;-a(the default) shows addresses-Oโ do not show opcode bytes;-o(the default) shows opcode bytes-Cโ do not show comments;-c(the default) shows comments-fโ show affected flags inSREG, eg,---SVNZCfor thesbiwopcode;-F(the default) does not showSREGflags-qโ show the number of machine cycles that an opcode takes;-Q(the default) does not show the cycles-nโ put the opcode full name into the comment, eg,subtract immediate from wordfor thesbiwopcode;-N(the default) does not show the full opcode names-eโ put a technical explanation of the opcode into the comment, eg,Rd+1:Rd <-- Rd+1:Rd - Kfor thesbiwopcode;-E(the default) does not show technical explanations-Sโ use AVR instruction set style: this means register pairs are shown as, eg,r31:30instead ofr30;-s(the default) uses avr-gcc code style-Lโ do not preprocess labels;-l(the default) preprocesses jump/call labels-Uโ do not show unused labels;-u(the default) shows unused tagged labels-dโ decode all opcodes including those that are undocumented;-D(the default) decodes only opcodes that are valid for the part-zโ zap the list of jumps and calls before disassembly. Bye, history ๐-t=<file>โ delete symbols from a previously read tagfile, if any, and read the tagfile<file>for assigning addresses to symbol names
The tagfile is an ASCII file where each line describes a symbol for code label addresses (L), variable addresses in flash (P) and variable addresses in memory or I/O space (M). Hashmarks start a tagfile comment that extends to the end of the line and is ignored by disasm. Here's a defining example of how a tagfile looks, and honestly, it's giving reference sheet:
0x7f54 L putch Outputs a char # L are code labels
0x7ffe P W 1 version16 A word integer # P are PGM data
0x7f80 P A 4 headings Column headers # Auto-aligned strings
0x0100 M B 2048 sram 2 kB SRAM # Memory address
Code labels L can be, eg, function names in program space or goto labels. They use up to four columns separated by white space: the address, the letter L, the symbolic name of the label and an optional comment column for the symbol โ which disasm copies into the disassembly comment column, should this label be referenced or used by the code. Variable symbols have a P or M in the second column; they can be bytes or words (16 bits) as determined by the letter B or W in the third column, and either single variables or arrays as specified by the multiplicity count in the forth column. P symbols โ but not M symbols โ can also encode chars (8 bits), longs (32 bits), quads (64 bits) or octas (128 bits) as signified by the letters C, L, Q or O, respectively, or be the base location of nul-terminated strings as encoded by A or S in the third column. Out of necessity, the space occupied by A/S strings varies. The difference between A and S symbols is that the array of A strings might have an additional nul character to auto-align the space occupied by them to an even address. The fifth column is the symbolic name for the P or M address that can be used by disasm to output relevant addresses symbolically. P areas described in the tagfile also tell disasm that the corresponding area is not code and should not be disassembled as such; instead, the directives .byte, .word, .asciz and sometimes, at the end of the memory section, .ascii are used for disassembly of that area. As with L labels, P and M variables may have an optional final comment column pertaining to the symbol that may be output in the disassembly column as and when the corresponding variables are used ๐
Lowkey, tagfiles are the moment for disassembly โ they make the output of disasm so much more readable ๐. You can build them by hand and grow them incrementally as your understanding of the code levels up. OR, if you're feeling lazy (valid), the bash shell script elf2tag can auto-generate a tag file straight from the .elf file that produced the flash contents:
$ elf2tag file.elf >file.tag
elf2tag uses the avr-objdump -d disassembly to create L labels and avr-nm to generate M symbols. Iconic behaviour, no notes.
๐ซถ write memory addr data[,] {data[,]}
Manually program the respective memory cells, starting at address addr, using the data items you hand it. The terminal implements reading from and writing to flash, EEPROM, bootrow and usersig type memories normally through a cache and paged access functions. All other memories get written to directly with no cache in sight. Also, some older parts without paged access โ depending on your programmer โ might have flash and EEPROM directly accessed without a cache too. It's giving "it depends", bestie.
Now, data can be binary, octal, decimal or hexadecimal integers, floating point numbers, or C-style strings and characters. If nothing matches any of those, data gets interpreted as the name of a file containing data โ which then gets read and inserted right at that point. Wanna force a data item to be read as a file (say, when the file name would be understood as a number otherwise)? Give the file name a :f format specifier. And if there's no format suffix at all, the terminal will try to auto-detect the file format. She's intuitive like that โจ.
A file name that starts with urboot: autogenerates an urboot bootloader file. Try, for example, the terminal command write flash urboot:help for a list of features that determine the contents of the bootloader. Other than that, there's detailed documentation for autogenerated files in the AVRDUDE pdf manual, e.g., at https://github.com/avrdudes/avrdude/blob/main/avrdude.pdf. Worth noting here: writing urboot:... files to flash in the terminal does not write the necessary fuses for the bootloader to work (in contrast to -U operations). Read that twice, bestie ๐ซถ.
For integers, an optional case-insensitive suffix specifies the data size: HH 8 bit, H/S 16 bit, L 32 bit, LL 64 bit. Suffix D indicates a 64-bit double, F a 32-bit float, whilst a floating point number without a suffix defaults to 32-bit float. Hexadecimal floating point notation is supported. An ambiguous trailing suffix, e.g., 0x1.8D, is read as a no-suffix float where D is part of the mantissa โ so use a zero exponent like 0x1.8p0D to clarify. Not me almost falling for that one ๐ญ.
An optional U suffix makes integers unsigned. Ordinary 0x hexadecimal and 0b binary integers are always treated as unsigned. +0x, -0x, +0b and -0b numbers with an explicit sign are treated as signed unless they have a U suffix. Unsigned integers cannot be larger than 2^64-1. If n is an unsigned integer then -n is also a valid unsigned integer, as in C. Signed integers must fall into the [-2^63, 2^63-1] range โ or a correspondingly smaller range when a suffix specifies a smaller type.
Ordinary 0x hexadecimal and 0b binary integers with n digits (counting leading zeros) use the smallest size of one, two, four and eight bytes that can accommodate any n-digit hexadecimal/binary integer. If an integer suffix specifies a size explicitly, the corresponding number of least significant bytes are written, and a warning is shown if the number doesn't fit into the desired representation. Otherwise, unsigned integers occupy the smallest of one, two, four or eight bytes needed. Signed numbers are allowed to fit into the smallest signed or smallest unsigned representation โ for example, 255 is stored as one byte as 255U would fit in one byte, even though as a signed number it wouldn't fit into a one-byte interval [-128, 127]. The number -1 is stored in one byte, whilst -1U needs eight bytes as it is the same as 0xFFFFffffFFFFffffU. Math ate, honestly ๐
.
One trailing comma at the end of data items is ignored, to facilitate copy & paste of lists. We love a forgiving parser.
๐ฆ write memory data
The start address may be omitted if the size of the memory being written to is one byte. data can be anything, including a file. Anything. Sky's the limit.
๐ธ write memory file
The start address may be omitted when a file is written to the memory. Simple as that, no cap.
๐ write memory addr len data[,] {data[,]} ...
The ellipsis ... form writes the data to the entire memory interval addressed by addr len and, if necessary, pads the remaining space by repeating the last data item. The fill write command does not write beyond the specified memory area, even if more data than needed were given. Boundaries are respected here, periodt.
๐ save memory {addr len} file[:format]
Save one or more memory segments to a file in a format specified by the :format letter. The default is :r for raw binary. Each memory segment is described by an address and length pair. In absence of any memory segments, the entire memory is saved to the file. Only Motorola S-Record (:s) and Intel Hex (:i or :I) formats store address information with the saved data. Avrdude cannot currently save ELF file formats. All the other file formats lose the address information and concatenate the chosen memory segments into the output file. And if the file name is - then avrdude writes to stdout. Cute.
๐ backup memlist file[:format]
Backup one or more memories to the specified file using the selected format. The default format for a single-memory backup is :r (raw binary); for multi-memory backups it's :I (Intel Hex with comments). Memlist can be a comma separated list of memories, just as in the -U command line argument. backup flushes the cache before reading memories. Safety first, bestie.
โญ restore memlist file[:format]
Restore one or more memories from the specified file. It is the user's responsibility to erase memories as needed beforehand ๐ โ some paged memories look like NOR-memory when using certain programmers, meaning programming cannot set bits to 1 (e.g., flash under most programmers). Those memories need to be erased beforehand using the erase command (see below). The format only needs to be specified if it cannot be automatically detected, e.g., when the file is - for standard input. Memlist can be a comma separated list of memories just as in the -U command line argument. restore flushes the cache before writing memories and resets the cache after writing memories. Note that restoring read-only memories verifies file contents with the corresponding microprocessor's memories. Read-only means read-only, she's not budging ๐
.
๐ง verify memlist file[:format]
Compare one or more memories with the specified file. Memlist can be a comma separated list of memories just as in the -U command line argument. verify flushes the cache before verifying memories. Gotta make sure it actually landed, y'know?
๐ฅ erase
Perform a chip erase and discard all pending writes to flash, EEPROM and bootrow. Note that EEPROM will be preserved if the EESAVE fuse bit is active, i.e., had a corresponding value at the last reset prior to the operation. She remembers what you told her last reset. Iconic.
๐ erase memory
Erase the entire specified memory. All of it. Gone.
๐ธ erase memory addr len
Erase a section of the specified memory. Just the section, we're being precise today.
๐ flush
Synchronise with the device all pending writes to flash, EEPROM, bootrow and usersig. With some programmer and part combinations, flash (and sometimes EEPROM, too) looks like a NOR memory โ i.e., a write can only clear bits, never set them. For NOR memories a page erase or, if not available, a chip erase needs to be issued before writing arbitrary data. usersig is unaffected by a chip erase.
When a memory looks like a NOR memory, either page erase is deployed (e.g., with parts that have PDI/UPDI interfaces), or โ if that's not available โ both EEPROM and flash caches are fully read in, a chip erase command is issued and both EEPROM and flash are written back to the device ๐ญ. Hence, it can take minutes to ensure that a single previously cleared bit is set and, therefore, this routine should be called sparingly.
Fr fr, flush is not a "call it every loop" kind of girl. She's main character energy with main character consequences.
๐ abort
Normally, caches are only ever actually written to the device when using the flush command, at the end of the terminal session after typing quit, or after EOF on input is encountered. The abort command resets the cache, discarding all previous writes to the flash, EEPROM, bootrow and usersig cache. It's the "nvm bestie, forget I said anything" of commands ๐ซถ.
config {<-f|-a|-v>}โ shows you everything about the config properties of the part, bestie. These are usually bitfields living inside fuses or lock bits bytes that can take on values, and those values typically have a mnemonic name ๐. Every part has its own little set of configurable items, no cap.-fgroups the config properties by the fuses and lock bits byte they're housed in, and shows you the current value of those memories too. so organized โจ-aoutputs an initialisation script with all the properties and all possible respective assignments. The mnemonic values that are currently assigned are the ones that are not commented out โ that's your tell ๐ซถ-vjust cranks up the verbosity of theconfigcommand's output. louder = more info ๐
config {<-f|-v>} <property> {<-f|-v>}โ shows the current value of the named configuration property. Wildcards or initial strings are permitted (but not both, pick a lane ๐), and in that case the current values of all matching properties get displayed. cute little search vibe ๐config {<-f|-v>} <property>= {<-f|-v>}โ shows all possible values of the named configuration property โ notice the trailing=bestie, it's doing heavy lifting ๐. The one that's currently set is the only one not commented out. As before, wildcards or initial strings are permitted.config {<-f|-v|-c>} <property>=<value> {<-f|-v|-c>}โ modifies the named configuration property to the given value. The corresponding fuse or lock bits get changed immediately, but the change will normally only take effect the next time the part is reset โ that's when the fuses and lock bits are utilised. Value can either be a valid integer or one of the symbolic mnemonics, if known. Wildcards or initial strings are permitted for either the property or the assigned mnemonic value, but an assignment only happens if both the property and the name can be uniquely resolved โ no ambiguous vibes allowed ๐ค. Option-vshows the value of the assigned configuration property by reading it again from the fuse. In absence of-v, the option-cconfirms the new value of the configuration property only if it has changed.
ok so real talk time ๐ โ it is quite possible, as is with direct writing to the underlying fuses and lock bits, to brick a part, i.e., make it unresponsive to further programming with the chosen programmer. here be dragons ๐๐ฅ
factory resetโ resets the connected part to factory state as far as possible (bootloaders, for example, cannot write fuses and may not have a means to erase EEPROM ๐ฅฒ). This command may change the clock frequencyF_CPUof the part after the next MCU reset, when the changed fuse values come into effect. As such, this may require that futureavrdudecalls use a different bit clock rate, up toF_CPU/4, for the programmer next time. Heads up: the commandfactorycan be abbreviated, but the required argumentresetneeds to be spelled out in full โ full government name energy ๐regfile {<opts>}โregfilewith no further argument displays the register file of a part, i.e., all register names and their contents in io memory, if possible. Note that external programming cannot read the registers of classic parts (ISP or TPI interfaces) ๐ญ.- Option
-adisplays the register I/O addresses in addition -mdisplays the register memory addresses used forlds/stsopcodes instead of the I/O addresses- Option
-salso shows the size of the register in bytes - whilst
-vshows a slightly expanded register explanation alongside each register โจ
- Option
regfile {<opts>} <reg> {<opts>}โregfiletogether with a register name reg shows all those registers that are matched by reg. Wildcards or partial strings are permitted but not both. Register names have the formmodule.nameormodule.instance.name. If the provided reg is a full, existing register name, e.g.,porta.out, then that is the only register that is displayed โ even though that might be a partial name of another register, eg,porta.outdir๐ซ . If what you provided is the same asinstance.nameorname, then partial matching is no longer utilised and all module registers with that exactinstance.nameornameare shown. Partial matching can be forced through use of wildcards, e.g.,porta.out*๐regfile {<opts>} <reg>=<value> {<opts>}โ this sets a single register addressed by reg to the given value. Only external programming of modern parts (those with UPDI interface) can read from and write to register io memory, but as that memory is volatile, the contents will be lost after reset ๐ธinclude [<opts>] <file>โ includes contents of the named file as if it was typed. This is useful for batch scripts, e.g., recurring initialisation code for fuses ๐ง. The include option-eprints the lines of the file as comments before processing them; on a non-zero verbosity level the line numbers are printed, too.sigโ display the device signature bytes โญpartโ display the current part information, including supported programming modes, memory and variants tables. Use-mto only print the memory table, and-vto only print the variants table ๐verbose [level]โ change (when level is provided), or display the verbosity level. The initial verbosity level is controlled by the number of-voptions given on the commandline.quell [level]โ change (when level is provided), or display the quell level.1is used to suppress progress reports.2or higher yields in progressively quieter operations ๐คซ. The initial quell level is controlled by the number of-qoptions given on the commandline.?,helpโ give a short on-line summary of the available commands ๐ซถquitโ leave terminal mode and thusavrdude. bye bestie ๐qโ can be used as an alias forquit.!<line>โ run the shell <line> in a subshell, e.g.,!ls *.hex. Subshell commands take the rest of the line as their command. For security reasons, they must explictly be enabled by puttingallow_subshells = yes;into your${HOME}/.config/avrdude/avrdude.rcor${HOME}/.avrdudercfile ๐# <comment>โ place comments onto the terminal line (useful for scripts) ๐
The terminal commands below may only be implemented on some specific programmers, and may therefore not be available in the help menu ๐
pgerase memory addrโ erase one page of the memory specified.send b1 b2 b3 b4โ send raw instruction codes to the AVR device. If you need access to a feature of an AVR part that is not directly supported byavrdude, this command allows you to use it, even thoughavrdudedoes not implement the command ๐. When using direct SPI mode, up to 3 bytes can be omitted.spiโ enter direct SPI mode. Thepgmledpin acts as chip select. Supported on parallel bitbang programmers, and partially by USBtiny.pgmโ return to programming mode (from direct SPI mode). we're so back ๐ฅvtarg voltageโ set the target's supply voltage to voltage Volts. Supported on the STK500 and STK600 programmer.varef [channel] voltageโ set the adjustable voltage source to voltage Volts. This voltage is normally used to drive the target's Aref input on the STK500. On the Atmel STK600, two reference voltages are available, which can be selected by the optional channel argument (either0or1). Supported on the STK500 and STK600 programmer โกfosc freq[M|k]โ set the programming oscillator to freq Hz. An optional trailing letterMmultiplies by1E6, a trailing letterkby1E3. Supported on the STK500 and STK600 programmer.fosc offโ turn the programming oscillator off. Supported on the STK500 and STK600 programmer.sck periodโ set the SCK clock period to period microseconds. Note that some official Microchip programmers store the bitclock setting and will continue to use it until a diferent value is provided ๐ซ . See-B bitclockfor more information.parmsโ display programmer specific parameters.
๐ Default Parallel port pin connections ๐
(these can be changed, see the -c option)
- Pin
2-5โ Vcc (optional power supply to MCU) - Pin
7โ/RESET(to MCU) - Pin
8โSCK(to MCU) - Pin
9โSDO(to MCU) - Pin
10โSDI(from MCU) - Pin
18-25โGND
๐ฆ DebugWIRE limitations
okay so real talk, the debugWIRE protocol is Atmel's proprietary one-wire (plus ground) situation โ it lets you do in-circuit emulation of the smaller AVR devices, and it rides on the /RESET line. You kick DebugWIRE mode off by activating the DWEN fuse, and then power-cycling the target. It's mostly meant for debugging/emulation, but bestie, it does offer limited programming capabilities too. ๐
Effectively the only memory areas you can read or program in this mode are flash ROM and EEPROM. You can also read out the signature. Everything else? Not accessible, sorry babe. ๐ซ
There is no chip erase functionality in debugWIRE mode. Instead, while reprogramming the flash ROM, each flash ROM page gets erased right before it's updated. That's done transparently by the JTAG ICE mkII (or AVR Dragon), so like, don't panic when you see it. โจ
The only way back from debugWIRE mode is to initiate a special sequence of commands to the JTAG ICE mkII (or AVR Dragon), so debugWIRE mode gets temporarily disabled and the target can be accessed using normal ISP programming. That sequence is automatically initiated by using the JTAG ICE mkII or AVR Dragon in ISP mode, when they detect that ISP mode cannot be entered. Kind of iconic of them tbh. ๐
๐ FLIP version 1 idiosyncrasies
Bootloaders using the FLIP protocol version 1 have some very specific behaviour, and you need to know about it. ๐ซถ
These bootloaders have no option to access memory areas other than Flash and EEPROM.
When the bootloader is started, it enters a security mode where the only acceptable access is to query the device configuration parameters (which are used for the signature on AVR devices). The only way to leave this mode is a chip erase. And since a chip erase is normally implied by the -U option when reprogramming the flash, this peculiarity might not be very obvious immediately. Like, it's lowkey sneaky. ๐
Sometimes, a bootloader with security mode already disabled seems to no longer respond with sensible configuration data, but only 0xFF for all queries. Since these queries are used to obtain the equivalent of a signature, avrdude can only continue in that situation by forcing the signature check to be overridden with the -F option.
A chip erase might leave the EEPROM unerased, at least on some versions of the bootloader. ๐
๐ Programmers accepting extended parameters
dryrun
dryboot
These two programmers emulate programming and accept the following parameters:
initโ Initialise memories with human-readable patterns. Flash memory will be randomly configured with respect to bootloader, data and code length. Patterns can best be seen with fixed-width font and the:Iformat by inspecting the generated hex file or by using, eg,-U flash:r:-:I. Patterns in flash memory are executable and represent benign AVR code, ie, no I/O memory access. Choose a fixed seed for reproducible results.init=<n>โ Shortcut for-x init -x seed=<n>(see below)randomโ Initialise memories with random code and values. Flash memory will be randomly configured with respect to bootloader, data and code length. Random code in flash will be benign, that is, not accessing I/O memories, SRAM or flash. Choose a fixed seed for reproducible results.random=<n>โ Shortcut for-x random -x seed=<n>seed=<n>โ Seed random number generator with<n>; the default istime(NULL). Setting this option with a fixedn> 0 will make the random choices reproducible, ie, they will stay the same between different avrdude runs. ๐ฒhelpโ Show help menu and exit.
JTAG ICE mkII
JTAGICE3
Atmel-ICE
Power Debugger
PICkit 4
MPLAB SNAP
AVR Dragon
When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE, PICkit 4, MPLAB SNAP, Power Debugger or AVR Dragon in JTAG mode, the following extended parameter is accepted:
jtagchain=UB,UA,BB,BAโ Setup the JTAG scan chain forUBunits before,UAunits after,BBbits before, andBAbits after the target AVR, respectively. Each AVR unit within the chain shifts by 4 bits. Other JTAG units might require a different bit shift count. ๐hvupdiโ Power Debugger and PICkit 4 only. High-voltage UPDI programming is used to enable a UPDI pin that has previously been set to RESET or GPIO mode. Use-x hvupdito enable high-voltage UPDI initialization for targets that supports this.vtarg=VALUE,vtargโ Power Debugger only. The voltage generator can be enabled by setting a target voltage. The current set-voltage can be read by-x vtargalone.helpโ Show help menu and exit.
PICkit 4
MPLAB SNAP
mode=avr,picโ Switch programmer to AVR or PIC mode, then exit: the PICkit 4 and MPLAB SNAP programmer can only be utilised by avrdude when in AVR mode. Use-x mode=avrfor switching to AVR mode, or-x mode=picfor switching to PIC mode. ๐helpโ Show help menu and exit.
PICkit 5
PICkit 4 (PIC mode)
vtarg=<voltage>โ Specify a voltage between 1.8 and 5.5 V that the programmer should supply to the target. If there is already a valid voltage applied to the VTG Pin, this setting will be ignored. When AVRDUDE detects an external voltage outside of this range, it will terminate the operation. You can disable this check by setting the voltage to 0 V. If an XMEGA part was selected, a requested voltage above 3.49 V will lead to an abort of operation. โกhvupdiโ High-voltage UPDI programming is used to enable a UPDI pin that has previously been set to RESET or GPIO mode. Use-x hvupdito enable high-voltage UPDI initialization for supported targets. Depending on the target, the HV pulse will be applied either on the RST pin, or the UPDI pin.helpโ Show help menu and exit.
Xplained Mini (ISP and UPDI)
suffer=VALUE,sufferโ The SUFFER register allows the user to modify the behavior of the on-board mEDBG. The current state can be read by-x sufferalone. ๐ญ (and yes the name is a whole mood)- Bit 7 ARDUINO: Adds control of extra LEDs when set to 0
- Bit 6..3: Reserved (must be set to 1)
- Bit 2 EOF: Agressive power-down, sleep after 5 seconds if no USB enumeration when set to 0
- Bit 1 LOWP: forc running the mEDBG at 1 MHz when bit set to 0
- Bit 0 FUSE: Fuses are safe-masked when bit sent to 1. Fuses are unprotected when set to 0
vtarg_switch=VALUE,vtarg_switchโ The on-board target voltage switch can be turned on or off by writing a 1 or a 0. The current state can be read by-x vtarg_switchalone. Note that the target power switch will always be on after a power cycle. Also note that the smaller Xplained Nano boards does not have a target power switch. ๐ซถhelpโ Show help menu and exit.
Curiosity Nano
vtarg=VALUE,vtargโ The generated on-board target voltage can be changed by specifying a new voltage. The current set-voltage can be read by-x vtargalone.helpโ Show help menu and exit.
STK500
STK600
vtarg=VALUE,vtargโ The generated on-board target voltage can be changed by specifying a new voltage. The current set-voltage can be read by-x vtargalone.fosc=VALUE[MHz|M|kHz|k|Hz|H],foscโ Set the programmable oscillator frequency. The current frequency can be read by-x foscalone. ๐
โฆstill deep in the -x extended-parameter zone, bestie, no worries โ we're picking up right where we left off ๐
varef=VALUE,varefโ the generated on-board analog reference voltage can be changed by handing it a new reference voltage. Wanna just read what it's currently set to? Call-x varefon its own. ๐varef[0,1]=VALUE,varef[0,1]โ STK600 only, bestie. Same deal as above but for channel 0 or channel 1: give it a new reference voltage to change the generated on-board analog reference voltage. And the current reference voltage can be read by calling-x varef0or-x varef1alone. โจattemps[=<1..99>]โ STK500V1 only. Tells it how many connection retry attemps to perform before exiting. Defaults to10if you don't specify. (yes, that's spelledattempsin the real option, iykyk, do not "fix" it ๐)xtal=VALUE[MHz|M|kHz|k|Hz|H]โ defines the XTAL frequency of the programmer, for when it differs from the7.3728 MHzof the original STK500. avrdude uses this to calculatefoscandsckcorrectly. ๐ฅhelpโ show help menu and exit. ๐ซถ
๐ฆ AVR109 ๐ฆ
autoresetโ toggle RTS/DTR lines on port open to issue a hardware reset.helpโ show help menu and exit.
๐ธ AVR910 ๐ธ
devcode=VALUEโ override the device code selection by usingVALUEas the device code. The programmer is not queried for the list of supported device codes, and the specifiedVALUEis not verified โ it's used directly within the'T'command sent to the programmer.VALUEcan be specified using the conventional number notation of the C programming language. ๐no_blockmodeโ disables the default checking for block transfer capability. Only useno_blockmodeif your AVR910 programmer creates errors during the initial sequence. โ ๏ธhelpโ show help menu and exit.
๐ Arduino ๐
attemps[=<1..99>]โ how many connection retry attemps to perform before exiting. Defaults to10if not specified.noautoresetโ don't toggle RTS/DTR lines on port open, so a hardware reset doesn't happen. ๐helpโ show help menu and exit.
๐ Urclock ๐
showallโ show all info for the connected part, then exit. The-x show...options below can be used to assemble a bespoke response consisting of a subset (or only one item) of all available relevant information about the connected part and bootloader. โจshowidโ show a unique Urclock ID stored in either flash or EEPROM of the MCU, then exit.id=<E|F>.<addr>.<len>โ so, historically the Urclock ID was a six-byte unique little-endian number stored in Urclock boards at EEPROM address257. The location of this number can be set by the-x id=<E|F>.<addr>.<len>extended parameter.Estands for EEPROM andFstands for flash. A negative address addr counts from the end of EEPROM and flash, respectively. The length len of the Urclock ID can be between1and8bytes. ๐showdateโ show the last-modified date of the input file for the flash application, then exit. If the input file was stdin, the date will be that of the programming. Date and filename are part of the metadata that the urclock programmer stores by default in high flash just under the bootloader; see also-x nometadata. ๐๏ธshowfilenameโ show the input filename (or title) of the last flash writing session, then exit.title=<string>โ when set, <string> will be used in lieu of the input filename. The maximum string length for the title/filename field is254bytes including the terminating nul. ๐showappโ show the size of the programmed application, then exit.showstoreโ show the size of the unused flash between the application and metadata, then exit.showmetaโ show the size of the metadata just below the bootloader, then exit.showbootโ show the size of the bootloader, then exit.showversionโ show bootloader version and capabilities, then exit. ๐showvectorโ show the vector number and name of the interrupt table vector used by the bootloader for starting the application, then exit. For hardware-supported bootloaders this will be vector0(Reset), and for vector bootloaders this will be any other vector number of the interrupt vector table, or the slot just behind the vector table with the nameVBL_ADDITIONAL_VECTOR. ๐showpartโ show the part for which the bootloader was compiled, then exit.bootsize=<size>โ manual override for bootloader size. Urboot bootloaders put the number of used bootloader pages into a table at the top of the bootloader section, i.e., typically the top of flash, so the urclock programmer can look up the bootloader size all by itself. In backward-compatibility mode, when programming via other bootloaders, this option can be used to tell the programmer the size โ and therefore the location โ of the bootloader. ๐งvectornum=<n>โ manual override for vector number. Urboot bootloaders put the vector number used by a vector bootloader into a table at the top of flash, so this option is normally not needed for urboot bootloaders. However, it's useful in backward-compatibility mode (or when the urboot bootloader does not offer flash read). Specifying a vector number in these circumstances implies a vector bootloader, whilst the default assumption would be a hardware-supported bootloader. ๐eepromrwโ manual override for asserting EEPROM read/write capability. Not normally needed for urboot bootloaders, but useful in backward-compatibility mode if the bootloader offers EEPROM read/write.emulate_ceโ if an urboot bootloader does not offer a chip erase command, it will tell the urclock programmer so during the handshake. In that case the urclock programmer emulates a chip erase โ if it's warranted by the user's command line options โ by filling the remainder of unused flash below the bootloader with0xff. If this option is specified, the urclock programmer will assume that the bootloader cannot erase the chip itself. Super useful for backwards-compatible bootloaders that don't implement chip erase. ๐ฅrestoreโ write unchanged flash input files and trim below the bootloader if needed. This is most useful when you've got a backup of the full flash and wanna play that back onto the device. No metadata are written in this case, and no vector patching happens either if it's a vector bootloader. However, for vector bootloaders, even under the option-x restorean input file will not be written to the AVR for which the reset vector does not point to the vector bootloader โ this is to avoid writing an input file to the device that would render the vector bootloader not functional, since it would not be reached after reset. โ ๏ธ๐
fr fr, that restore caveat is the one to tattoo on your brain: no reset-vector-pointing-at-the-bootloader = no write happening. ๐ซถ
-x initstoreโ when you're writing to flash, fill the store space between the flash application and the metadata section with0xff. That's it, that's the whole vibe ๐-x nofilenameโ on writing to flash, don't store the application input filename (nor a title). Your flash doesn't need to remember names, bestie ๐ซถ-x nodateโ on writing to flash, don't store the application input filename (nor a title) and no date either. No name, no date, no receipts ๐-x nostoreโ on writing to flash, don't store metadata except the metadata code byte0xffsaying there are no metadata. In particular, no data store frame is programmed. Minimalist queen โจ-x noautoresetโ don't toggleRTS/DTRlines on port open, which prevents a hardware reset. Sometimes you just don't wanna wake the baby ๐ด-x nometadataโ do not support any metadata. The full flash besides the bootloader is available for the application. If the application is smaller than the available space, then a metadata code byte0xffis stored nevertheless, to indicate there are no further metadata available. In absence of-x nometadata, the default for the urclock programmer is to write as much metadata (filename, data and store information) as the size of the application and the other extended options allow. The subtle difference between-x nometadataand-x nostoreis that the latter always explicitly stores in flash that no further metadata are available, so that a such prepared flash can always be queried withavrdude -x showall. In contrast to this, it cannot be guaranteed that a-x showallquery on flash prepared with-x nometadatayields useful results. iykyk โ the difference is lowkey everything ๐ฅ-x delay=<n>โ add a<n>ms delay after reset. This can be useful if a board takes a particularly long time to exit from external reset.<n>can be negative, in which case the default120ms delay after issuing reset will be shortened accordingly. Negative delay is giving time-travel energy โณ-x strictโ urclock has a faster, but slightly different strategy than-c arduinoto synchronise with the bootloader; some stk500v1 bootloaders cannot cope with this, and they need the-x strictoption. Be gentle with the old ones ๐ง-x helpโ show help menu and exit. Always here to help ๐ซถ
๐ธ buspirate ๐ธ
-x reset=cs,aux,aux2โ the default setup assumes the BusPirate'sCSoutput pin is connected to theRESETpin on the AVR side. It is however possible to have multiple AVRs connected to the same BP withSDI,SDOandSCKlines common for all of them. In such a case one AVR should have itsRESETconnected to BusPirate'sCSpin, a second AVR'sRESETconnected to BusPirate'sAUXpin, and if your BusPirate has anAUX2pin (only available on BusPirate version v1a with firmware 3.0 or newer) use that to activateRESETon the third AVR. Multi-AVR main character energy ๐
It may be a good idea to decouple the BusPirate and the AVR's SPI buses from each other using a 3-state bus buffer. For example 74HC125 or 74HC244 are some good candidates, with the latches driven by the appropriate reset pin (cs, aux or aux2). Otherwise the SPI traffic in one active circuit may interfere with programming the AVR in the other design. Don't let the buses gossip behind each other's backs ๐
-x spifreq=<0..7>โ the SPI speed for the Bus Pirate's binary SPI mode:
0 .. 30 kHz (default)
1 .. 125 kHz
2 .. 250 kHz
3 .. 1 MHz
4 .. 2 MHz
5 .. 2.6 MHz
6 .. 4 MHz
7 .. 8 MHz
-x rawfreq=<0..3>โ sets the SPI speed and uses the Bus Pirate's binary "raw-wire" mode:
0 .. 5 kHz
1 .. 50 kHz
2 .. 100 kHz (Firmware v4.2+ only)
3 .. 400 kHz (v4.2+)
The only advantage of the "raw-wire" mode is the different SPI frequencies available. Paged writing is not implemented in this mode. No pages, no problem (jk, it's a limitation) ๐ญ
-x asciiโ attempt to use ASCII mode even when the firmware supports BinMode (binary mode). BinMode is supported in firmware 2.7 and newer, older FW's either don't have BinMode or their BinMode is buggy. ASCII mode is slower and makes the abovereset=,spifreq=andrawfreq=parameters unavailable. Be aware that ASCII mode is not guaranteed to work with newer firmware versions, and is retained only to maintain compatibility with older firmware versions. Retro vibes, but at a cost ๐-x nopagedwriteโ firmware versions 5.10 and newer support a binary mode SPI command that enables whole pages to be written to AVR flash memory at once, resulting in a significant write speed increase. If use of this mode is not desirable for some reason, this option disables it. Speedrun strats, cancelled ๐โโ๏ธ-x nopagedreadโ newer firmware versions support in binary mode SPI command some AVR Extended Commands. Using the "Bulk Memory Read from Flash" results in a significant read speed increase. If use of this mode is not desirable for some reason, this option disables it. Same energy, read edition ๐-x cpufreq=<125..4000>โ this sets theAUXpin to output a frequency of n kHz. Connecting theAUXpin to theXTAL1pin of your MCU, you can provide it a clock, for example when it needs an external clock because of wrong fuses settings. Make sure the CPU frequency is at least four times the SPI frequency. Wrong fuses are a whole mood, and this is the rescue plan ๐ฉน-x serial_recv_timeout=<1...>โ this sets the serial receive timeout to the given value. The timeout happens every time avrdude waits for the BusPirate prompt. Especially in ascii mode this happens very often, so setting a smaller value can speed up programming a lot. The default value is100ms. Using10msmight work in most cases. Patience is a virtue but also a bottleneck โฑ๏ธ-x helpโ show help menu and exit.
๐ฆ Micronucleus bootloader ๐ฆ
-x wait[=<timeout>]โ if the device is not connected, wait for the device to be plugged in. The optionaltimeoutspecifies the connection time-out in seconds. If no time-out is specified, AVRDUDE will wait indefinitely until the device is plugged in. It's giving "I'll wait for you" rom-com energy ๐ญ๐-x helpโ show help menu and exit.
๐ Teensy bootloader ๐
-x wait[=<timeout>]โ if the device is not connected, wait for the device to be plugged in. The optionaltimeoutspecifies the connection time-out in seconds. If no time-out is specified, AVRDUDE will wait indefinitely until the device is plugged in. Same waiting-room situation as above, fr fr ๐ซถ-x helpโ show help menu and exit.
โญ Wiring โญ
When using the Wiring programmer type, the following optional extended parameters are accepted:
-x snooze=<n>โ after performing the port open phase, AVRDUDE will wait/snooze for snooze milliseconds before continuing to the protocol sync phase. No toggling ofDTR/RTSis performed if snooze is greater than 0. A little nap before the sync, iconic behaviour ๐ดโจ-x delay=<n>โ add a<n>milliseconds delay after resetting the part through toggling theDTR/RTSlines. This can be useful if a board takes a particularly long time to exit from external reset.<n>can be negative, in which case the default100ms delay after issuing reset will be shortened accordingly. Note the default here is100ms, not120โ different programmer, different rules ๐noautoresetโ Don't toggleRTS/DTRlines on port open to prevent a hardware reset.helpโ Show help menu and exit.
๐ PICkit2 ๐
Connection to the PICkit2 programmer:
(AVR) (PICkit2)
RST - VPP/MCLR (1)
VDD - VDD Target (2) -- possibly optional if AVR self powered
GND - GND (3)
SDI - PGD (4)
SCLK - PDC (5)
SDO - AUX (6)
clockrate=<rate>โ Sets the SPI clocking rate in Hz (default is100kHz). Alternately the-Bor-ioptions can be used to set the period.timeout=<usb-transaction-timeout>โ Sets the timeout for USB reads and writes in milliseconds (default is1500 ms).helpโ Show help menu and exit.
๐งธ USBasp ๐งธ
section_configโ Programmer will erase configuration section with option-e(chip erase), rather than entire chip. Only applicable to TPI devices (ATtiny 4/5/9/10/20/40).helpโ Show help menu and exit.
๐ xbee ๐
xbeeresetpin=<1..7>โ Select the XBee pinDIO<1..7>that is connected to the MCU'sโ/RESETโline. The programmer needs to know which DIO pin to use to reset into the bootloader. The default (3) is theDIO3pin (XBeepin17), but some commercial products use a different XBee pin.
The remaining two necessary XBee-to-MCU connections are not selectable - the XBee DOUT pin (pin 2) must be connected to the MCU's โRXDโ line, and the XBee DIN pin (pin 3) must be connected to the MCU's โTXDโ line.
helpโ Show help menu and exit.
๐ฆ jtag2updi ๐ฆ
๐ฆ serialupdi ๐ฆ
rtsdtr=low,highโ ForcesRTS/DTRlines to assume low or high state during the whole programming session. Some programmers might use this signal to indicateUPDIprogramming state, but this is strictly hardware specific.
When not provided, driver/OS default value will be used.
helpโ Show help menu and exit.
๐ธ linuxspi ๐ธ
disable_no_csโ Ensures the programmer does not use theSPI_NO_CSbit for the SPI driver. This parameter is useful for kernels that do not support theCSline being managed outside the application.helpโ Show help menu and exit.
โญ serprog โญ
csโ Sets the chip select (CS) to use on supported programmers. Programmers supporting the0x16serprog command can have more than the defaultCS(0). This option allows to choose these additionalCSes (1,2, ...) for programming the AVR.helpโ Show help menu and exit.
๐
Programmers accepting exitspec parameter ๐
Currently, only the flip2, linuxspi, linuxgpio, raspberry_pi_gpio, pickit4_mplab, pickit5 and old-school parallel port programmers such as stk200 and dapa support exitspec parameter. These let the user decide in which state the programmer pins after ended programming session. Multiple exitspec options can be separated with commas.
flip2
linuxspi
linuxgpio
raspberry_pi_gpio
Parallel port programmers
helpโ Show help menu and exit.resetโ Theโ/RESETโsignal will be left activated at program exit, that is it will be held low, in order to keep the MCU in reset state afterwards. Note in particular that the programming algorithm for theAT90S1200device mandates that theโ/RESETโsignal is active before powering up the MCU, so in case an external power supply is used for this MCU type, a previous invocation ofavrdudewith this option specified is one of the possible ways to guarantee this condition.noresetโ Theโ/RESETโline will be deactivated at program exit, thus allowing the MCU target program to run while the programming hardware remains connected.
๐ Parallel port programmers ๐
vccโ This option will leave those parallel port pins active (i. e. high) that can be used to supplyโVccโpower to the MCU.novccโ This option will pull theโVccโpins of the parallel port down at program exit.d_highโ This option will leave the 8 data pins on the parallel port active. (i. e. high)d_lowโ This option will leave the 8 data pins on the parallel port inactive. (i. e. low)
๐ Pickit 4 (MPLAB) ๐
๐ Pickit 5 ๐
vccโ This option will leave the power supply from the programmer enabled afteravrdudefinished the operation. Disabled by default.
๐๏ธ FILES ๐๏ธ
/dev/ppi0โ Default device to be used for communication with the programming hardware.avrdude.confโ Programmer and parts configuration file.
On Windows systems, this file is looked up in the same directory as the executable file. On all other systems, the file is first looked up in ../etc/, relative to the path of the executable, then in the same directory as the executable itself, and finally in the system default location ${PREFIX}/etc/avrdude.conf.
${XDG_CONFIG_HOME}/avrdude/avrdude.rcโ Local programmer and parts configuration file (per-user overrides); it follows the same syntax asavrdude.conf; if the${XDG_CONFIG_HOME}environment variable is not set or empty, the directory${HOME}/.config/is used instead.${HOME}/.avrdudercโ Alternative location of the per-user configuration file if above file does not exist.~/.inputrcโ Initialization file for thereadline(3)library.<prefix>/share/doc/avrdude/avrdude.pdfโ User manual.
๐จ DIAGNOSTICS ๐จ
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWIRE
avrdude: Target prepared for ISP, signed off.
avrdude: Please restart avrdude without power-cycling the target.
If the target AVR has been set up for debugWIRE mode (i.e., the DWEN fuse is programmed), normal ISP connection attempts will fail as the /RESET pin is not available. When using the JTAG ICE mkII in ISP mode, the message shown indicates that avrdude has guessed this condition, and tried to initiate a debugWIRE reset to the target. When successful, this will leave the target AVR in a state where it can respond to normal ISP communication again (until the next power cycle). Typically, the same command is going to be retried again immediately afterwards, and will then succeed connecting to the target using normal ISP communication.
๐ SEE ALSO ๐
avr-objcopy(1), ppi(4), libelf(3), readline(3)
The AVR microcontroller product description can be found at
https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/8-bit-mcus/avr-mcus
๐ AUTHORS ๐
Avrdude was initially written by Brian S. Dean <bsd@bdmicro.com>.
This man page is by Joerg Wunsch with updates from Hans Eirik Bull and Stefan Rรผger amongst others.
๐ BUGS ๐
Please report bugs via
https://github.com/avrdudes/avrdude/issues
The JTAG ICE programmers currently cannot write to the flash ROM one byte at a time. For that reason, updating the flash ROM from terminal mode does not work.
Page-mode programming the EEPROM through JTAG (i.e., through an -U option) requires a prior chip erase. This is an inherent feature of the way JTAG EEPROM programming works. This also applies to the STK500 and STK600 in parallel programming mode.
The USBasp and USBtinyISP drivers do not offer any option to distinguish multiple devices connected simultaneously, so effectively only a single device is supported.
Chip Select must be externally held low for direct SPI when using USBtinyISP, and send must be a multiple of four bytes.
The avrftdi driver allows one to select specific devices using any combination of vid,pid serial number (usbsn) vendor description (usbvendoror part description (usbproduct)) as seen with lsusb or whatever tool used to view USB device information. Multiple devices can be on the bus at the same time. For the H parts, which have multiple MPSSE interfaces, the interface can also be selected. It defaults to interface 'A'.
๐
Thatโs the whole page, bestie โ this is the Debian AVRDUDE(1) man page, dated January 15, 2023. Go flash something iconic. ๐ซถ
๐ฆ where this page comes from
- alpine 3.24: avrdude-doc 8.1-r0 ยท GPL-2.0-or-later
- nixos 26.05: avrdude 8.1
- Copyright (C) 2001, 2002, 2003, 2005 - 2023 Hans Eirik Bull
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms