1AVRDUDE(1)                BSD General Commands Manual               AVRDUDE(1)
2

NAME

4     avrdude — driver program for ``simple'' Atmel AVR MCU programmer
5

SYNOPSIS

7     avrdude -p partno [-b baudrate] [-B bitclock] [-c programmer-id]
8             [-C config-file] [-D] [-e] [-E exitspec[,exitspec]] [-F]
9             [-i delay] [-n -logfile] [-n] [-O] [-P port] [-q] [-s] [-t] [-u]
10             [-U memtype:op:filename:filefmt] [-v] [-x extended_param] [-V]
11

DESCRIPTION

13     Avrdude is a program for downloading code and data to Atmel AVR microcon‐
14     trollers.  Avrdude supports Atmel's STK500 programmer, Atmel's AVRISP and
15     AVRISP mkII devices, Atmel's STK600, Atmel's JTAG ICE (mkI, mkII and 3,
16     the latter two also in ISP mode), programmers complying to AppNote AVR910
17     and AVR109 (including the Butterfly), as well as a simple hard-wired pro‐
18     grammer connected directly to a ppi(4) or parport(4) parallel port, or to
19     a standard serial port.  In the simplest case, the hardware consists just
20     of a cable connecting the respective AVR signal lines to the parallel
21     port.
22
23     The MCU is programmed in serial programming mode, so, for the ppi(4)
24     based programmer, the MCU signals ‘/RESET’, ‘SCK’, ‘MISO’ and ‘MOSI’ need
25     to be connected to the parallel port.  Optionally, some otherwise unused
26     output pins of the parallel port can be used to supply power for the MCU
27     part, so it is also possible to construct a passive stand-alone program‐
28     ming device.  Some status LEDs indicating the current operating state of
29     the programmer can be connected, and a signal is available to control a
30     buffer/driver IC 74LS367 (or 74HCT367).  The latter can be useful to de‐
31     couple the parallel port from the MCU when in-system programming is used.
32
33     A number of equally simple bit-bang programming adapters that connect to
34     a serial port are supported as well, among them the popular Ponyprog se‐
35     rial adapter, and the DASA and DASA3 adapters that used to be supported
36     by uisp(1).  Note that these adapters are meant to be attached to a phys‐
37     ical serial port.  Connecting to a serial port emulated on top of USB is
38     likely to not work at all, or to work abysmally slow.
39
40     If you happen to have a Linux system with at least 4 hardware GPIOs
41     available (like almost all embedded Linux boards) you can do without any
42     additional hardware - just connect them to the MOSI, MISO, RESET and SCK
43     pins on the AVR and use the linuxgpio programmer type. It bitbangs the
44     lines using the Linux sysfs GPIO interface. Of course, care should be
45     taken about voltage level compatibility. Also, although not strictrly re‐
46     quired, it is strongly advisable to protect the GPIO pins from overcur‐
47     rent situations in some way. The simplest would be to just put some re‐
48     sistors in series or better yet use a 3-state buffer driver like the
49     74HC244. Have a look at http://kolev.info/avrdude-linuxgpio for a more
50     detailed tutorial about using this programmer type.
51
52     Under a Linux installation with direct access to the SPI bus and GPIO
53     pins, such as would be found on a Raspberry Pi, the ``linuxspi'' program‐
54     mer type can be used to directly connect to and program a chip using the
55     built in interfaces on the computer. The requirements to use this type
56     are that an SPI interface is exposed along with one GPIO pin. The GPIO
57     serves as the reset output since the Linux SPI drivers do not hold slave
58     select down when a transfer is not occuring and thus it cannot be used as
59     the reset pin. A readily available level translator should be used be‐
60     tween the SPI bus/reset GPIO and the chip to avoid potentially damaging
61     the computer's SPI controller in the event that the chip is running at 5V
62     and the SPI runs at 3.3V. The GPIO chosen for reset can be configured in
63     the avrdude configuration file using the reset entry under the linuxspi
64     programmer, or directly in the port specification. An external pull-up
65     resistor should be connected between the AVR's reset pin and Vcc. If Vcc
66     is not the same as the SPI voltage, this should be done on the AVR side
67     of the level translator to protect the hardware from damage.
68
69     The -P portname option for this programmer defaults to
70     /dev/spidev0.0:/dev/gpiochip0.
71
72     Atmel's STK500 programmer is also supported and connects to a serial
73     port.  Both, firmware versions 1.x and 2.x can be handled, but require a
74     different programmer type specification (by now).  Using firmware version
75     2, high-voltage programming is also supported, both parallel and serial
76     (programmer types stk500pp and stk500hvsp).
77
78     Wiring boards (e.g. Arduino Mega 2560 Rev3) are supported, utilizing
79     STK500 V2.x protocol, but a simple DTR/RTS toggle is used to set the
80     boards into programming mode.  The programmer type is ``wiring''.  Note
81     that the -D option will likely be required in this case, because the
82     bootloader will rewrite the program memory, but no true chip erase can be
83     performed.
84
85     The Arduino (which is very similar to the STK500 1.x) is supported via
86     its own programmer type specification ``arduino''.  This programmer works
87     for the Arduino Uno Rev3.
88
89     The BusPirate is a versatile tool that can also be used as an AVR pro‐
90     grammer.  A single BusPirate can be connected to up to 3 independent
91     AVRs. See the section on extended parameters below for details.
92
93     Atmel's STK600 programmer is supported in ISP and high-voltage program‐
94     ming modes, and connects through the USB.  For ATxmega devices, the
95     STK600 is supported in PDI mode.  For ATtiny4/5/9/10 devices, the STK600
96     and AVRISP mkII are supported in TPI mode.
97
98     The simple serial programmer described in Atmel's application note
99     AVR910, and the bootloader described in Atmel's application note AVR109
100     (which is also used by the AVR Butterfly evaluation board), are supported
101     on a serial port.
102
103     Atmel's JTAG ICE (mkI, mkII, and 3) is supported as well to up- or down‐
104     load memory areas from/to an AVR target (no support for on-chip debug‐
105     ging).  For the JTAG ICE mkII, JTAG, debugWire and ISP mode are sup‐
106     ported, provided it has a firmware revision of at least 4.14 (decimal).
107     JTAGICE3 also supports all of JTAG, debugWIRE, and ISP mode.  See below
108     for the limitations of debugWire.  For ATxmega devices, the JTAG ICE mkII
109     is supported in PDI mode, provided it has a revision 1 hardware and
110     firmware version of at least 5.37 (decimal).  For ATxmega devices, the
111     JTAGICE3 is supported in PDI mode.
112
113     Atmel-ICE (ARM/AVR) is supported in all modes (JTAG, PDI for Xmega, de‐
114     bugWIRE, ISP).
115
116     Atmel's XplainedPro boards, using the EDBG protocol (CMSIS-DAP compati‐
117     ble), are supported using the "jtag3" programmer type.
118
119     Atmel's XplainedMini boards, using the mEDBG protocol, are also supported
120     using the "jtag3" programmer type.
121
122     The AVR Dragon is supported in all modes (ISP, JTAG, HVSP, PP, debug‐
123     Wire).  When used in JTAG and debugWire mode, the AVR Dragon behaves sim‐
124     ilar to a JTAG ICE mkII, so all device-specific comments for that device
125     will apply as well.  When used in ISP mode, the AVR Dragon behaves simi‐
126     lar to an AVRISP mkII (or JTAG ICE mkII in ISP mode), so all device-spe‐
127     cific comments will apply there.  In particular, the Dragon starts out
128     with a rather fast ISP clock frequency, so the -B bitclock option might
129     be required to achieve a stable ISP communication.  For ATxmega devices,
130     the AVR Dragon is supported in PDI mode, provided it has a firmware ver‐
131     sion of at least 6.11 (decimal).
132
133     The avrftdi, USBasp ISP and USBtinyISP adapters are also supported, pro‐
134     vided avrdude has been compiled with libusb support.  USBasp ISP and US‐
135     BtinyISP both feature simple firmware-only USB implementations, running
136     on an ATmega8 (or ATmega88), or ATtiny2313, respectively. If libftdi has
137     has been compiled in avrdude, the avrftdi device adds support for many
138     programmers using FTDI's 2232C/D/H and 4232H parts running in MPSSE mode,
139     which hard-codes (in the chip) SCK to bit 1, MOSI to bit 2, and MISO to
140     bit 3. Reset is usually bit 4.
141
142     The Atmel DFU bootloader is supported in both, FLIP protocol version 1
143     (AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices).
144     See below for some hints about FLIP version 1 protocol behaviour.
145
146     The MPLAB(R) PICkit 4, MPLAB(R) SNAP, and Curiosity Nano boards are sup‐
147     ported in UPDI mode. The Curiosity Nano board is dubbed “PICkit on
148     Board”, thus the name pkobn_updi.
149
150     Input files can be provided, and output files can be written in different
151     file formats, such as raw binary files containing the data to download to
152     the chip, Intel hex format, or Motorola S-record format.  There are a
153     number of tools available to produce those files, like asl(1) as a stand‐
154     alone assembler, or avr-objcopy(1) for the final stage of the GNU
155     toolchain for the AVR microcontroller.
156
157     Provided libelf(3) was present when compiling avrdude, the input file can
158     also be the final ELF file as produced by the linker.  The appropriate
159     ELF section(s) will be examined, according to the memory area to write
160     to.
161
162     Avrdude can program the EEPROM and flash ROM memory cells of supported
163     AVR parts.  Where supported by the serial instruction set, fuse bits and
164     lock bits can be programmed as well.  These are implemented within
165     avrdude as separate memory types and can be programmed using data from a
166     file (see the -U option) or from terminal mode (see the dump and write
167     commands).  It is also possible to read the chip (provided it has not
168     been code-protected previously, of course) and store the data in a file.
169     Finally, a ``terminal'' mode is available that allows one to interac‐
170     tively communicate with the MCU, and to display or program individual
171     memory cells.  On the STK500 and STK600 programmer, several operational
172     parameters (target supply voltage, target Aref voltage, master clock) can
173     be examined and changed from within terminal mode as well.
174
175   Options
176     In order to control all the different operation modi, a number of options
177     need to be specified to avrdude.
178
179           -p partno
180                   This is the only option that is mandatory for every invoca‐
181                   tion of avrdude.  It specifies the type of the MCU con‐
182                   nected to the programmer.  These are read from the config
183                   file.  For currently supported MCU types use ? as partno,
184                   this will print a list of partno ids and official part
185                   names on the terminal. (Both can be used with the -p op‐
186                   tion.)
187
188                   Following parts need special attention:
189
190                   AT90S1200   The ISP programming protocol of the AT90S1200
191                               differs in subtle ways from that of other AVRs.
192                               Thus, not all programmers support this device.
193                               Known to work are all direct bitbang program‐
194                               mers, and all programmers talking the STK500v2
195                               protocol.
196
197                   AT90S2343   The AT90S2323 and ATtiny22 use the same algo‐
198                               rithm.
199
200                   ATmega2560, ATmega2561
201                               Flash addressing above 128 KB is not supported
202                               by all programming hardware.  Known to work are
203                               jtag2, stk500v2, and bit-bang programmers.
204
205                   ATtiny11    The ATtiny11 can only be programmed in high-
206                               voltage serial mode.
207
208           -b baudrate
209                   Override the RS-232 connection baud rate specified in the
210                   respective programmer's entry of the configuration file.
211
212           -B bitclock
213                   Specify the bit clock period for the JTAG interface or the
214                   ISP clock (JTAG ICE only).  The value is a floating-point
215                   number in microseconds.  Alternatively, the value might be
216                   suffixed with "Hz", "kHz", or "MHz", in order to specify
217                   the bit clock frequency, rather than a period.  The default
218                   value of the JTAG ICE results in about 1 microsecond bit
219                   clock period, suitable for target MCUs running at 4 MHz
220                   clock and above.  Unlike certain parameters in the STK500,
221                   the JTAG ICE resets all its parameters to default values
222                   when the programming software signs off from the ICE, so
223                   for MCUs running at lower clock speeds, this parameter must
224                   be specified on the command-line.  You can use the 'de‐
225                   fault_bitclock' keyword in your ${HOME}/.avrduderc file to
226                   assign a default value to keep from having to specify this
227                   option on every invocation.
228
229           -c programmer-id
230                   Use the programmer specified by the argument.  Programmers
231                   and their pin configurations are read from the config file
232                   (see the -C option).  New pin configurations can be easily
233                   added or modified through the use of a config file to make
234                   avrdude work with different programmers as long as the pro‐
235                   grammer supports the Atmel AVR serial program method.  You
236                   can use the 'default_programmer' keyword in your
237                   ${HOME}/.avrduderc file to assign a default programmer to
238                   keep from having to specify this option on every invoca‐
239                   tion.  A full list of all supported programmers is output
240                   to the terminal by using ? as programmer-id.
241
242           -C config-file
243                   Use the specified config file to load configuration data.
244                   This file contains all programmer and part definitions that
245                   avrdude knows about.  See the config file, located at
246                   /etc/avrdude/avrdude.conf, which contains a description of
247                   the format.
248
249                   If config-file is written as +filename then this file is
250                   read after the system wide and user configuration files.
251                   This can be used to add entries to the configuration with‐
252                   out patching your system wide configuration file. It can be
253                   used several times, the files are read in same order as
254                   given on the command line.
255
256           -D      Disable auto erase for flash.  When the -U option with
257                   flash memory is specified, avrdude will perform a chip
258                   erase before starting any of the programming operations,
259                   since it generally is a mistake to program the flash with‐
260                   out performing an erase first.  This option disables that.
261                   Auto erase is not used for ATxmega devices as these devices
262                   can use page erase before writing each page so no explicit
263                   chip erase is required.  Note however that any page not af‐
264                   fected by the current operation will retain its previous
265                   contents.
266
267           -e      Causes a chip erase to be executed.  This will reset the
268                   contents of the flash ROM and EEPROM to the value ‘0xff’,
269                   and clear all lock bits.  Except for ATxmega devices which
270                   can use page erase, it is basically a prerequisite command
271                   before the flash ROM can be reprogrammed again.  The only
272                   exception would be if the new contents would exclusively
273                   cause bits to be programmed from the value ‘1’ to ‘0’.
274                   Note that in order to reprogram EERPOM cells, no explicit
275                   prior chip erase is required since the MCU provides an
276                   auto-erase cycle in that case before programming the cell.
277
278           -E exitspec[,exitspec]
279                   By default, avrdude leaves the parallel port in the same
280                   state at exit as it has been found at startup.  This option
281                   modifies the state of the ‘/RESET’ and ‘Vcc’ lines the par‐
282                   allel port is left at, according to the exitspec arguments
283                   provided, as follows:
284
285                   reset    The ‘/RESET’ signal will be left activated at pro‐
286                            gram exit, that is it will be held low, in order
287                            to keep the MCU in reset state afterwards.  Note
288                            in particular that the programming algorithm for
289                            the AT90S1200 device mandates that the ‘/RESET’
290                            signal is active before powering up the MCU, so in
291                            case an external power supply is used for this MCU
292                            type, a previous invocation of avrdude with this
293                            option specified is one of the possible ways to
294                            guarantee this condition.
295
296                   noreset  The ‘/RESET’ line will be deactivated at program
297                            exit, thus allowing the MCU target program to run
298                            while the programming hardware remains connected.
299
300                   vcc      This option will leave those parallel port pins
301                            active (i. e. high) that can be used to supply
302                            ‘Vcc’ power to the MCU.
303
304                   novcc    This option will pull the ‘Vcc’ pins of the paral‐
305                            lel port down at program exit.
306
307                   d_high   This option will leave the 8 data pins on the par‐
308                            allel port active.  (i. e. high)
309
310                   d_low    This option will leave the 8 data pins on the par‐
311                            allel port inactive.  (i. e. low)
312
313                   Multiple exitspec arguments can be separated with commas.
314
315           -F      Normally, avrdude tries to verify that the device signature
316                   read from the part is reasonable before continuing.  Since
317                   it can happen from time to time that a device has a broken
318                   (erased or overwritten) device signature but is otherwise
319                   operating normally, this options is provided to override
320                   the check.  Also, for programmers like the Atmel STK500 and
321                   STK600 which can adjust parameters local to the programming
322                   tool (independent of an actual connection to a target con‐
323                   troller), this option can be used together with -t to con‐
324                   tinue in terminal mode.
325
326           -i delay
327                   For bitbang-type programmers, delay for approximately delay
328                   microseconds between each bit state change.  If the host
329                   system is very fast, or the target runs off a slow clock
330                   (like a 32 kHz crystal, or the 128 kHz internal RC oscilla‐
331                   tor), this can become necessary to satisfy the requirement
332                   that the ISP clock frequency must not be higher than 1/4 of
333                   the CPU clock frequency.  This is implemented as a spin-
334                   loop delay to allow even for very short delays.  On Unix-
335                   style operating systems, the spin loop is initially cali‐
336                   brated against a system timer, so the number of microsec‐
337                   onds might be rather realistic, assuming a constant system
338                   load while avrdude is running.  On Win32 operating systems,
339                   a preconfigured number of cycles per microsecond is assumed
340                   that might be off a bit for very fast or very slow ma‐
341                   chines.
342
343           -l logfile
344                   Use logfile rather than stderr for diagnostics output.
345                   Note that initial diagnostic messages (during option pars‐
346                   ing) are still written to stderr anyway.
347
348           -n      No-write - disables actually writing data to the MCU (use‐
349                   ful for debugging avrdude ).
350
351           -O      Perform a RC oscillator run-time calibration according to
352                   Atmel application note AVR053.  This is only supported on
353                   the STK500v2, AVRISP mkII, and JTAG ICE mkII hardware.
354                   Note that the result will be stored in the EEPROM cell at
355                   address 0.
356
357           -P port
358                   Use port to identify the device to which the programmer is
359                   attached.  By default the /dev/ppi0 port is used, but if
360                   the programmer type normally connects to the serial port,
361                   the /dev/cuaa0 port is the default.  If you need to use a
362                   different parallel or serial port, use this option to spec‐
363                   ify the alternate port name.
364
365                   On Win32 operating systems, the parallel ports are referred
366                   to as lpt1 through lpt3, referring to the addresses 0x378,
367                   0x278, and 0x3BC, respectively.  If the parallel port can
368                   be accessed through a different address, this address can
369                   be specified directly, using the common C language notation
370                   (i. e., hexadecimal values are prefixed by ‘0x’ ).
371
372                   For the JTAG ICE mkII and JTAGICE3, if avrdude has been
373                   configured with libusb support, port can alternatively be
374                   specified as usb[:serialno].  This will cause avrdude to
375                   search the programmer on USB.  If serialno is also speci‐
376                   fied, it will be matched against the serial number read
377                   from any JTAG ICE mkII found on USB.  The match is done af‐
378                   ter stripping any existing colons from the given serial
379                   number, and right-to-left, so only the least significant
380                   bytes from the serial number need to be given.
381
382                   As the AVRISP mkII device can only be talked to over USB,
383                   the very same method of specifying the port is required
384                   there.
385
386                   For the USB programmer "AVR-Doper" running in HID mode, the
387                   port must be specified as avrdoper. Libhidapi support is
388                   required on Unix and Mac OS but not on Windows. For more
389                   information about AVR-Doper see http://www.ob
390                   dev.at/avrusb/avrdoper.html.
391
392                   For the USBtinyISP, which is a simplicistic device not im‐
393                   plementing serial numbers, multiple devices can be distin‐
394                   guished by their location in the USB hierarchy.  See the
395                   the respective Troubleshooting entry in the detailed docu‐
396                   mentation for examples.
397
398                   For the XBee programmer the target MCU is to be programmed
399                   wirelessly over a ZigBee mesh using the XBeeBoot boot‐
400                   loader.  The ZigBee 64-bit address for the target MCU's own
401                   XBee device must be supplied as a 16-character hexadecimal
402                   value as a port prefix, followed by the ‘@’ character, and
403                   the serial device to connect to a second directly con‐
404                   tactable XBee device associated with the same mesh (with a
405                   default baud rate of 9600).  This may look similar to:
406                   0013a20000000001@/dev/tty.serial.
407
408                   For diagnostic purposes, if the target MCU with an XBeeBoot
409                   bootloader is connected directly to the serial port, the
410                   64-bit address field can be omitted.  In this mode the de‐
411                   fault baud rate will be 19200.
412
413                   For programmers that attach to a serial port using some
414                   kind of higher level protocol (as opposed to bit-bang style
415                   programmers), port can be specified as net:host:port.  In
416                   this case, instead of trying to open a local device, a TCP
417                   network connection to (TCP) port on host is established.
418                   Square brackets may be placed around host to improve read‐
419                   ability, for numeric IPv6 addresses (e.g.
420                   net:[2001:db8::42]:1337).  The remote endpoint is assumed
421                   to be a terminal or console server that connects the net‐
422                   work stream to a local serial port where the actual pro‐
423                   grammer has been attached to.  The port is assumed to be
424                   properly configured, for example using a transparent 8-bit
425                   data connection without parity at 115200 Baud for a STK500.
426
427                   Note: The ability to handle IPv6 hostnames and addresses is
428                   limited to Posix systems (by now).
429
430           -q      Disable (or quell) output of the progress bar while reading
431                   or writing to the device.  Specify it a second time for
432                   even quieter operation.
433
434           -s      Disable safemode prompting.  When safemode discovers that
435                   one or more fuse bits have unintentionally changed, it will
436                   prompt for confirmation regarding whether or not it should
437                   attempt to recover the fuse bit(s).  Specifying this flag
438                   disables the prompt and assumes that the fuse bit(s) should
439                   be recovered without asking for confirmation first.
440
441           -t      Tells avrdude to enter the interactive ``terminal'' mode
442                   instead of up- or downloading files.  See below for a de‐
443                   tailed description of the terminal mode.
444
445           -u      Disable the safemode fuse bit checks.  Safemode is enabled
446                   by default and is intended to prevent unintentional fuse
447                   bit changes.  When enabled, safemode will issue a warning
448                   if the any fuse bits are found to be different at program
449                   exit than they were when avrdude was invoked.  Safemode
450                   won't alter fuse bits itself, but rather will prompt for
451                   instructions, unless the terminal is non-interactive, in
452                   which case safemode is disabled.  See the -s option to dis‐
453                   able safemode prompting.
454
455                   If one of the configuration files has a line
456                         default_safemode = no;
457                   safemode is disabled by default.  The -u option's effect is
458                   negated in that case, i. e. it enables safemode.
459
460                   Safemode is always disabled for AVR32, Xmega and TPI de‐
461                   vices.
462
463           -U memtype:op:filename[:format]
464                   Perform a memory operation as indicated.  The memtype field
465                   specifies the memory type to operate on.  The available
466                   memory types are device-dependent, the actual configuration
467                   can be viewed with the part command in terminal mode.  Typ‐
468                   ically, a device's memory configuration at least contains
469                   the memory types flash and eeprom.  All memory types cur‐
470                   rently known are:
471                   calibration  One or more bytes of RC oscillator calibration
472                                data.
473                   eeprom       The EEPROM of the device.
474                   efuse        The extended fuse byte.
475                   flash        The flash ROM of the device.
476                   fuse         The fuse byte in devices that have only a sin‐
477                                gle fuse byte.
478                   hfuse        The high fuse byte.
479                   lfuse        The low fuse byte.
480                   lock         The lock byte.
481                   signature    The three device signature bytes (device ID).
482                   fuseN        The fuse bytes of ATxmega devices, N is an in‐
483                                teger number for each fuse supported by the
484                                device.
485                   application  The application flash area of ATxmega devices.
486                   apptable     The application table flash area of ATxmega
487                                devices.
488                   boot         The boot flash area of ATxmega devices.
489                   prodsig      The production signature (calibration) area of
490                                ATxmega devices.
491                   usersig      The user signature area of ATxmega devices.
492
493                   The op field specifies what operation to perform:
494
495                   r        read device memory and write to the specified file
496
497                   w        read data from the specified file and write to the
498                            device memory
499
500                   v        read data from both the device and the specified
501                            file and perform a verify
502
503                   The filename field indicates the name of the file to read
504                   or write.  The format field is optional and contains the
505                   format of the file to read or write.  Format can be one of:
506
507                   i    Intel Hex
508
509                   s    Motorola S-record
510
511                   r    raw binary; little-endian byte order, in the case of
512                        the flash ROM data
513
514                   e    ELF (Executable and Linkable Format)
515
516                   m    immediate; actual byte values specified on the command
517                        line, separated by commas or spaces.  This is good for
518                        programming fuse bytes without having to create a sin‐
519                        gle-byte file or enter terminal mode.
520
521                   a    auto detect; valid for input only, and only if the in‐
522                        put is not provided at stdin.
523
524                   d    decimal; this and the following formats are only valid
525                        on output.  They generate one line of output for the
526                        respective memory section, forming a comma-separated
527                        list of the values.  This can be particularly useful
528                        for subsequent processing, like for fuse bit settings.
529
530                   h    hexadecimal; each value will get the string 0x
531                        prepended.
532
533                   o    octal; each value will get a 0 prepended unless it is
534                        less than 8 in which case it gets no prefix.
535
536                   b    binary; each value will get the string 0b prepended.
537
538                   The default is to use auto detection for input files, and
539                   raw binary format for output files.  Note that if filename
540                   contains a colon, the format field is no longer optional
541                   since the filename part following the colon would otherwise
542                   be misinterpreted as format.
543
544                   When reading any kind of flash memory area (including the
545                   various sub-areas in Xmega devices), the resulting output
546                   file will be truncated to not contain trailing 0xFF bytes
547                   which indicate unprogrammed (erased) memory.  Thus, if the
548                   entire memory is unprogrammed, this will result in an out‐
549                   put file that has no contents at all.
550
551                   As an abbreviation, the form -U filename is equivalent to
552                   specifying -U flash:w:filename:a.  This will only work if
553                   filename does not have a colon in it.
554
555           -v      Enable verbose output.  More -v options increase verbosity
556                   level.
557
558           -V      Disable automatic verify check when uploading data.
559
560           -x extended_param
561                   Pass extended_param to the chosen programmer implementation
562                   as an extended parameter.  The interpretation of the ex‐
563                   tended parameter depends on the programmer itself.  See be‐
564                   low for a list of programmers accepting extended parame‐
565                   ters.
566
567   Terminal mode
568     In this mode, avrdude only initializes communication with the MCU, and
569     then awaits user commands on standard input.  Commands and parameters may
570     be abbreviated to the shortest unambiguous form.  Terminal mode provides
571     a command history using readline(3), so previously entered command lines
572     can be recalled and edited.  The following commands are currently imple‐
573     mented:
574
575           dump memtype addr nbytes
576                   Read nbytes bytes from the specified memory area, and dis‐
577                   play them in the usual hexadecimal and ASCII form.
578
579           dump    Continue dumping the memory contents for another nbytes
580                   where the previous dump command left off.
581
582           write memtype addr byte1 ... byteN
583                   Manually program the respective memory cells, starting at
584                   address addr, using the values byte1 through byteN.  This
585                   feature is not implemented for bank-addressed memories such
586                   as the flash memory of ATMega devices.
587
588           erase   Perform a chip erase.
589
590           send b1 b2 b3 b4
591                   Send raw instruction codes to the AVR device.  If you need
592                   access to a feature of an AVR part that is not directly
593                   supported by avrdude, this command allows you to use it,
594                   even though avrdude does not implement the command. When
595                   using direct SPI mode, up to 3 bytes can be omitted.
596
597           sig     Display the device signature bytes.
598
599           spi     Enter direct SPI mode.  The pgmled pin acts as slave se‐
600                   lect.  Only supported on parallel bitbang programmers.
601
602           part    Display the current part settings and parameters.  Includes
603                   chip specific information including all memory types sup‐
604                   ported by the device, read/write timing, etc.
605
606           pgm     Return to programming mode (from direct SPI mode).
607
608           vtarg voltage
609                   Set the target's supply voltage to voltage Volts.  Only
610                   supported on the STK500 and STK600 programmer.
611
612           varef [channel] voltage
613                   Set the adjustable voltage source to voltage Volts.  This
614                   voltage is normally used to drive the target's Aref input
615                   on the STK500.  On the Atmel STK600, two reference voltages
616                   are available, which can be selected by the optional
617                   channel argument (either 0 or 1).  Only supported on the
618                   STK500 and STK600 programmer.
619
620           fosc freq[M|k]
621                   Set the master oscillator to freq Hz.  An optional trailing
622                   letter M multiplies by 1E6, a trailing letter k by 1E3.
623                   Only supported on the STK500 and STK600 programmer.
624
625           fosc off
626                   Turn the master oscillator off.  Only supported on the
627                   STK500 and STK600 programmer.
628
629           sck period
630                   STK500 and STK600 programmer only: Set the SCK clock period
631                   to period microseconds.
632
633                   JTAG ICE only: Set the JTAG ICE bit clock period to period
634                   microseconds.  Note that unlike STK500 settings, this set‐
635                   ting will be reverted to its default value (approximately 1
636                   microsecond) when the programming software signs off from
637                   the JTAG ICE.  This parameter can also be used on the JTAG
638                   ICE mkII, JTAGICE3, and Atmel-ICE to specify the ISP clock
639                   period when operating the ICE in ISP mode.
640
641           parms   STK500 and STK600 programmer only: Display the current
642                   voltage and master oscillator parameters.
643
644                   JTAG ICE only: Display the current target supply voltage
645                   and JTAG bit clock rate/period.
646
647           verbose [level]
648                   Change (when level is provided), or display the verbosity
649                   level.  The initial verbosity level is controlled by the
650                   number of -v options given on the commandline.
651
652           ?
653
654           help    Give a short on-line summary of the available commands.
655
656           quit    Leave terminal mode and thus avrdude.
657
658   Default Parallel port pin connections
659     (these can be changed, see the -c option)
660
661     Pin number   Function
662     2-5          Vcc (optional power supply to MCU)
663     7            /RESET (to MCU)
664     8            SCK (to MCU)
665     9            MOSI (to MCU)
666     10           MISO (from MCU)
667     18-25        GND
668
669   debugWire limitations
670     The debugWire protocol is Atmel's proprietary one-wire (plus ground) pro‐
671     tocol to allow an in-circuit emulation of the smaller AVR devices, using
672     the ‘/RESET’ line.  DebugWire mode is initiated by activating the ‘DWEN’
673     fuse, and then power-cycling the target.  While this mode is mainly in‐
674     tended for debugging/emulation, it also offers limited programming capa‐
675     bilities.  Effectively, the only memory areas that can be read or pro‐
676     grammed in this mode are flash ROM and EEPROM.  It is also possible to
677     read out the signature.  All other memory areas cannot be accessed.
678     There is no chip erase functionality in debugWire mode; instead, while
679     reprogramming the flash ROM, each flash ROM page is erased right before
680     updating it.  This is done transparently by the JTAG ICE mkII (or AVR
681     Dragon).  The only way back from debugWire mode is to initiate a special
682     sequence of commands to the JTAG ICE mkII (or AVR Dragon), so the debug‐
683     Wire mode will be temporarily disabled, and the target can be accessed
684     using normal ISP programming.  This sequence is automatically initiated
685     by using the JTAG ICE mkII or AVR Dragon in ISP mode, when they detect
686     that ISP mode cannot be entered.
687
688   FLIP version 1 idiosyncrasies
689     Bootloaders using the FLIP protocol version 1 experience some very spe‐
690     cific behaviour.
691
692     These bootloaders have no option to access memory areas other than Flash
693     and EEPROM.
694
695     When the bootloader is started, it enters a security mode where the only
696     acceptable access is to query the device configuration parameters (which
697     are used for the signature on AVR devices).  The only way to leave this
698     mode is a chip erase.  As a chip erase is normally implied by the -U op‐
699     tion when reprogramming the flash, this peculiarity might not be very ob‐
700     vious immediately.
701
702     Sometimes, a bootloader with security mode already disabled seems to no
703     longer respond with sensible configuration data, but only 0xFF for all
704     queries.  As these queries are used to obtain the equivalent of a signa‐
705     ture, avrdude can only continue in that situation by forcing the signa‐
706     ture check to be overridden with the -F option.
707
708     A chip erase might leave the EEPROM unerased, at least on some versions
709     of the bootloader.
710
711   Programmers accepting extended parameters
712           JTAG ICE mkII
713
714           JTAGICE3
715
716           Atmel-ICE
717
718           AVR Dragon
719                   When using the JTAG ICE mkII, JTAGICE3, Atmel-ICE or AVR
720                   Dragon in JTAG mode, the following extended parameter is
721                   accepted:
722
723                         jtagchain=UB,UA,BB,BA
724                                 Setup the JTAG scan chain for UB units be‐
725                                 fore, UA units after, BB bits before, and BA
726                                 bits after the target AVR, respectively.
727                                 Each AVR unit within the chain shifts by 4
728                                 bits.  Other JTAG units might require a dif‐
729                                 ferent bit shift count.
730
731           AVR910
732
733                         devcode=VALUE
734                                 Override the device code selection by using
735                                 VALUE as the device code.  The programmer is
736                                 not queried for the list of supported device
737                                 codes, and the specified VALUE is not veri‐
738                                 fied but used directly within the ‘T’ command
739                                 sent to the programmer.  VALUE can be speci‐
740                                 fied using the conventional number notation
741                                 of the C programming language.
742
743                         no_blockmode
744                                 Disables the default checking for block
745                                 transfer capability.  Use no_blockmode only
746                                 if your AVR910 programmer creates errors dur‐
747                                 ing initial sequence.
748
749           buspirate
750
751                         reset={cs,aux,aux2}
752                                 The default setup assumes the BusPirate's CS
753                                 output pin connected to the RESET pin on AVR
754                                 side. It is however possible to have multiple
755                                 AVRs connected to the same BP with MISO, MOSI
756                                 and SCK lines common for all of them.  In
757                                 such a case one AVR should have its RESET
758                                 connected to BusPirate's CS pin, second AVR's
759                                 RESET connected to BusPirate's AUX pin and if
760                                 your BusPirate has an AUX2 pin (only avail‐
761                                 able on BusPirate version v1a with firmware
762                                 3.0 or newer) use that to activate RESET on
763                                 the third AVR.
764
765                                 It may be a good idea to decouple the BusPi‐
766                                 rate and the AVR's SPI buses from each other
767                                 using a 3-state bus buffer. For example
768                                 74HC125 or 74HC244 are some good candidates
769                                 with the latches driven by the appropriate
770                                 reset pin (cs, aux or aux2). Otherwise the
771                                 SPI traffic in one active circuit may inter‐
772                                 fere with programming the AVR in the other
773                                 design.
774
775                         spifreq=<0..7>
776                                 The SPI speed for the Bus Pirate's binary SPI
777                                 mode:
778
779                                 0 ..  30 kHz   (default)
780                                 1 .. 125 kHz
781                                 2 .. 250 kHz
782                                 3 ..   1 MHz
783                                 4 ..   2 MHz
784                                 5 ..   2.6 MHz
785                                 6 ..   4 MHz
786                                 7 ..   8 MHz
787
788                         rawfreq=<0..3>
789                                 Sets the SPI speed and uses the Bus Pirate's
790                                 binary "raw-wire" mode:
791
792                                 0 ..   5 kHz
793                                 1 ..  50 kHz
794                                 2 .. 100 kHz   (Firmware v4.2+ only)
795                                 3 .. 400 kHz   (v4.2+)
796
797                                 The only advantage of the "raw-wire" mode is
798                                 the different SPI frequencies available.
799                                 Paged writing is not implemented in this
800                                 mode.
801
802                         ascii   Attempt to use ASCII mode even when the
803                                 firmware supports BinMode (binary mode).
804                                 BinMode is supported in firmware 2.7 and
805                                 newer, older FW's either don't have BinMode
806                                 or their BinMode is buggy. ASCII mode is
807                                 slower and makes the above reset=, spifreq=
808                                 and rawfreq= parameters unavailable. Be aware
809                                 that ASCII mode is not guaranteed to work
810                                 with newer firmware versions, and is retained
811                                 only to maintain compatibility with older
812                                 firmware versions.
813
814                         nopagedwrite
815                                 Firmware versions 5.10 and newer support a
816                                 binary mode SPI command that enables whole
817                                 pages to be written to AVR flash memory at
818                                 once, resulting in a significant write speed
819                                 increase. If use of this mode is not desir‐
820                                 able for some reason, this option disables
821                                 it.
822
823                         nopagedread
824                                 Newer firmware versions support in binary
825                                 mode SPI command some AVR Extended Commands.
826                                 Using the "Bulk Memory Read from Flash" re‐
827                                 sults in a significant read speed increase.
828                                 If use of this mode is not desirable for some
829                                 reason, this option disables it.
830
831                         cpufreq=<125..4000>
832                                 This sets the AUX pin to output a frequency
833                                 of n kHz. Connecting the AUX pin to the XTAL1
834                                 pin of your MCU, you can provide it a clock,
835                                 for example when it needs an external clock
836                                 because of wrong fuses settings.  Make sure
837                                 the CPU frequency is at least four times the
838                                 SPI frequency.
839
840                         serial_recv_timeout=<1...>
841                                 This sets the serial receive timeout to the
842                                 given value.  The timeout happens every time
843                                 avrdude waits for the BusPirate prompt.  Es‐
844                                 pecially in ascii mode this happens very of‐
845                                 ten, so setting a smaller value can speed up
846                                 programming a lot.  The default value is
847                                 100ms. Using 10ms might work in most cases.
848
849           Wiring  When using the Wiring programmer type, the following op‐
850                   tional extended parameter is accepted:
851
852                         snooze=<0..32767>
853                                 After performing the port open phase, AVRDUDE
854                                 will wait/snooze for snooze milliseconds be‐
855                                 fore continuing to the protocol sync phase.
856                                 No toggling of DTR/RTS is performed if snooze
857                                 is greater than 0.
858
859           PICkit2
860                   Connection to the PICkit2 programmer:
861
862                   (AVR)    (PICkit2)
863                   RST  -   VPP/MCLR (1)
864                   VDD  -   VDD Target (2) -- possibly optional if AVR self powered
865                   GND  -   GND (3)
866                   MISO -   PGD (4)
867                   SCLK -   PDC (5)
868                   MOSI -   AUX (6)
869
870                   Extended commandline parameters:
871
872                         clockrate=<rate>
873                                 Sets the SPI clocking rate in Hz (default is
874                                 100kHz). Alternately the -B or -i options can
875                                 be used to set the period.
876
877                         timeout=<usb-transaction-timeout>
878                                 Sets the timeout for USB reads and writes in
879                                 milliseconds (default is 1500 ms).
880
881           USBasp  Extended parameters:
882
883                         section_config
884                                 Programmer will erase configuration section
885                                 with option -e (chip erase), rather than en‐
886                                 tire chip.  Only applicable to TPI devices
887                                 (ATtiny 4/5/9/10/20/40).
888
889           xbee    Extended parameters:
890
891                         xbeeresetpin=<1..7>
892                                 Select the XBee pin DIO<1..7> that is con‐
893                                 nected to the MCU's ‘/RESET’ line.  The pro‐
894                                 grammer needs to know which DIO pin to use to
895                                 reset into the bootloader.  The default (3)
896                                 is the DIO3 pin (XBee pin 17), but some com‐
897                                 mercial products use a different XBee pin.
898
899                                 The remaining two necessary XBee-to-MCU con‐
900                                 nections are not selectable - the XBee DOUT
901                                 pin (pin 2) must be connected to the MCU's
902                                 ‘RXD’ line, and the XBee DIN pin (pin 3) must
903                                 be connected to the MCU's ‘TXD’ line.
904

