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

FILES

834           /dev/ppi0     default device to be used for communication with the
835                         programming hardware
836
837           ${PREFIX}/etc/avrdude/avrdude.conf
838                         programmer and parts configuration file
839
840           ${HOME}/.avrduderc
841                         programmer and parts configuration file (per-user
842                         overrides)
843
844           ~/.inputrc    Initialization file for the readline(3) library
845
846           ${PREFIX}/share/doc/avrdude/avrdude.pdf
847                         Schematic of programming hardware
848

DIAGNOSTICS

850     avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
851     avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
852     avrdude: Target prepared for ISP, signed off.
853     avrdude: Please restart avrdude without power-cycling the target.
854
855     If the target AVR has been set up for debugWire mode (i. e. the DWEN fuse
856     is programmed), normal ISP connection attempts will fail as the /RESET
857     pin is not available.  When using the JTAG ICE mkII in ISP mode, the mes‐
858     sage shown indicates that avrdude has guessed this condition, and tried
859     to initiate a debugWire reset to the target.  When successful, this will
860     leave the target AVR in a state where it can respond to normal ISP commu‐
861     nication again (until the next power cycle).  Typically, the same command
862     is going to be retried again immediately afterwards, and will then suc‐
863     ceed connecting to the target using normal ISP communication.
864

SEE ALSO

866     avr-objcopy(1), ppi(4), libelf(3,) readline(3)
867
868     The AVR microcontroller product description can be found at
869
870           http://www.atmel.com/products/AVR/
871

AUTHORS

873     Avrdude was written by Brian S. Dean <bsd@bsdhome.com>.
874
875     This man page by Joerg Wunsch.
876

BUGS

878     Please report bugs via
879           http://savannah.nongnu.org/bugs/?group=avrdude.
880
881     The JTAG ICE programmers currently cannot write to the flash ROM one byte
882     at a time.  For that reason, updating the flash ROM from terminal mode
883     does not work.
884
885     Page-mode programming the EEPROM through JTAG (i.e. through an -U option)
886     requires a prior chip erase.  This is an inherent feature of the way JTAG
887     EEPROM programming works.  This also applies to the STK500 and STK600 in
888     parallel programming mode.
889
890     The USBasp and USBtinyISP drivers do not offer any option to distinguish
891     multiple devices connected simultaneously, so effectively only a single
892     device is supported.
893
894     The avrftdi driver allows one to select specific devices using any combi‐
895     nation of vid,pid serial number (usbsn) vendor description (usbvendoror
896     part description (usbproduct) as seen with lsusb or whatever tool used to
897     view USB device information. Multiple devices can be on the bus at the
898     same time. For the H parts, which have multiple MPSSE interfaces, the
899     interface can also be selected.  It defaults to interface 'A'.
900
901BSD                              June 20, 2019                             BSD
Impressum