FILES

906           /dev/ppi0     default device to be used for communication with the
907                         programming hardware
908
909           /etc/avrdude/avrdude.conf
910                         programmer and parts configuration file
911
912           ${HOME}/.avrduderc
913                         programmer and parts configuration file (per-user
914                         overrides)
915
916           ~/.inputrc    Initialization file for the readline(3) library
917
918           /usr/share/doc/avrdude/avrdude.pdf
919                         Schematic of programming hardware
920

DIAGNOSTICS

922     avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
923     avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
924     avrdude: Target prepared for ISP, signed off.
925     avrdude: Please restart avrdude without power-cycling the target.
926
927     If the target AVR has been set up for debugWire mode (i. e. the DWEN fuse
928     is programmed), normal ISP connection attempts will fail as the /RESET
929     pin is not available.  When using the JTAG ICE mkII in ISP mode, the mes‐
930     sage shown indicates that avrdude has guessed this condition, and tried
931     to initiate a debugWire reset to the target.  When successful, this will
932     leave the target AVR in a state where it can respond to normal ISP commu‐
933     nication again (until the next power cycle).  Typically, the same command
934     is going to be retried again immediately afterwards, and will then suc‐
935     ceed connecting to the target using normal ISP communication.
936

SEE ALSO

938     avr-objcopy(1), ppi(4), libelf(3,) readline(3)
939
940     The AVR microcontroller product description can be found at
941
942           http://www.atmel.com/products/AVR/
943

AUTHORS

945     Avrdude was written by Brian S. Dean <bsd@bsdhome.com>.
946
947     This man page by Joerg Wunsch.
948

BUGS

950     Please report bugs via
951           http://savannah.nongnu.org/bugs/?group=avrdude.
952
953     The JTAG ICE programmers currently cannot write to the flash ROM one byte
954     at a time.  For that reason, updating the flash ROM from terminal mode
955     does not work.
956
957     Page-mode programming the EEPROM through JTAG (i.e. through an -U option)
958     requires a prior chip erase.  This is an inherent feature of the way JTAG
959     EEPROM programming works.  This also applies to the STK500 and STK600 in
960     parallel programming mode.
961
962     The USBasp and USBtinyISP drivers do not offer any option to distinguish
963     multiple devices connected simultaneously, so effectively only a single
964     device is supported.
965
966     The avrftdi driver allows one to select specific devices using any combi‐
967     nation of vid,pid serial number (usbsn) vendor description (usbvendoror
968     part description (usbproduct) as seen with lsusb or whatever tool used to
969     view USB device information. Multiple devices can be on the bus at the
970     same time. For the H parts, which have multiple MPSSE interfaces, the in‐
971     terface can also be selected.  It defaults to interface 'A'.
972
973BSD                              July 21, 2022                             BSD
Impressum