1%% -*-texinfo-*- 2\input texinfo 3 4@c $Id: avrdude.texi 1375 2016-02-15 21:02:00Z joerg_wunsch $ 5 6@setfilename avrdude.info 7@settitle AVRDUDE 8@finalout 9 10@include version.texi 11 12@c 13@c These are set in version.texi which is automatically generated by automake. 14@c 15@c @set UPDATED 26 Febuary 2003 16@c @set EDITION 3.2.0 17@c @set VERSION 3.2.0 18 19@c This is a dir.info fragment to support semi-automated addition of 20@c manuals to an info tree. 21@dircategory AVR Programming & development tools. 22@direntry 23* AvrDude: (avrdude). AVR program downloader/uploader. 24@end direntry 25 26@ifinfo 27This file documents the avrdude program. 28 29For avrdude version @value{VERSION}, @value{UPDATED}. 30 31Copyright @copyright{} 2003, 2005 Brian Dean 32 33Copyright @copyright{} 2006 - 2011 J@"org Wunsch 34 35Permission is granted to make and distribute verbatim copies of 36this manual provided the copyright notice and this permission notice 37are preserved on all copies. 38 39@ignore 40Permission is granted to process this file through TeX and print the 41results, provided the printed document carries copying permission 42notice identical to this one except for the removal of this paragraph 43(this paragraph not being relevant to the printed manual). 44 45@end ignore 46Permission is granted to copy and distribute modified versions of this 47manual under the conditions for verbatim copying, provided that the entire 48resulting derived work is distributed under the terms of a permission 49notice identical to this one. 50 51Permission is granted to copy and distribute translations of this manual 52into another language, under the above conditions for modified versions, 53except that this permission notice may be stated in a translation approved 54by the Free Software Foundation. 55 56Alternatively, this documentation may be copied and distributed under 57the terms of the GNU Free Documentation License (FDL), version 1.3. 58@end ifinfo 59 60@titlepage 61@title AVRDUDE 62@subtitle A program for download/uploading AVR microcontroller flash and eeprom. 63@subtitle For AVRDUDE, Version @value{VERSION}, @value{UPDATED}. 64@author by Brian S. Dean 65 66@page 67Send comments on AVRDUDE to @w{@email{avrdude-dev@@nongnu.org}}. 68 69Use @uref{http://savannah.nongnu.org/bugs/?group=avrdude} to report bugs. 70 71Copyright @copyright{} 2003,2005 Brian S. Dean 72 73Copyright @copyright{} 2006 - 2013 J@"org Wunsch 74@sp 2 75 76Permission is granted to make and distribute verbatim copies of 77this manual provided the copyright notice and this permission notice 78are preserved on all copies. 79 80Permission is granted to copy and distribute modified versions of this 81manual under the conditions for verbatim copying, provided that the entire 82resulting derived work is distributed under the terms of a permission 83notice identical to this one. 84 85Permission is granted to copy and distribute translations of this manual 86into another language, under the above conditions for modified versions, 87except that this permission notice may be stated in a translation approved 88by the Free Software Foundation. 89@end titlepage 90 91@contents 92 93@c 94@c Top Node 95@c 96@node Top, Introduction, (dir), (dir) 97@comment node-name, next, previous, up 98 99@ifinfo 100This file documents the avrdude program for downloading/uploading 101programs to Atmel AVR microcontrollers. 102 103For avrdude version @value{VERSION}, @value{UPDATED}. 104 105Send comments on AVRDUDE to @w{@email{avrdude-dev@@nongnu.org}}. 106 107Use @uref{http://savannah.nongnu.org/bugs/?group=avrdude} to report bugs. 108 109Copyright @copyright{} 2003,2005 Brian S. Dean 110 111Copyright @copyright{} 2006 J@"org Wunsch 112@end ifinfo 113 114@menu 115* Introduction:: 116* Command Line Options:: 117* Terminal Mode Operation:: 118* Configuration File:: 119* Programmer Specific Information:: 120* Platform Dependent Information:: 121* Troubleshooting:: 122@end menu 123 124@c 125@c Node 126@c 127@node Introduction, Command Line Options, Top, Top 128@comment node-name, next, previous, up 129@chapter Introduction 130@cindex introduction 131 132AVRDUDE - AVR Downloader Uploader - is a program for downloading and 133uploading the on-chip memories of Atmel's AVR microcontrollers. It can 134program the Flash and EEPROM, and where supported by the serial 135programming protocol, it can program fuse and lock bits. AVRDUDE also 136supplies a direct instruction mode allowing one to issue any programming 137instruction to the AVR chip regardless of whether AVRDUDE implements 138that specific feature of a particular chip. 139 140AVRDUDE can be used effectively via the command line to read or write 141all chip memory types (eeprom, flash, fuse bits, lock bits, signature 142bytes) or via an interactive (terminal) mode. Using AVRDUDE from the 143command line works well for programming the entire memory of the chip 144from the contents of a file, while interactive mode is useful for 145exploring memory contents, modifying individual bytes of eeprom, 146programming fuse/lock bits, etc. 147 148AVRDUDE supports the following basic programmer types: Atmel's STK500, 149Atmel's AVRISP and AVRISP mkII devices, 150Atmel's STK600, 151Atmel's JTAG ICE (the original one, mkII, and 3, the latter two also in ISP mode), appnote 152avr910, appnote avr109 (including the AVR Butterfly), 153serial bit-bang adapters, 154and the PPI (parallel port interface). PPI represents a class 155of simple programmers where the programming lines are directly 156connected to the PC parallel port. Several pin configurations exist 157for several variations of the PPI programmers, and AVRDUDE can be 158configured to work with them by either specifying the appropriate 159programmer on the command line or by creating a new entry in its 160configuration file. All that's usually required for a new entry is to 161tell AVRDUDE which pins to use for each programming function. 162 163A number of equally simple bit-bang programming adapters that connect 164to a serial port are supported as well, among them the popular 165Ponyprog serial adapter, and the DASA and DASA3 adapters that used to 166be supported by uisp(1). Note that these adapters are meant to be 167attached to a physical serial port. Connecting to a serial port 168emulated on top of USB is likely to not work at all, or to work 169abysmally slow. 170 171If you happen to have a Linux system with at least 4 hardware GPIOs 172available (like almost all embedded Linux boards) you can do without 173any additional hardware - just connect them to the MOSI, MISO, RESET 174and SCK pins on the AVR and use the linuxgpio programmer type. It bitbangs 175the lines using the Linux sysfs GPIO interface. Of course, care should 176be taken about voltage level compatibility. Also, although not strictly 177required, it is strongly advisable to protect the GPIO pins from 178overcurrent situations in some way. The simplest would be to just put 179some resistors in series or better yet use a 3-state buffer driver like 180the 74HC244. Have a look at http://kolev.info/avrdude-linuxgpio for a more 181detailed tutorial about using this programmer type. 182 183The STK500, JTAG ICE, avr910, and avr109/butterfly use the serial port to communicate with the PC. 184The STK600, JTAG ICE mkII/3, AVRISP mkII, USBasp, avrftdi (and derivatives), and USBtinyISP 185programmers communicate through the USB, using @code{libusb} as a 186platform abstraction layer. 187The avrftdi adds support for the FT2232C/D, FT2232H, and FT4232H devices. These all use 188the MPSSE mode, which has a specific pin mapping. Bit 1 (the lsb of the byte in the config 189file) is SCK. Bit 2 is MOSI, and Bit 3 is MISO. Bit 4 usually reset. The 2232C/D parts 190are only supported on interface A, but the H parts can be either A or B (specified by the 191usbdev config parameter). 192The STK500, STK600, JTAG ICE, and avr910 contain on-board logic to control the programming of the target 193device. 194The avr109 bootloader implements a protocol similar to avr910, but is 195actually implemented in the boot area of the target's flash ROM, as 196opposed to being an external device. 197The fundamental difference between the two types lies in the 198protocol used to control the programmer. The avr910 protocol is very 199simplistic and can easily be used as the basis for a simple, home made 200programmer since the firmware is available online. On the other hand, 201the STK500 protocol is more robust and complicated and the firmware is 202not openly available. 203The JTAG ICE also uses a serial communication protocol which is similar 204to the STK500 firmware version 2 one. However, as the JTAG ICE is 205intended to allow on-chip debugging as well as memory programming, the 206protocol is more sophisticated. 207(The JTAG ICE mkII protocol can also be run on top of USB.) 208Only the memory programming functionality of the JTAG ICE is supported 209by AVRDUDE. 210For the JTAG ICE mkII/3, JTAG, debugWire and ISP mode are supported, provided 211it has a firmware revision of at least 4.14 (decimal). 212See below for the limitations of debugWire. 213For ATxmega devices, the JTAG ICE mkII/3 is supported in PDI mode, provided it 214has a revision 1 hardware and firmware version of at least 5.37 (decimal). 215 216The Atmel-ICE (ARM/AVR) is supported (JTAG, PDI for Xmega, debugWIRE, ISP modes). 217 218Atmel's XplainedPro boards, using EDBG protocol (CMSIS-DAP compliant), are 219supported by the ``jtag3'' programmer type. 220 221Atmel's XplainedMini boards, using mEDBG protocol, are also 222supported by the ``jtag3'' programmer type. 223 224The AVR Dragon is supported in all modes (ISP, JTAG, PDI, HVSP, PP, debugWire). 225When used in JTAG and debugWire mode, the AVR Dragon behaves similar to a 226JTAG ICE mkII, so all device-specific comments for that device 227will apply as well. 228When used in ISP and PDI mode, the AVR Dragon behaves similar to an 229AVRISP mkII (or JTAG ICE mkII in ISP mode), so all device-specific 230comments will apply there. 231In particular, the Dragon starts out with a rather fast ISP clock 232frequency, so the @code{-B @var{bitclock}} 233option might be required to achieve a stable ISP communication. 234For ATxmega devices, the AVR Dragon is supported in PDI mode, provided it 235has a firmware version of at least 6.11 (decimal). 236 237Wiring boards are supported, utilizing STK500 V2.x protocol, but 238a simple DTR/RTS toggle to set the boards into programming mode. 239The programmer type is ``wiring''. 240 241The Arduino (which is very similar to the STK500 1.x) is supported via 242its own programmer type specification ``arduino''. 243 244The BusPirate is a versatile tool that can also be used as an AVR programmer. 245A single BusPirate can be connected to up to 3 independent AVRs. See 246the section on 247@emph{extended parameters} 248below for details. 249 250The USBasp ISP and USBtinyISP adapters are also supported, provided AVRDUDE 251has been compiled with libusb support. 252They both feature simple firmware-only USB implementations, running on 253an ATmega8 (or ATmega88), or ATtiny2313, respectively. 254 255The Atmel DFU bootloader is supported in both, FLIP protocol version 1 256(AT90USB* and ATmega*U* devices), as well as version 2 (Xmega devices). 257See below for some hints about FLIP version 1 protocol behaviour. 258 259 260@menu 261* History:: 262@end menu 263 264@c 265@c Node 266@c 267@node History, , Introduction, Introduction 268@section History and Credits 269 270AVRDUDE was written by Brian S. Dean under the name of AVRPROG to run on 271the FreeBSD Operating System. Brian renamed the software to be called 272AVRDUDE when interest grew in a Windows port of the software so that the 273name did not conflict with AVRPROG.EXE which is the name of Atmel's 274Windows programming software. 275 276The AVRDUDE source now resides in the public CVS repository on 277savannah.gnu.org (@url{http://savannah.gnu.org/projects/avrdude/}), 278where it continues to be enhanced and ported to other systems. In 279addition to FreeBSD, AVRDUDE now runs on Linux and Windows. The 280developers behind the porting effort primarily were Ted Roth, Eric 281Weddington, and Joerg Wunsch. 282 283And in the spirit of many open source projects, this manual also draws 284on the work of others. The initial revision was composed of parts of 285the original Unix manual page written by Joerg Wunsch, the original web 286site documentation by Brian Dean, and from the comments describing the 287fields in the AVRDUDE configuration file by Brian Dean. The texi 288formatting was modeled after that of the Simulavr documentation by Ted 289Roth. 290 291 292@c 293@c Node 294@c 295@node Command Line Options, Terminal Mode Operation, Introduction, Top 296@chapter Command Line Options 297@cindex options 298 299@menu 300* Option Descriptions:: 301* Programmers accepting extended parameters:: 302* Example Command Line Invocations:: 303@end menu 304 305@c 306@c Node 307@c 308@node Option Descriptions, Programmers accepting extended parameters, Command Line Options, Command Line Options 309@section Option Descriptions 310 311@noindent 312AVRDUDE is a command line tool, used as follows: 313 314@smallexample 315avrdude -p partno @var{options} @dots{} 316@end smallexample 317 318@noindent 319Command line options are used to control AVRDUDE's behaviour. The 320following options are recognized: 321 322@table @code 323@item -p @var{partno} 324This is the only mandatory option and it tells AVRDUDE what type of part 325(MCU) that is connected to the programmer. The @var{partno} parameter 326is the part's id listed in the configuration file. Specify -p ? to list 327all parts in the configuration file. If a part is unknown 328to AVRDUDE, it means that there is no config file entry for that part, 329but it can be added to the configuration file if you have the Atmel 330datasheet so that you can enter the programming specifications. 331Currently, the following MCU types are understood: 332 333@multitable @columnfractions .15 .3 334@include parts.texi 335@end multitable 336 337(*) The AT90S2323 and ATtiny22 use the same algorithm. 338 339(**) Flash addressing above 128 KB is not supported by all 340programming hardware. Known to work are jtag2, stk500v2, 341and bit-bang programmers. 342 343(***) 344The ATtiny11 can only be 345programmed in high-voltage serial mode. 346 347(****) 348The ISP programming protocol of the AT90S1200 differs in subtle ways 349from that of other AVRs. Thus, not all programmers support this 350device. Known to work are all direct bitbang programmers, and all 351programmers talking the STK500v2 protocol. 352 353@item -b @var{baudrate} 354Override the RS-232 connection baud rate specified in the respective 355programmer's entry of the configuration file. 356 357@item -B @var{bitclock} 358Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only). 359The value is a floating-point number in microseconds. 360Alternatively, the value might be suffixed with "Hz", "kHz", or "MHz", 361in order to specify the bit clock frequency, rather than a period. 362The default value of the JTAG ICE results in about 1 microsecond bit 363clock period, suitable for target MCUs running at 4 MHz clock and 364above. 365Unlike certain parameters in the STK500, the JTAG ICE resets all its 366parameters to default values when the programming software signs 367off from the ICE, so for MCUs running at lower clock speeds, this 368parameter must be specified on the command-line. 369It can also be set in the configuration file by using the 'default_bitclock' 370keyword. 371 372@item -c @var{programmer-id} 373Specify the programmer to be used. AVRDUDE knows about several common 374programmers. Use this option to specify which one to use. The 375@var{programmer-id} parameter is the programmer's id listed in the 376configuration file. Specify -c ? to list all programmers in the 377configuration file. If you have a programmer that is unknown to 378AVRDUDE, and the programmer is controlled via the PC parallel port, 379there's a good chance that it can be easily added to the configuration 380file without any code changes to AVRDUDE. Simply copy an existing entry 381and change the pin definitions to match that of the unknown programmer. 382Currently, the following programmer ids are understood and supported: 383 384@multitable @columnfractions .2 .6 385@include programmers.texi 386@end multitable 387 388 389 390@item -C @var{config-file} 391Use the specified config file for configuration data. This file 392contains all programmer and part definitions that AVRDUDE knows about. 393If not 394specified, AVRDUDE reads the configuration file from 395/usr/local/etc/avrdude.conf (FreeBSD and Linux). See Appendix A for 396the method of searching for the configuration file for Windows. 397 398If @var{config-file} is written as @var{+filename} 399then this file is read after the system wide and user configuration 400files. This can be used to add entries to the configuration 401without patching your system wide configuration file. It can be used 402several times, the files are read in same order as given on the command 403line. 404 405 406@item -D 407Disable auto erase for flash. When the -U option with flash memory is 408specified, avrdude will perform a chip erase before starting any of the 409programming operations, since it generally is a mistake to program the flash 410without performing an erase first. This option disables that. 411Auto erase is not used for ATxmega devices as these devices can 412use page erase before writing each page so no explicit chip erase 413is required. 414Note however that any page not affected by the current operation 415will retain its previous contents. 416 417@item -e 418Causes a chip erase to be executed. This will reset the contents of the 419flash ROM and EEPROM to the value `0xff', and clear all lock bits. 420Except for ATxmega devices which can use page erase, 421it is basically a 422prerequisite command before the flash ROM can be reprogrammed again. 423The only exception would be if the new contents would exclusively cause 424bits to be programmed from the value `1' to `0'. Note that in order 425to reprogram EERPOM cells, no explicit prior chip erase is required 426since the MCU provides an auto-erase cycle in that case before 427programming the cell. 428 429 430@item -E @var{exitspec}[,@dots{}] 431By default, AVRDUDE leaves the parallel port in the same state at exit 432as it has been found at startup. This option modifies the state of the 433`/RESET' and `Vcc' lines the parallel port is left at, according to 434the exitspec arguments provided, as follows: 435 436@table @code 437@item reset 438The `/RESET' signal will be left activated at program exit, that is it 439will be held low, in order to keep the MCU in reset state afterwards. 440Note in particular that the programming algorithm for the AT90S1200 441device mandates that the `/RESET' signal is active before powering up 442the MCU, so in case an external power supply is used for this MCU type, 443a previous invocation of AVRDUDE with this option specified is one of 444the possible ways to guarantee this condition. 445 446@item noreset 447The `/RESET' line will be deactivated at program exit, thus allowing the 448MCU target program to run while the programming hardware remains 449connected. 450 451@item vcc 452This option will leave those parallel port pins active (i. e. high) that 453can be used to supply `Vcc' power to the MCU. 454 455@item novcc 456This option will pull the `Vcc' pins of the parallel port down at 457program exit. 458 459@item d_high 460This option will leave the 8 data pins on the parallel port active 461(i. e. high). 462 463@item d_low 464This option will leave the 8 data pins on the parallel port inactive 465(i. e. low). 466 467@end table 468 469Multiple @var{exitspec} arguments can be separated with commas. 470 471 472@item -F 473Normally, AVRDUDE tries to verify that the device signature read from 474the part is reasonable before continuing. Since it can happen from time 475to time that a device has a broken (erased or overwritten) device 476signature but is otherwise operating normally, this options is provided 477to override the check. 478Also, for programmers like the Atmel STK500 and STK600 which can 479adjust parameters local to the programming tool (independent of an 480actual connection to a target controller), this option can be used 481together with @option{-t} to continue in terminal mode. 482 483@item -i @var{delay} 484For bitbang-type programmers, delay for approximately 485@var{delay} 486microseconds between each bit state change. 487If the host system is very fast, or the target runs off a slow clock 488(like a 32 kHz crystal, or the 128 kHz internal RC oscillator), this 489can become necessary to satisfy the requirement that the ISP clock 490frequency must not be higher than 1/4 of the CPU clock frequency. 491This is implemented as a spin-loop delay to allow even for very 492short delays. 493On Unix-style operating systems, the spin loop is initially calibrated 494against a system timer, so the number of microseconds might be rather 495realistic, assuming a constant system load while AVRDUDE is running. 496On Win32 operating systems, a preconfigured number of cycles per 497microsecond is assumed that might be off a bit for very fast or very 498slow machines. 499 500@item -l @var{logfile} 501Use @var{logfile} rather than @var{stderr} for diagnostics output. 502Note that initial diagnostic messages (during option parsing) are still 503written to @var{stderr} anyway. 504 505@item -n 506No-write - disables actually writing data to the MCU (useful for 507debugging AVRDUDE). 508 509@item -O 510Perform a RC oscillator run-time calibration according to Atmel 511application note AVR053. 512This is only supported on the STK500v2, AVRISP mkII, and JTAG ICE mkII 513hardware. 514Note that the result will be stored in the EEPROM cell at address 0. 515 516@item -P @var{port} 517Use port to identify the device to which the programmer is attached. 518Normally, the default parallel port is used, but if the programmer type 519normally connects to the serial port, the default serial port will be 520used. See Appendix A, Platform Dependent Information, to find out the 521default port names for your platform. If you need to use a different 522parallel or serial port, use this option to specify the alternate port name. 523 524On Win32 operating systems, the parallel ports are referred to as lpt1 525through lpt3, referring to the addresses 0x378, 0x278, and 0x3BC, 526respectively. If the parallel port can be accessed through a different 527address, this address can be specified directly, using the common C 528language notation (i. e., hexadecimal values are prefixed by @var{0x}). 529 530For the JTAG ICE mkII, if AVRDUDE has been built with libusb support, 531@var{port} may alternatively be specified as 532@code{usb}[:@var{serialno}]. In that case, the JTAG ICE mkII will be 533looked up on USB. If @var{serialno} is also specified, it will be 534matched against the serial number read from any JTAG ICE mkII found on 535USB. The match is done after stripping any existing colons from the 536given serial number, and right-to-left, so only the least significant 537bytes from the serial number need to be given. 538For a trick how to find out the serial numbers of all JTAG ICEs 539attached to USB, see @ref{Example Command Line Invocations}. 540 541As the AVRISP mkII device can only be talked to over USB, the very 542same method of specifying the port is required there. 543 544For the USB programmer "AVR-Doper" running in HID mode, the port must 545be specified as @var{avrdoper}. Libusb support is required on Unix 546but not on Windows. For more information about AVR-Doper see 547@url{http://www.obdev.at/avrusb/avrdoper.html}. 548 549For the USBtinyISP, which is a simplistic device not implementing 550serial numbers, multiple devices can be distinguished by their 551location in the USB hierarchy. 552@xref{Troubleshooting}, for examples. 553 554For programmers that attach to a serial port using some kind of 555higher level protocol (as opposed to bit-bang style programmers), 556@var{port} can be specified as @code{net}:@var{host}:@var{port}. 557In this case, instead of trying to open a local device, a TCP 558network connection to (TCP) @var{port} on @var{host} 559is established. 560The remote endpoint is assumed to be a terminal or console server 561that connects the network stream to a local serial port where the 562actual programmer has been attached to. 563The port is assumed to be properly configured, for example using a 564transparent 8-bit data connection without parity at 115200 Baud 565for a STK500. 566 567 568@item -q 569Disable (or quell) output of the progress bar while reading or writing 570to the device. Specify it a second time for even quieter operation. 571 572@item -u 573Disables the default behaviour of reading out the fuses three times before 574programming, then verifying at the end of programming that the fuses have not 575changed. If you want to change fuses you will need to specify this option, 576as avrdude will see the fuses have changed (even though you wanted to) and 577will change them back for your "safety". This option was designed to 578prevent cases of fuse bits magically changing (usually called @emph{safemode}). 579 580If one of the configuration files contains a line 581 582@code{default_safemode = no;} 583 584safemode is disabled by default. 585The @option{-u} option's effect is negated in that case, i. e. it 586@emph{enables} safemode. 587 588Safemode is always disabled for AVR32, Xmega and TPI devices. 589 590@item -s 591Disable safemode prompting. When safemode discovers that one or more 592fuse bits have unintentionally changed, it will prompt for 593confirmation regarding whether or not it should attempt to recover the 594fuse bit(s). Specifying this flag disables the prompt and assumes 595that the fuse bit(s) should be recovered without asking for 596confirmation first. 597 598@item -t 599Tells AVRDUDE to enter the interactive ``terminal'' mode instead of up- 600or downloading files. See below for a detailed description of the 601terminal mode. 602 603@item -U @var{memtype}:@var{op}:@var{filename}[:@var{format}] 604Perform a memory operation. 605Multiple @option{-U} options can be specified in order to operate on 606multiple memories on the same command-line invocation. The 607@var{memtype} field specifies the memory type to operate on. Use 608the @option{-v} option on the command line or the @code{part} command from 609terminal mode to display all the memory types supported by a particular 610device. 611Typically, a device's memory configuration at least contains 612the memory types 613@code{flash} 614and 615@code{eeprom}. 616All memory types currently known are: 617@table @code 618@item calibration 619One or more bytes of RC oscillator calibration data. 620@item eeprom 621The EEPROM of the device. 622@item efuse 623The extended fuse byte. 624@item flash 625The flash ROM of the device. 626@item fuse 627The fuse byte in devices that have only a single fuse byte. 628@item hfuse 629The high fuse byte. 630@item lfuse 631The low fuse byte. 632@item lock 633The lock byte. 634@item signature 635The three device signature bytes (device ID). 636@item fuse@emph{N} 637The fuse bytes of ATxmega devices, @emph{N} is an integer number 638for each fuse supported by the device. 639@item application 640The application flash area of ATxmega devices. 641@item apptable 642The application table flash area of ATxmega devices. 643@item boot 644The boot flash area of ATxmega devices. 645@item prodsig 646The production signature (calibration) area of ATxmega devices. 647@item usersig 648The user signature area of ATxmega devices. 649@end table 650 651The @var{op} field specifies what operation to perform: 652 653@table @code 654@item r 655read the specified device memory and write to the specified file 656 657@item w 658read the specified file and write it to the specified device memory 659 660@item v 661read the specified device memory and the specified file and perform a verify operation 662 663@end table 664 665The @var{filename} field indicates the name of the file to read or 666write. The @var{format} field is optional and contains the format of 667the file to read or write. Possible values are: 668 669@table @code 670@item i 671Intel Hex 672 673@item s 674Motorola S-record 675 676@item r 677raw binary; little-endian byte order, in the case of the flash ROM data 678 679@item e 680ELF (Executable and Linkable Format), the final output file from the 681linker; currently only accepted as an input file 682 683@item m 684immediate mode; actual byte values specified on the command line, 685separated by commas or spaces in place of the @var{filename} field of 686the @option{-U} option. This is useful 687for programming fuse bytes without having to create a single-byte file 688or enter terminal mode. If the number specified begins with @code{0x}, 689it is treated as a hex value. If the number otherwise begins with a 690leading zero (@code{0}) it is treated as octal. Otherwise, the value is 691treated as decimal. 692 693@item a 694auto detect; valid for input only, and only if the input is not provided 695at stdin. 696 697@item d 698decimal; this and the following formats are only valid on output. 699They generate one line of output for the respective memory section, 700forming a comma-separated list of the values. 701This can be particularly useful for subsequent processing, like for 702fuse bit settings. 703 704@item h 705hexadecimal; each value will get the string @emph{0x} prepended. 706 707@item o 708octal; each value will get a @emph{0} 709prepended unless it is less than 8 in which case it gets no prefix. 710 711@item b 712binary; each value will get the string @emph{0b} prepended. 713 714@end table 715 716The default is to use auto detection for input files, and raw binary 717format for output files. 718 719Note that if @var{filename} contains a colon, the @var{format} field is 720no longer optional since the filename part following the colon would 721otherwise be misinterpreted as @var{format}. 722 723When reading any kind of flash memory area (including the various sub-areas 724in Xmega devices), the resulting output file will be truncated to not contain 725trailing 0xFF bytes which indicate unprogrammed (erased) memory. 726Thus, if the entire memory is unprogrammed, this will result in an output 727file that has no contents at all. 728 729As an abbreviation, the form @code{-U} @var{filename} 730is equivalent to specifying 731@code{-U} @emph{flash:w:}@var{filename}@emph{:a}. 732This will only work if @var{filename} does not have a colon in it. 733 734@item -v 735Enable verbose output. 736More @code{-v} options increase verbosity level. 737 738@item -V 739Disable automatic verify check when uploading data. 740 741@item -x @var{extended_param} 742Pass @var{extended_param} to the chosen programmer implementation as 743an extended parameter. The interpretation of the extended parameter 744depends on the programmer itself. See below for a list of programmers 745accepting extended parameters. 746 747@end table 748 749@page 750@c 751@c Node 752@c 753@node Programmers accepting extended parameters, Example Command Line Invocations, Option Descriptions, Command Line Options 754@section Programmers accepting extended parameters 755 756@table @code 757 758@item JTAG ICE mkII/3 759@itemx AVR Dragon 760 761When using the JTAG ICE mkII/3 or AVR Dragon in JTAG mode, the 762following extended parameter is accepted: 763@table @code 764@item @samp{jtagchain=UB,UA,BB,BA} 765Setup the JTAG scan chain for @var{UB} units before, @var{UA} units 766after, @var{BB} bits before, and @var{BA} bits after the target AVR, 767respectively. 768Each AVR unit within the chain shifts by 4 bits. 769Other JTAG units might require a different bit shift count. 770@end table 771 772@item AVR910 773 774The AVR910 programmer type accepts the following extended parameter: 775@table @code 776@item @samp{devcode=VALUE} 777Override the device code selection by using @var{VALUE} 778as the device code. 779The programmer is not queried for the list of supported 780device codes, and the specified @var{VALUE} 781is not verified but used directly within the 782@code{T} command sent to the programmer. 783@var{VALUE} can be specified using the conventional number notation of the 784C programming language. 785@item @samp{no_blockmode} 786Disables the default checking for block transfer capability. 787Use 788@samp{no_blockmode} only if your @samp{AVR910} 789programmer creates errors during initial sequence. 790@end table 791 792@item BusPirate 793 794The BusPirate programmer type accepts the following extended parameters: 795@table @code 796@item @samp{reset=cs,aux,aux2} 797The default setup assumes the BusPirate's CS output pin connected to 798the RESET pin on AVR side. It is however possible to have multiple AVRs 799connected to the same BP with MISO, MOSI and SCK lines common for all of them. 800In such a case one AVR should have its RESET connected to BusPirate's 801@emph{CS} 802pin, second AVR's RESET connected to BusPirate's 803@emph{AUX} 804pin and if your BusPirate has an 805@emph{AUX2} 806pin (only available on BusPirate version v1a with firmware 3.0 or newer) 807use that to activate RESET on the third AVR. 808 809It may be a good idea to decouple the BusPirate and the AVR's SPI buses from 810each other using a 3-state bus buffer. For example 74HC125 or 74HC244 are some 811good candidates with the latches driven by the appropriate reset pin (cs, 812aux or aux2). Otherwise the SPI traffic in one active circuit may interfere 813with programming the AVR in the other design. 814 815@item @samp{spifreq=@var{0..7}} 816@multitable @columnfractions .05 .3 817@item @code{0} @tab 30 kHz (default) 818@item @code{1} @tab 125 kHz 819@item @code{2} @tab 250 kHz 820@item @code{3} @tab 1 MHz 821@item @code{4} @tab 2 MHz 822@item @code{5} @tab 2.6 MHz 823@item @code{6} @tab 4 MHz 824@item @code{7} @tab 8 MHz 825@end multitable 826 827@item @samp{rawfreq=0..3} 828Sets the SPI speed and uses the Bus Pirate's binary ``raw-wire'' mode instead 829of the default binary SPI mode: 830 831@multitable @columnfractions .05 .3 832@item @code{0} @tab 5 kHz 833@item @code{1} @tab 50 kHz 834@item @code{2} @tab 100 kHz (Firmware v4.2+ only) 835@item @code{3} @tab 400 kHz (v4.2+) 836@end multitable 837 838The only advantage of the ``raw-wire'' mode is that different SPI frequencies 839are available. Paged writing is not implemented in this mode. 840 841@item @samp{ascii} 842Attempt to use ASCII mode even when the firmware supports BinMode (binary 843mode). 844BinMode is supported in firmware 2.7 and newer, older FW's either don't 845have BinMode or their BinMode is buggy. ASCII mode is slower and makes 846the above 847@samp{reset=}, @samp{spifreq=} 848and 849@samp{rawfreq=} 850parameters unavailable. Be aware that ASCII mode is not guaranteed to work 851with newer firmware versions, and is retained only to maintain compatibility 852with older firmware versions. 853 854@item @samp{nopagedwrite} 855Firmware versions 5.10 and newer support a binary mode SPI command that enables 856whole pages to be written to AVR flash memory at once, resulting in a 857significant write speed increase. If use of this mode is not desirable for some 858reason, this option disables it. 859 860@item @samp{nopagedread} 861Newer firmware versions support in binary mode SPI command some AVR Extended 862Commands. Using the ``Bulk Memory Read from Flash'' results in a 863significant read speed increase. If use of this mode is not desirable for some 864reason, this option disables it. 865 866@item @samp{cpufreq=@var{125..4000}} 867This sets the @emph{AUX} pin to output a frequency of @var{n} kHz. Connecting 868the @emph{AUX} pin to the XTAL1 pin of your MCU, you can provide it a clock, 869for example when it needs an external clock because of wrong fuses settings. 870Make sure the CPU frequency is at least four times the SPI frequency. 871 872@item @samp{serial_recv_timeout=@var{1...}} 873This sets the serial receive timeout to the given value. 874The timeout happens every time avrdude waits for the BusPirate prompt. 875Especially in ascii mode this happens very often, so setting a smaller value 876can speed up programming a lot. 877The default value is 100ms. Using 10ms might work in most cases. 878 879@end table 880 881@item Wiring 882 883When using the Wiring programmer type, the 884following optional extended parameter is accepted: 885@table @code 886@item @samp{snooze=@var{0..32767}} 887After performing the port open phase, AVRDUDE will wait/snooze for 888@var{snooze} milliseconds before continuing to the protocol sync phase. 889No toggling of DTR/RTS is performed if @var{snooze} > 0. 890@end table 891 892@item PICkit2 893Connection to the PICkit2 programmer: 894@multitable @columnfractions .05 .3 895@item @code{(AVR)} @tab @code{(PICkit2)} 896@item @code{RST} @tab @code{VPP/MCLR (1) } 897@item @code{VDD} @tab @code{VDD Target (2) -- possibly optional if AVR self powered } 898@item @code{GND} @tab @code{GND (3) } 899@item @code{MISO} @tab @code{PGD (4) } 900@item @code{SCLK} @tab @code{PDC (5) } 901@item @code{OSI} @tab @code{AUX (6) } 902@end multitable 903 904Extended command line parameters: 905@table @code 906@item @samp{clockrate=@var{rate}} 907Sets the SPI clocking rate in Hz (default is 100kHz). Alternately the -B or -i options can be used to set the period. 908@item @samp{timeout=@var{usb-transaction-timeout}} 909Sets the timeout for USB reads and writes in milliseconds (default is 1500 ms). 910@end table 911 912@end table 913 914@page 915@c 916@c Node 917@c 918@node Example Command Line Invocations, , Programmers accepting extended parameters, Command Line Options 919@section Example Command Line Invocations 920 921@noindent 922Download the file @code{diag.hex} to the ATmega128 chip using the 923STK500 programmer connected to the default serial port: 924 925@smallexample 926@cartouche 927% avrdude -p m128 -c stk500 -e -U flash:w:diag.hex 928 929avrdude: AVR device initialized and ready to accept instructions 930 931Reading | ################################################## | 100% 0.03s 932 933avrdude: Device signature = 0x1e9702 934avrdude: erasing chip 935avrdude: done. 936avrdude: performing op: 1, flash, 0, diag.hex 937avrdude: reading input file "diag.hex" 938avrdude: input file diag.hex auto detected as Intel Hex 939avrdude: writing flash (19278 bytes): 940 941Writing | ################################################## | 100% 7.60s 942 943avrdude: 19456 bytes of flash written 944avrdude: verifying flash memory against diag.hex: 945avrdude: load data flash data from input file diag.hex: 946avrdude: input file diag.hex auto detected as Intel Hex 947avrdude: input file diag.hex contains 19278 bytes 948avrdude: reading on-chip flash data: 949 950Reading | ################################################## | 100% 6.83s 951 952avrdude: verifying ... 953avrdude: 19278 bytes of flash verified 954 955avrdude: safemode: Fuses OK 956 957avrdude done. Thank you. 958 959% 960@end cartouche 961@end smallexample 962 963@page 964@noindent 965Upload the flash memory from the ATmega128 connected to the STK500 966programmer and save it in raw binary format in the file named 967@code{c:/diag flash.bin}: 968 969@smallexample 970@cartouche 971% avrdude -p m128 -c stk500 -U flash:r:"c:/diag flash.bin":r 972 973avrdude: AVR device initialized and ready to accept instructions 974 975Reading | ################################################## | 100% 0.03s 976 977avrdude: Device signature = 0x1e9702 978avrdude: reading flash memory: 979 980Reading | ################################################## | 100% 46.10s 981 982avrdude: writing output file "c:/diag flash.bin" 983 984avrdude: safemode: Fuses OK 985 986avrdude done. Thank you. 987 988% 989@end cartouche 990@end smallexample 991 992@page 993@noindent 994Using the default programmer, download the file @code{diag.hex} to 995flash, @code{eeprom.hex} to EEPROM, and set the Extended, High, and Low 996fuse bytes to 0xff, 0x89, and 0x2e respectively: 997 998@smallexample 999@cartouche 1000 1001% avrdude -p m128 -u -U flash:w:diag.hex \ 1002> -U eeprom:w:eeprom.hex \ 1003> -U efuse:w:0xff:m \ 1004> -U hfuse:w:0x89:m \ 1005> -U lfuse:w:0x2e:m 1006 1007avrdude: AVR device initialized and ready to accept instructions 1008 1009Reading | ################################################## | 100% 0.03s 1010 1011avrdude: Device signature = 0x1e9702 1012avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed 1013 To disable this feature, specify the -D option. 1014avrdude: erasing chip 1015avrdude: reading input file "diag.hex" 1016avrdude: input file diag.hex auto detected as Intel Hex 1017avrdude: writing flash (19278 bytes): 1018 1019Writing | ################################################## | 100% 7.60s 1020 1021avrdude: 19456 bytes of flash written 1022avrdude: verifying flash memory against diag.hex: 1023avrdude: load data flash data from input file diag.hex: 1024avrdude: input file diag.hex auto detected as Intel Hex 1025avrdude: input file diag.hex contains 19278 bytes 1026avrdude: reading on-chip flash data: 1027 1028Reading | ################################################## | 100% 6.84s 1029 1030avrdude: verifying ... 1031avrdude: 19278 bytes of flash verified 1032 1033[ ... other memory status output skipped for brevity ... ] 1034 1035avrdude done. Thank you. 1036 1037% 1038@end cartouche 1039@end smallexample 1040 1041@page 1042@noindent 1043Connect to the JTAG ICE mkII which serial number ends up in 1C37 via 1044USB, and enter terminal mode: 1045 1046@smallexample 1047@cartouche 1048 1049% avrdude -c jtag2 -p m649 -P usb:1c:37 -t 1050 1051avrdude: AVR device initialized and ready to accept instructions 1052 1053Reading | ################################################## | 100% 0.03s 1054 1055avrdude: Device signature = 0x1e9603 1056 1057[ ... terminal mode output skipped for brevity ... ] 1058 1059avrdude done. Thank you. 1060 1061@end cartouche 1062@end smallexample 1063 1064@noindent 1065List the serial numbers of all JTAG ICEs attached to USB. This is 1066done by specifying an invalid serial number, and increasing the 1067verbosity level. 1068 1069@smallexample 1070@cartouche 1071 1072% avrdude -c jtag2 -p m128 -P usb:xx -v 1073[...] 1074 Using Port : usb:xxx 1075 Using Programmer : jtag2 1076avrdude: usbdev_open(): Found JTAG ICE, serno: 00A000001C6B 1077avrdude: usbdev_open(): Found JTAG ICE, serno: 00A000001C3A 1078avrdude: usbdev_open(): Found JTAG ICE, serno: 00A000001C30 1079avrdude: usbdev_open(): did not find any (matching) USB device "usb:xxx" 1080 1081@end cartouche 1082@end smallexample 1083 1084 1085@c 1086@c Node 1087@c 1088@node Terminal Mode Operation, Configuration File, Command Line Options, Top 1089@chapter Terminal Mode Operation 1090 1091AVRDUDE has an interactive mode called @var{terminal mode} that is 1092enabled by the @option{-t} option. This mode allows one to enter 1093interactive commands to display and modify the various device memories, 1094perform a chip erase, display the device signature bytes and part 1095parameters, and to send raw programming commands. Commands and 1096parameters may be abbreviated to their shortest unambiguous form. 1097Terminal mode also supports a command history so that previously entered 1098commands can be recalled and edited. 1099 1100@menu 1101* Terminal Mode Commands:: 1102* Terminal Mode Examples:: 1103@end menu 1104 1105@node Terminal Mode Commands, Terminal Mode Examples, Terminal Mode Operation, Terminal Mode Operation 1106@section Terminal Mode Commands 1107 1108@noindent 1109The following commands are implemented: 1110 1111@table @code 1112 1113@item dump @var{memtype} @var{addr} @var{nbytes} 1114Read @var{nbytes} from the specified memory area, and display them in 1115the usual hexadecimal and ASCII form. 1116 1117@item dump 1118Continue dumping the memory contents for another @var{nbytes} where the 1119previous dump command left off. 1120 1121@item write @var{memtype} @var{addr} @var{byte1} @dots{} @var{byteN} 1122Manually program the respective memory cells, starting at address addr, 1123using the values @var{byte1} through @var{byteN}. This feature is not 1124implemented for bank-addressed memories such as the flash memory of 1125ATMega devices. 1126 1127@item erase 1128Perform a chip erase. 1129 1130@item send @var{b1} @var{b2} @var{b3} @var{b4} 1131Send raw instruction codes to the AVR device. If you need access to a 1132feature of an AVR part that is not directly supported by AVRDUDE, this 1133command allows you to use it, even though AVRDUDE does not implement the 1134command. When using direct SPI mode, up to 3 bytes 1135can be omitted. 1136 1137@item sig 1138Display the device signature bytes. 1139 1140@item spi 1141Enter direct SPI mode. The @emph{pgmled} pin acts as slave select. 1142@emph{Only supported on parallel bitbang programmers.} 1143 1144@item part 1145Display the current part settings and parameters. Includes chip 1146specific information including all memory types supported by the 1147device, read/write timing, etc. 1148 1149@item pgm 1150Return to programming mode (from direct SPI mode). 1151 1152@item verbose [@var{level}] 1153Change (when @var{level} is provided), or display the verbosity 1154level. 1155The initial verbosity level is controlled by the number of @code{-v} options 1156given on the command line. 1157 1158@item ? 1159@itemx help 1160Give a short on-line summary of the available commands. 1161 1162@item quit 1163Leave terminal mode and thus AVRDUDE. 1164 1165@end table 1166 1167@noindent 1168In addition, the following commands are supported on the STK500 1169and STK600 programmer: 1170 1171@table @code 1172 1173@item vtarg @var{voltage} 1174Set the target's supply voltage to @var{voltage} Volts. 1175 1176@item varef [@var{channel}] @var{voltage} 1177Set the adjustable voltage source to @var{voltage} Volts. 1178This voltage is normally used to drive the target's 1179@emph{Aref} input on the STK500 and STK600. 1180The STK600 offers two reference voltages, which can be 1181selected by the optional parameter @var{channel} (either 11820 or 1). 1183 1184@item fosc @var{freq}[@code{M}|@code{k}] 1185Set the master oscillator to @var{freq} Hz. 1186An optional trailing letter @code{M} 1187multiplies by 1E6, a trailing letter @code{k} by 1E3. 1188 1189@item fosc off 1190Turn the master oscillator off. 1191 1192@item sck @var{period} 1193@emph{STK500 and STK600 only:} 1194Set the SCK clock period to @var{period} microseconds. 1195 1196@emph{JTAG ICE only:} 1197Set the JTAG ICE bit clock period to @var{period} microseconds. 1198Note that unlike STK500 settings, this setting will be reverted to 1199its default value (approximately 1 microsecond) when the programming 1200software signs off from the JTAG ICE. 1201This parameter can also be used on the JTAG ICE mkII/3 to specify the 1202ISP clock period when operating the ICE in ISP mode. 1203 1204@item parms 1205@emph{STK500 and STK600 only:} 1206Display the current voltage and master oscillator parameters. 1207 1208@emph{JTAG ICE only:} 1209Display the current target supply voltage and JTAG bit clock rate/period. 1210 1211@end table 1212 1213@c 1214@c Node 1215@c 1216@node Terminal Mode Examples, , Terminal Mode Commands, Terminal Mode Operation 1217@section Terminal Mode Examples 1218 1219@noindent 1220Display part parameters, modify eeprom cells, perform a chip erase: 1221 1222@smallexample 1223@cartouche 1224% avrdude -p m128 -c stk500 -t 1225 1226avrdude: AVR device initialized and ready to accept instructions 1227avrdude: Device signature = 0x1e9702 1228avrdude: current erase-rewrite cycle count is 52 (if being tracked) 1229avrdude> part 1230>>> part 1231 1232AVR Part : ATMEGA128 1233Chip Erase delay : 9000 us 1234PAGEL : PD7 1235BS2 : PA0 1236RESET disposition : dedicated 1237RETRY pulse : SCK 1238serial program mode : yes 1239parallel program mode : yes 1240Memory Detail : 1241 1242 Page Polled 1243 Memory Type Paged Size Size #Pages MinW MaxW ReadBack 1244 ----------- ------ ------ ---- ------ ----- ----- --------- 1245 eeprom no 4096 8 0 9000 9000 0xff 0xff 1246 flash yes 131072 256 512 4500 9000 0xff 0x00 1247 lfuse no 1 0 0 0 0 0x00 0x00 1248 hfuse no 1 0 0 0 0 0x00 0x00 1249 efuse no 1 0 0 0 0 0x00 0x00 1250 lock no 1 0 0 0 0 0x00 0x00 1251 calibration no 1 0 0 0 0 0x00 0x00 1252 signature no 3 0 0 0 0 0x00 0x00 1253 1254avrdude> dump eeprom 0 16 1255>>> dump eeprom 0 16 12560000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 1257 1258avrdude> write eeprom 0 1 2 3 4 1259>>> write eeprom 0 1 2 3 4 1260 1261avrdude> dump eeprom 0 16 1262>>> dump eeprom 0 16 12630000 01 02 03 04 ff ff ff ff ff ff ff ff ff ff ff ff |................| 1264 1265avrdude> erase 1266>>> erase 1267avrdude: erasing chip 1268avrdude> dump eeprom 0 16 1269>>> dump eeprom 0 16 12700000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 1271 1272avrdude> 1273@end cartouche 1274@end smallexample 1275 1276 1277@noindent 1278Program the fuse bits of an ATmega128 (disable M103 compatibility, 1279enable high speed external crystal, enable brown-out detection, slowly 1280rising power). Note since we are working with fuse bits the -u (unsafe) 1281option is specified, which allows you to modify the fuse bits. First 1282display the factory defaults, then reprogram: 1283 1284@smallexample 1285@cartouche 1286% avrdude -p m128 -u -c stk500 -t 1287 1288avrdude: AVR device initialized and ready to accept instructions 1289avrdude: Device signature = 0x1e9702 1290avrdude: current erase-rewrite cycle count is 52 (if being tracked) 1291avrdude> d efuse 1292>>> d efuse 12930000 fd |. | 1294 1295avrdude> d hfuse 1296>>> d hfuse 12970000 99 |. | 1298 1299avrdude> d lfuse 1300>>> d lfuse 13010000 e1 |. | 1302 1303avrdude> w efuse 0 0xff 1304>>> w efuse 0 0xff 1305 1306avrdude> w hfuse 0 0x89 1307>>> w hfuse 0 0x89 1308 1309avrdude> w lfuse 0 0x2f 1310>>> w lfuse 0 0x2f 1311 1312avrdude> 1313@end cartouche 1314@end smallexample 1315 1316 1317@c 1318@c Node 1319@c 1320@node Configuration File, Programmer Specific Information, Terminal Mode Operation, Top 1321@chapter Configuration File 1322 1323@noindent 1324AVRDUDE reads a configuration file upon startup which describes all of 1325the parts and programmers that it knows about. The advantage of this is 1326that if you have a chip that is not currently supported by AVRDUDE, you 1327can add it to the configuration file without waiting for a new release 1328of AVRDUDE. Likewise, if you have a parallel port programmer that is 1329not supported by AVRDUDE, chances are good that you can copy and 1330existing programmer definition, and with only a few changes, make your 1331programmer work with AVRDUDE. 1332 1333AVRDUDE first looks for a system wide configuration file in a platform 1334dependent location. On Unix, this is usually 1335@code{/usr/local/etc/avrdude.conf}, while on Windows it is usually in the 1336same location as the executable file. The name of this file can be 1337changed using the @option{-C} command line option. After the system wide 1338configuration file is parsed, AVRDUDE looks for a per-user configuration 1339file to augment or override the system wide defaults. On Unix, the 1340per-user file is @code{.avrduderc} within the user's home directory. On 1341Windows, this file is the @code{avrdude.rc} file located in the same 1342directory as the executable. 1343 1344@menu 1345* AVRDUDE Defaults:: 1346* Programmer Definitions:: 1347* Part Definitions:: 1348* Other Notes:: 1349@end menu 1350 1351@c 1352@c Node 1353@c 1354@node AVRDUDE Defaults, Programmer Definitions, Configuration File, Configuration File 1355@section AVRDUDE Defaults 1356 1357@table @code 1358 1359@item default_parallel = "@var{default-parallel-device}"; 1360Assign the default parallel port device. Can be overridden using the 1361@option{-P} option. 1362 1363@item default_serial = "@var{default-serial-device}"; 1364Assign the default serial port device. Can be overridden using the 1365@option{-P} option. 1366 1367@item default_programmer = "@var{default-programmer-id}"; 1368Assign the default programmer id. Can be overridden using the @option{-c} 1369option. 1370 1371@item default_bitclock = "@var{default-bitclock}"; 1372Assign the default bitclock value. Can be overridden using the @option{-B} 1373option. 1374 1375@end table 1376 1377 1378@c 1379@c Node 1380@c 1381@node Programmer Definitions, Part Definitions, AVRDUDE Defaults, Configuration File 1382@section Programmer Definitions 1383 1384@noindent 1385The format of the programmer definition is as follows: 1386 1387@smallexample 1388programmer 1389 parent <id> # <id> is a quoted string 1390 id = <id1> [, <id2> [, <id3>] ...] ; # <idN> are quoted strings 1391 desc = <description> ; # quoted string 1392 type = "par" | "stk500" | ... ; # programmer type (see below for a list) 1393 baudrate = <num> ; # baudrate for serial ports 1394 vcc = <num1> [, <num2> ... ] ; # pin number(s) 1395 buff = <num1> [, <num2> ... ] ; # pin number(s) 1396 reset = <num> ; # pin number 1397 sck = <num> ; # pin number 1398 mosi = <num> ; # pin number 1399 miso = <num> ; # pin number 1400 errled = <num> ; # pin number 1401 rdyled = <num> ; # pin number 1402 pgmled = <num> ; # pin number 1403 vfyled = <num> ; # pin number 1404 usbvid = <hexnum>; # USB VID (Vendor ID) 1405 usbpid = <hexnum> [, <hexnum> ...]; # USB PID (Product ID) 1406 usbdev = <interface>; # USB interface or other device info 1407 usbvendor = <vendorname>; # USB Vendor Name 1408 usbproduct = <productname>; # USB Product Name 1409 usbsn = <serialno>; # USB Serial Number 1410 ; 1411@end smallexample 1412 1413@noindent 1414If a parent is specified, all settings of it (except its ids) are used for the new 1415programmer. These values can be changed by new setting them for the new programmer. 1416 1417@noindent 1418To invert a bit in the pin definitions, use @code{= ~ <num>}. 1419 1420@noindent 1421Not all programmer types can handle a list of USB PIDs. 1422 1423@noindent 1424Following programmer types are currently implemented: 1425 1426@multitable @columnfractions .25 .6 1427@include programmer_types.texi 1428@end multitable 1429 1430@c 1431@c Node 1432@c 1433@node Part Definitions, Other Notes, Programmer Definitions, Configuration File 1434@section Part Definitions 1435 1436@smallexample 1437part 1438 id = <id> ; # quoted string 1439 desc = <description> ; # quoted string 1440 has_jtag = <yes/no> ; # part has JTAG i/f 1441 has_debugwire = <yes/no> ; # part has debugWire i/f 1442 has_pdi = <yes/no> ; # part has PDI i/f 1443 has_tpi = <yes/no> ; # part has TPI i/f 1444 devicecode = <num> ; # numeric 1445 stk500_devcode = <num> ; # numeric 1446 avr910_devcode = <num> ; # numeric 1447 signature = <num> <num> <num> ; # signature bytes 1448 usbpid = <num> ; # DFU USB PID 1449 reset = dedicated | io; 1450 retry_pulse = reset | sck; 1451 pgm_enable = <instruction format> ; 1452 chip_erase = <instruction format> ; 1453 chip_erase_delay = <num> ; # micro-seconds 1454 # STK500 parameters (parallel programming IO lines) 1455 pagel = <num> ; # pin name in hex, i.e., 0xD7 1456 bs2 = <num> ; # pin name in hex, i.e., 0xA0 1457 serial = <yes/no> ; # can use serial downloading 1458 parallel = <yes/no/pseudo>; # can use par. programming 1459 # STK500v2 parameters, to be taken from Atmel's XML files 1460 timeout = <num> ; 1461 stabdelay = <num> ; 1462 cmdexedelay = <num> ; 1463 synchloops = <num> ; 1464 bytedelay = <num> ; 1465 pollvalue = <num> ; 1466 pollindex = <num> ; 1467 predelay = <num> ; 1468 postdelay = <num> ; 1469 pollmethod = <num> ; 1470 mode = <num> ; 1471 delay = <num> ; 1472 blocksize = <num> ; 1473 readsize = <num> ; 1474 hvspcmdexedelay = <num> ; 1475 # STK500v2 HV programming parameters, from XML 1476 pp_controlstack = <num>, <num>, ...; # PP only 1477 hvsp_controlstack = <num>, <num>, ...; # HVSP only 1478 hventerstabdelay = <num>; 1479 progmodedelay = <num>; # PP only 1480 latchcycles = <num>; 1481 togglevtg = <num>; 1482 poweroffdelay = <num>; 1483 resetdelayms = <num>; 1484 resetdelayus = <num>; 1485 hvleavestabdelay = <num>; 1486 resetdelay = <num>; 1487 synchcycles = <num>; # HVSP only 1488 chiperasepulsewidth = <num>; # PP only 1489 chiperasepolltimeout = <num>; 1490 chiperasetime = <num>; # HVSP only 1491 programfusepulsewidth = <num>; # PP only 1492 programfusepolltimeout = <num>; 1493 programlockpulsewidth = <num>; # PP only 1494 programlockpolltimeout = <num>; 1495 # JTAG ICE mkII parameters, also from XML files 1496 allowfullpagebitstream = <yes/no> ; 1497 enablepageprogramming = <yes/no> ; 1498 idr = <num> ; # IO addr of IDR (OCD) reg. 1499 rampz = <num> ; # IO addr of RAMPZ reg. 1500 spmcr = <num> ; # mem addr of SPMC[S]R reg. 1501 eecr = <num> ; # mem addr of EECR reg. 1502 # (only when != 0x3c) 1503 is_at90s1200 = <yes/no> ; # AT90S1200 part 1504 is_avr32 = <yes/no> ; # AVR32 part 1505 1506 memory <memtype> 1507 paged = <yes/no> ; # yes / no 1508 size = <num> ; # bytes 1509 page_size = <num> ; # bytes 1510 num_pages = <num> ; # numeric 1511 min_write_delay = <num> ; # micro-seconds 1512 max_write_delay = <num> ; # micro-seconds 1513 readback_p1 = <num> ; # byte value 1514 readback_p2 = <num> ; # byte value 1515 pwroff_after_write = <yes/no> ; # yes / no 1516 read = <instruction format> ; 1517 write = <instruction format> ; 1518 read_lo = <instruction format> ; 1519 read_hi = <instruction format> ; 1520 write_lo = <instruction format> ; 1521 write_hi = <instruction format> ; 1522 loadpage_lo = <instruction format> ; 1523 loadpage_hi = <instruction format> ; 1524 writepage = <instruction format> ; 1525 ; 1526 ; 1527@end smallexample 1528 1529@menu 1530* Parent Part:: 1531* Instruction Format:: 1532@end menu 1533 1534@c 1535@c Node 1536@c 1537@node Parent Part, Instruction Format, Part Definitions, Part Definitions 1538@subsection Parent Part 1539 1540@noindent 1541Parts can also inherit parameters from previously defined parts 1542using the following syntax. In this case specified integer and 1543string values override parameter values from the parent part. New 1544memory definitions are added to the definitions inherited from the 1545parent. 1546 1547@smallexample 1548 part parent <id> # quoted string 1549 id = <id> ; # quoted string 1550 <any set of other parameters from the list above> 1551 ; 1552@end smallexample 1553 1554@c 1555@c Node 1556@c 1557@node Instruction Format, , Parent Part, Part Definitions 1558@subsection Instruction Format 1559 1560@noindent 1561Instruction formats are specified as a comma separated list of string 1562values containing information (bit specifiers) about each of the 32 bits 1563of the instruction. Bit specifiers may be one of the following formats: 1564 1565@table @code 1566 1567@item 1 1568The bit is always set on input as well as output 1569 1570@item 0 1571the bit is always clear on input as well as output 1572 1573@item x 1574the bit is ignored on input and output 1575 1576@item a 1577the bit is an address bit, the bit-number matches this bit specifier's 1578position within the current instruction byte 1579 1580@item a@var{N} 1581the bit is the @var{N}th address bit, bit-number = N, i.e., @code{a12} 1582is address bit 12 on input, @code{a0} is address bit 0. 1583 1584@item i 1585the bit is an input data bit 1586 1587@item o 1588the bit is an output data bit 1589 1590@end table 1591 1592Each instruction must be composed of 32 bit specifiers. The instruction 1593specification closely follows the instruction data provided in Atmel's 1594data sheets for their parts. For example, the EEPROM read and write 1595instruction for an AT90S2313 AVR part could be encoded as: 1596 1597@smallexample 1598 1599read = "1 0 1 0 0 0 0 0 x x x x x x x x", 1600 "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; 1601 1602write = "1 1 0 0 0 0 0 0 x x x x x x x x", 1603 "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; 1604 1605@end smallexample 1606 1607 1608 1609@c 1610@c Node 1611@c 1612@node Other Notes, , Part Definitions, Configuration File 1613@section Other Notes 1614 1615 1616@itemize @bullet 1617@item 1618The @code{devicecode} parameter is the device code used by the STK500 1619and is obtained from the software section (@code{avr061.zip}) of 1620Atmel's AVR061 application note available from 1621@url{http://www.atmel.com/dyn/resources/prod_documents/doc2525.pdf}. 1622 1623@item 1624Not all memory types will implement all instructions. 1625 1626@item 1627AVR Fuse bits and Lock bits are implemented as a type of memory. 1628 1629@item 1630Example memory types are: @code{flash}, @code{eeprom}, @code{fuse}, 1631@code{lfuse} (low fuse), @code{hfuse} (high fuse), @code{efuse} 1632(extended fuse), @code{signature}, @code{calibration}, @code{lock}. 1633 1634@item 1635The memory type specified on the AVRDUDE command line must match one of 1636the memory types defined for the specified chip. 1637 1638@item 1639The @code{pwroff_after_write} flag causes AVRDUDE to attempt to power 1640the device off and back on after an unsuccessful write to the affected 1641memory area if VCC programmer pins are defined. If VCC pins are not 1642defined for the programmer, a message indicating that the device needs a 1643power-cycle is printed out. This flag was added to work around a 1644problem with the at90s4433/2333's; see the at90s4433 errata at: 1645 1646 @url{http://www.atmel.com/dyn/resources/prod_documents/doc1280.pdf} 1647 1648@item 1649The boot loader from application note AVR109 (and thus also the AVR 1650Butterfly) does not support writing of fuse bits. Writing lock bits 1651is supported, but is restricted to the boot lock bits (BLBxx). These 1652are restrictions imposed by the underlying SPM instruction that is used 1653to program the device from inside the boot loader. Note that programming 1654the boot lock bits can result in a ``shoot-into-your-foot'' scenario as 1655the only way to unprogram these bits is a chip erase, which will also 1656erase the boot loader code. 1657 1658The boot loader implements the ``chip erase'' function by erasing the 1659flash pages of the application section. 1660 1661Reading fuse and lock bits is fully supported. 1662 1663Note that due to the inability to write the fuse bits, the safemode 1664functionality does not make sense for these boot loaders. 1665 1666@end itemize 1667 1668@c 1669@c Node 1670@c 1671@node Programmer Specific Information, Platform Dependent Information, Configuration File, Top 1672@chapter Programmer Specific Information 1673 1674@menu 1675* Atmel STK600:: 1676* Atmel DFU bootloader using FLIP version 1:: 1677@end menu 1678 1679@c 1680@c Node 1681@c 1682@node Atmel STK600, Atmel DFU bootloader using FLIP version 1, Programmer Specific Information, Programmer Specific Information 1683@section Atmel STK600 1684 1685@c 1686@c Update the table below by running the tools/get-stk600-devices.xsl 1687@c XSLT transformation on targetboard.xml as shipped by the latest 1688@c release of AVR Studio. 1689@c 1690The following devices are supported by the respective STK600 routing 1691and socket card: 1692 1693@multitable @columnfractions .25 .25 .5 1694@headitem Routing card @tab Socket card @tab Devices 1695@item @code{} @tab @code{STK600-ATTINY10} @tab ATtiny4 ATtiny5 ATtiny9 ATtiny10 1696@item @code{STK600-RC008T-2} @tab @code{STK600-DIP} @tab ATtiny11 ATtiny12 ATtiny13 ATtiny13A ATtiny25 ATtiny45 ATtiny85 1697@item @code{STK600-RC008T-7} @tab @code{STK600-DIP} @tab ATtiny15 1698@item @code{STK600-RC014T-42} @tab @code{STK600-SOIC} @tab ATtiny20 1699@item @code{STK600-RC020T-1} @tab @code{STK600-DIP} @tab ATtiny2313 ATtiny2313A ATtiny4313 1700@item @code{} @tab @code{STK600-TinyX3U} @tab ATtiny43U 1701@item @code{STK600-RC014T-12} @tab @code{STK600-DIP} @tab ATtiny24 ATtiny44 ATtiny84 ATtiny24A ATtiny44A 1702@item @code{STK600-RC020T-8} @tab @code{STK600-DIP} @tab ATtiny26 ATtiny261 ATtiny261A ATtiny461 ATtiny861 ATtiny861A 1703@item @code{STK600-RC020T-43} @tab @code{STK600-SOIC} @tab ATtiny261 ATtiny261A ATtiny461 ATtiny461A ATtiny861 ATtiny861A 1704@item @code{STK600-RC020T-23} @tab @code{STK600-SOIC} @tab ATtiny87 ATtiny167 1705@item @code{STK600-RC028T-3} @tab @code{STK600-DIP} @tab ATtiny28 1706@item @code{STK600-RC028M-6} @tab @code{STK600-DIP} @tab ATtiny48 ATtiny88 ATmega8 ATmega8A ATmega48 ATmega88 ATmega168 ATmega48P ATmega48PA ATmega88P ATmega88PA ATmega168P ATmega168PA ATmega328P 1707@item @code{} @tab @code{QT600-ATTINY88-QT8} @tab ATtiny88 1708@item @code{STK600-RC040M-4} @tab @code{STK600-DIP} @tab ATmega8515 ATmega162 1709@item @code{STK600-RC044M-30} @tab @code{STK600-TQFP44} @tab ATmega8515 ATmega162 1710@item @code{STK600-RC040M-5} @tab @code{STK600-DIP} @tab ATmega8535 ATmega16 ATmega16A ATmega32 ATmega32A ATmega164P ATmega164PA ATmega324P ATmega324PA ATmega644 ATmega644P ATmega644PA ATmega1284P 1711@item @code{STK600-RC044M-31} @tab @code{STK600-TQFP44} @tab ATmega8535 ATmega16 ATmega16A ATmega32 ATmega32A ATmega164P ATmega164PA ATmega324P ATmega324PA ATmega644 ATmega644P ATmega644PA ATmega1284P 1712@item @code{} @tab @code{QT600-ATMEGA324-QM64} @tab ATmega324PA 1713@item @code{STK600-RC032M-29} @tab @code{STK600-TQFP32} @tab ATmega8 ATmega8A ATmega48 ATmega88 ATmega168 ATmega48P ATmega48PA ATmega88P ATmega88PA ATmega168P ATmega168PA ATmega328P 1714@item @code{STK600-RC064M-9} @tab @code{STK600-TQFP64} @tab ATmega64 ATmega64A ATmega128 ATmega128A ATmega1281 ATmega2561 AT90CAN32 AT90CAN64 AT90CAN128 1715@item @code{STK600-RC064M-10} @tab @code{STK600-TQFP64} @tab ATmega165 ATmega165P ATmega169 ATmega169P ATmega169PA ATmega325 ATmega325P ATmega329 ATmega329P ATmega645 ATmega649 ATmega649P 1716@item @code{STK600-RC100M-11} @tab @code{STK600-TQFP100} @tab ATmega640 ATmega1280 ATmega2560 1717@item @code{} @tab @code{STK600-ATMEGA2560} @tab ATmega2560 1718@item @code{STK600-RC100M-18} @tab @code{STK600-TQFP100} @tab ATmega3250 ATmega3250P ATmega3290 ATmega3290P ATmega6450 ATmega6490 1719@item @code{STK600-RC032U-20} @tab @code{STK600-TQFP32} @tab AT90USB82 AT90USB162 ATmega8U2 ATmega16U2 ATmega32U2 1720@item @code{STK600-RC044U-25} @tab @code{STK600-TQFP44} @tab ATmega16U4 ATmega32U4 1721@item @code{STK600-RC064U-17} @tab @code{STK600-TQFP64} @tab ATmega32U6 AT90USB646 AT90USB1286 AT90USB647 AT90USB1287 1722@item @code{STK600-RCPWM-22} @tab @code{STK600-TQFP32} @tab ATmega32C1 ATmega64C1 ATmega16M1 ATmega32M1 ATmega64M1 1723@item @code{STK600-RCPWM-19} @tab @code{STK600-SOIC} @tab AT90PWM2 AT90PWM3 AT90PWM2B AT90PWM3B AT90PWM216 AT90PWM316 1724@item @code{STK600-RCPWM-26} @tab @code{STK600-SOIC} @tab AT90PWM81 1725@item @code{STK600-RC044M-24} @tab @code{STK600-TSSOP44} @tab ATmega16HVB ATmega32HVB 1726@item @code{} @tab @code{STK600-HVE2} @tab ATmega64HVE 1727@item @code{} @tab @code{STK600-ATMEGA128RFA1} @tab ATmega128RFA1 1728@item @code{STK600-RC100X-13} @tab @code{STK600-TQFP100} @tab ATxmega64A1 ATxmega128A1 ATxmega128A1_revD ATxmega128A1U 1729@item @code{} @tab @code{STK600-ATXMEGA1281A1} @tab ATxmega128A1 1730@item @code{} @tab @code{QT600-ATXMEGA128A1-QT16} @tab ATxmega128A1 1731@item @code{STK600-RC064X-14} @tab @code{STK600-TQFP64} @tab ATxmega64A3 ATxmega128A3 ATxmega256A3 ATxmega64D3 ATxmega128D3 ATxmega192D3 ATxmega256D3 1732@item @code{STK600-RC064X-14} @tab @code{STK600-MLF64} @tab ATxmega256A3B 1733@item @code{STK600-RC044X-15} @tab @code{STK600-TQFP44} @tab ATxmega32A4 ATxmega16A4 ATxmega16D4 ATxmega32D4 1734@item @code{} @tab @code{STK600-ATXMEGAT0} @tab ATxmega32T0 1735@item @code{} @tab @code{STK600-uC3-144} @tab AT32UC3A0512 AT32UC3A0256 AT32UC3A0128 1736@item @code{STK600-RCUC3A144-33} @tab @code{STK600-TQFP144} @tab AT32UC3A0512 AT32UC3A0256 AT32UC3A0128 1737@item @code{STK600-RCuC3A100-28} @tab @code{STK600-TQFP100} @tab AT32UC3A1512 AT32UC3A1256 AT32UC3A1128 1738@item @code{STK600-RCuC3B0-21} @tab @code{STK600-TQFP64-2} @tab AT32UC3B0256 AT32UC3B0512RevC AT32UC3B0512 AT32UC3B0128 AT32UC3B064 AT32UC3D1128 1739@item @code{STK600-RCuC3B48-27} @tab @code{STK600-TQFP48} @tab AT32UC3B1256 AT32UC3B164 1740@item @code{STK600-RCUC3A144-32} @tab @code{STK600-TQFP144} @tab AT32UC3A3512 AT32UC3A3256 AT32UC3A3128 AT32UC3A364 AT32UC3A3256S AT32UC3A3128S AT32UC3A364S 1741@item @code{STK600-RCUC3C0-36} @tab @code{STK600-TQFP144} @tab AT32UC3C0512 AT32UC3C0256 AT32UC3C0128 AT32UC3C064 1742@item @code{STK600-RCUC3C1-38} @tab @code{STK600-TQFP100} @tab AT32UC3C1512 AT32UC3C1256 AT32UC3C1128 AT32UC3C164 1743@item @code{STK600-RCUC3C2-40} @tab @code{STK600-TQFP64-2} @tab AT32UC3C2512 AT32UC3C2256 AT32UC3C2128 AT32UC3C264 1744@item @code{STK600-RCUC3C0-37} @tab @code{STK600-TQFP144} @tab AT32UC3C0512 AT32UC3C0256 AT32UC3C0128 AT32UC3C064 1745@item @code{STK600-RCUC3C1-39} @tab @code{STK600-TQFP100} @tab AT32UC3C1512 AT32UC3C1256 AT32UC3C1128 AT32UC3C164 1746@item @code{STK600-RCUC3C2-41} @tab @code{STK600-TQFP64-2} @tab AT32UC3C2512 AT32UC3C2256 AT32UC3C2128 AT32UC3C264 1747@item @code{STK600-RCUC3L0-34} @tab @code{STK600-TQFP48} @tab AT32UC3L064 AT32UC3L032 AT32UC3L016 1748@item @code{} @tab @code{QT600-AT32UC3L-QM64} @tab AT32UC3L064 1749@end multitable 1750 1751Ensure the correct socket and routing card are mounted @emph{before} 1752powering on the STK600. While the STK600 firmware ensures the socket 1753and routing card mounted match each other (using a table stored 1754internally in nonvolatile memory), it cannot handle the case where a 1755wrong routing card is used, e. g. the routing card 1756@code{STK600-RC040M-5} (which is meant for 40-pin DIP AVRs that have 1757an ADC, with the power supply pins in the center of the package) was 1758used but an ATmega8515 inserted (which uses the ``industry standard'' 1759pinout with Vcc and GND at opposite corners). 1760 1761Note that for devices that use the routing card @code{STK600-RC008T-2}, 1762in order to use ISP mode, the jumper for @code{AREF0} must be removed 1763as it would otherwise block one of the ISP signals. High-voltage 1764serial programming can be used even with that jumper installed. 1765 1766The ISP system of the STK600 contains a detection against shortcuts 1767and other wiring errors. AVRDUDE initiates a connection check before 1768trying to enter ISP programming mode, and display the result if the 1769target is not found ready to be ISP programmed. 1770 1771High-voltage programming requires the target voltage to be set to at 1772least 4.5 V in order to work. This can be done using 1773@emph{Terminal Mode}, see @ref{Terminal Mode Operation}. 1774 1775@c 1776@c Node 1777@c 1778@node Atmel DFU bootloader using FLIP version 1, , Atmel STK600, Programmer Specific Information 1779@section Atmel DFU bootloader using FLIP version 1 1780 1781Bootloaders using the FLIP protocol version 1 experience some very 1782specific behaviour. 1783 1784These bootloaders have no option to access memory areas other than 1785Flash and EEPROM. 1786 1787When the bootloader is started, it enters a @emph{security mode} where 1788the only acceptable access is to query the device configuration 1789parameters (which are used for the signature on AVR devices). The 1790only way to leave this mode is a @emph{chip erase}. As a chip erase 1791is normally implied by the @option{-U} option when reprogramming the 1792flash, this peculiarity might not be very obvious immediately. 1793 1794Sometimes, a bootloader with security mode already disabled seems to 1795no longer respond with sensible configuration data, but only 0xFF for 1796all queries. As these queries are used to obtain the equivalent of a 1797signature, AVRDUDE can only continue in that situation by forcing the 1798signature check to be overridden with the @option{-F} option. 1799 1800A @emph{chip erase} might leave the EEPROM unerased, at least on some 1801versions of the bootloader. 1802 1803@c 1804@c Node 1805@c 1806@node Platform Dependent Information, Troubleshooting, Programmer Specific Information, Top 1807@appendix Platform Dependent Information 1808 1809@menu 1810* Unix:: 1811* Windows:: 1812@end menu 1813 1814@c 1815@c Node 1816@c 1817@node Unix, Windows, Platform Dependent Information, Platform Dependent Information 1818@section Unix 1819 1820@menu 1821* Unix Installation:: 1822* Unix Configuration Files:: 1823* Unix Port Names:: 1824* Unix Documentation:: 1825@end menu 1826 1827@c 1828@c Node 1829@c 1830@node Unix Installation, Unix Configuration Files, Unix, Unix 1831@subsection Unix Installation 1832 1833@noindent 1834To build and install from the source tarball on Unix like systems: 1835 1836@example 1837$ gunzip -c avrdude-@value{VERSION}.tar.gz | tar xf - 1838$ cd avrdude-@value{VERSION} 1839$ ./configure 1840$ make 1841$ su root -c 'make install' 1842@end example 1843 1844The default location of the install is into @code{/usr/local} so you 1845will need to be sure that @code{/usr/local/bin} is in your @code{PATH} 1846environment variable. 1847 1848If you do not have root access to your system, you can do the 1849following instead: 1850 1851@example 1852$ gunzip -c avrdude-@value{VERSION}.tar.gz | tar xf - 1853$ cd avrdude-@value{VERSION} 1854$ ./configure --prefix=$HOME/local 1855$ make 1856$ make install 1857@end example 1858 1859@menu 1860* FreeBSD Installation:: 1861* Linux Installation:: 1862@end menu 1863 1864@c 1865@c Node 1866@c 1867@node FreeBSD Installation, Linux Installation, Unix Installation, Unix Installation 1868@subsubsection FreeBSD Installation 1869 1870@noindent 1871AVRDUDE is installed via the FreeBSD Ports Tree as follows: 1872 1873@example 1874% su - root 1875# cd /usr/ports/devel/avrdude 1876# make install 1877@end example 1878 1879If you wish to install from a pre-built package instead of the source, 1880you can use the following instead: 1881 1882@example 1883% su - root 1884# pkg_add -r avrdude 1885@end example 1886 1887Of course, you must be connected to the Internet for these methods to 1888work, since that is where the source as well as the pre-built package is 1889obtained. 1890 1891@c 1892@c Node 1893@c 1894@node Linux Installation, , FreeBSD Installation, Unix Installation 1895@subsubsection Linux Installation 1896 1897@noindent 1898On rpm based Linux systems (such as RedHat, SUSE, Mandrake, etc.), you 1899can build and install the rpm binaries directly from the tarball: 1900 1901@example 1902$ su - root 1903# rpmbuild -tb avrdude-@value{VERSION}.tar.gz 1904# rpm -Uvh /usr/src/redhat/RPMS/i386/avrdude-@value{VERSION}-1.i386.rpm 1905@end example 1906 1907Note that the path to the resulting rpm package, differs from system 1908to system. The above example is specific to RedHat. 1909 1910@c 1911@c Node 1912@c 1913@node Unix Configuration Files, Unix Port Names, Unix Installation, Unix 1914@subsection Unix Configuration Files 1915 1916@noindent 1917When AVRDUDE is build using the default @option{--prefix} configure 1918option, the default configuration file for a Unix system is located at 1919@code{/usr/local/etc/avrdude.conf}. This can be overridden by using the 1920@option{-C} command line option. Additionally, the user's home directory 1921is searched for a file named @code{.avrduderc}, and if found, is used to 1922augment the system default configuration file. 1923 1924@menu 1925* FreeBSD Configuration Files:: 1926* Linux Configuration Files:: 1927@end menu 1928 1929@c 1930@c Node 1931@c 1932@node FreeBSD Configuration Files, Linux Configuration Files, Unix Configuration Files, Unix Configuration Files 1933@subsubsection FreeBSD Configuration Files 1934 1935@noindent 1936When AVRDUDE is installed using the FreeBSD ports system, the system 1937configuration file is always @code{/usr/local/etc/avrdude.conf}. 1938 1939@c 1940@c Node 1941@c 1942@node Linux Configuration Files, , FreeBSD Configuration Files, Unix Configuration Files 1943@subsubsection Linux Configuration Files 1944 1945@noindent 1946When AVRDUDE is installed using from an rpm package, the system 1947configuration file will be always be @code{/etc/avrdude.conf}. 1948 1949@c 1950@c Node 1951@c 1952@node Unix Port Names, Unix Documentation, Unix Configuration Files, Unix 1953@subsection Unix Port Names 1954 1955@noindent 1956The parallel and serial port device file names are system specific. 1957The following table lists the default names for a given system. 1958 1959@multitable @columnfractions .30 .30 .30 1960@item @strong{System} 1961 @tab @strong{Default Parallel Port} 1962 @tab @strong{Default Serial Port} 1963@item FreeBSD 1964 @tab @code{/dev/ppi0} 1965 @tab @code{/dev/cuad0} 1966@item Linux 1967 @tab @code{/dev/parport0} 1968 @tab @code{/dev/ttyS0} 1969@item Solaris 1970 @tab @code{/dev/printers/0} 1971 @tab @code{/dev/term/a} 1972@end multitable 1973 1974On FreeBSD systems, AVRDUDE uses the ppi(4) interface for 1975accessing the parallel port and the sio(4) driver for serial port 1976access. 1977 1978On Linux systems, AVRDUDE uses the ppdev interface for 1979accessing the parallel port and the tty driver for serial port 1980access. 1981 1982On Solaris systems, AVRDUDE uses the ecpp(7D) driver for 1983accessing the parallel port and the asy(7D) driver for serial port 1984access. 1985 1986@c 1987@c Node 1988@c 1989@node Unix Documentation, , Unix Port Names, Unix 1990@subsection Unix Documentation 1991 1992@noindent 1993AVRDUDE installs a manual page as well as info, HTML and PDF 1994documentation. The manual page is installed in 1995@code{/usr/local/man/man1} area, while the HTML and PDF documentation 1996is installed in @code{/usr/local/share/doc/avrdude} directory. The 1997info manual is installed in @code{/usr/local/info/avrdude.info}. 1998 1999Note that these locations can be altered by various configure options 2000such as @option{--prefix}. 2001 2002@c 2003@c Node 2004@c 2005@node Windows, , Unix, Platform Dependent Information 2006@section Windows 2007 2008@menu 2009* Windows Installation:: 2010* Windows Configuration Files:: 2011* Windows Port Names:: 2012* Using the parallel port:: 2013* Documentation:: 2014* Credits.:: 2015@end menu 2016 2017@c 2018@c Node 2019@c 2020@node Windows Installation, Windows Configuration Files, Windows, Windows 2021@subsection Installation 2022 2023@noindent 2024A Windows executable of avrdude is included in WinAVR which can be found at 2025@url{http://sourceforge.net/projects/winavr}. WinAVR is a suite of executable, 2026open source software development tools for the AVR for the Windows platform. 2027 2028There are two options to build avrdude from source under Windows. 2029The first one is to use Cygwin (@url{http://www.cygwin.com/}). 2030 2031To build and install from the source tarball for Windows (using Cygwin): 2032 2033@example 2034$ set PREFIX=<your install directory path> 2035$ export PREFIX 2036$ gunzip -c avrdude-@value{VERSION}.tar.gz | tar xf - 2037$ cd avrdude-@value{VERSION} 2038$ ./configure LDFLAGS="-static" --prefix=$PREFIX --datadir=$PREFIX 2039--sysconfdir=$PREFIX/bin --enable-versioned-doc=no 2040$ make 2041$ make install 2042@end example 2043 2044Note that recent versions of Cygwin (starting with 1.7) removed the 2045MinGW support from the compiler that is needed in order to build a 2046native Win32 API binary that does not require to install the Cygwin 2047library @code{cygwin1.dll} at run-time. Either try using an older 2048compiler version that still supports MinGW builds, or use MinGW 2049(@url{http://www.mingw.org/}) directly. 2050 2051@c 2052@c XXX Please add more detailed instructions here. 2053@c 2054 2055 2056@c 2057@c Node 2058@c 2059@node Windows Configuration Files, Windows Port Names, Windows Installation, Windows 2060@subsection Configuration Files 2061 2062@menu 2063* Configuration file names:: 2064* How AVRDUDE finds the configuration files.:: 2065@end menu 2066 2067@c 2068@c Node 2069@c 2070@node Configuration file names, How AVRDUDE finds the configuration files., Windows Configuration Files, Windows Configuration Files 2071@subsubsection Configuration file names 2072 2073@noindent 2074AVRDUDE on Windows looks for a system configuration file name of 2075@code{avrdude.conf} and looks for a user override configuration file of 2076@code{avrdude.rc}. 2077 2078@c 2079@c Node 2080@c 2081@node How AVRDUDE finds the configuration files., , Configuration file names, Windows Configuration Files 2082@subsubsection How AVRDUDE finds the configuration files. 2083 2084@noindent 2085AVRDUDE on Windows has a different way of searching for the system and 2086user configuration files. Below is the search method for locating the 2087configuration files: 2088 2089@enumerate 2090 2091@item 2092The directory from which the application loaded. 2093 2094@item 2095The current directory. 2096 2097@item 2098The Windows system directory. On Windows NT, the name of this directory 2099is @code{SYSTEM32}. 2100 2101@item 2102Windows NT: The 16-bit Windows system directory. The name of this 2103directory is @code{SYSTEM}. 2104 2105@item 2106The Windows directory. 2107 2108@item 2109The directories that are listed in the PATH environment variable. 2110 2111@end enumerate 2112 2113 2114@c 2115@c Node 2116@c 2117@node Windows Port Names, Using the parallel port, Windows Configuration Files, Windows 2118@subsection Port Names 2119 2120@menu 2121* Serial Ports:: 2122* Parallel Ports:: 2123@end menu 2124 2125@c 2126@c Node 2127@c 2128@node Serial Ports, Parallel Ports, Windows Port Names, Windows Port Names 2129@subsubsection Serial Ports 2130 2131@noindent 2132When you select a serial port (i.e. when using an STK500) use the 2133Windows serial port device names such as: com1, com2, etc. 2134 2135@c 2136@c Node 2137@c 2138@node Parallel Ports, , Serial Ports, Windows Port Names 2139@subsubsection Parallel Ports 2140 2141@noindent 2142AVRDUDE will accept 3 Windows parallel port names: lpt1, lpt2, or 2143lpt3. Each of these names corresponds to a fixed parallel port base 2144address: 2145 2146@table @code 2147@item lpt1 21480x378 2149 2150@item lpt2 21510x278 2152 2153@item lpt3 21540x3BC 2155 2156@end table 2157 2158On your desktop PC, lpt1 will be the most common choice. If you are 2159using a laptop, you might have to use lpt3 instead of lpt1. Select the 2160name of the port the corresponds to the base address of the parallel 2161port that you want. 2162 2163If the parallel port can be accessed through a different 2164address, this address can be specified directly, using the common C 2165language notation (i. e., hexadecimal values are prefixed by @code{0x}). 2166 2167@c 2168@c Node 2169@c 2170@node Using the parallel port, Documentation, Windows Port Names, Windows 2171@subsection Using the parallel port 2172 2173@menu 2174* Windows NT/2K/XP:: 2175* Windows 95/98:: 2176@end menu 2177 2178@c 2179@c Node 2180@c 2181@node Windows NT/2K/XP, Windows 95/98, Using the parallel port, Using the parallel port 2182@subsubsection Windows NT/2K/XP 2183 2184@noindent 2185On Windows NT, 2000, and XP user applications cannot directly access the 2186parallel port. However, kernel mode drivers can access the parallel port. 2187giveio.sys is a driver that can allow user applications to set the state 2188of the parallel port pins. 2189 2190Before using AVRDUDE, the giveio.sys driver must be loaded. The 2191accompanying command-line program, loaddrv.exe, can do just that. 2192 2193To make things even easier there are 3 batch files that are also 2194included: 2195 2196@enumerate 2197@item install_giveio.bat 2198Install and start the giveio driver. 2199 2200@item status_giveio.bat 2201Check on the status of the giveio driver. 2202 2203@item remove_giveio.bat 2204Stop and remove the giveio driver from memory. 2205@end enumerate 2206 2207These 3 batch files calls the loaddrv program with various options to 2208install, start, stop, and remove the driver. 2209 2210When you first execute install_giveio.bat, loaddrv.exe and giveio.sys 2211must be in the current directory. When install_giveio.bat is executed it 2212will copy giveio.sys from your current directory to your Windows 2213directory. It will then load the driver from the Windows directory. This 2214means that after the first time install_giveio is executed, you should 2215be able to subsequently execute the batch file from any directory and have 2216it successfully start the driver. 2217 2218Note that you must have administrator privilege to load the giveio driver. 2219 2220@c 2221@c Node 2222@c 2223@node Windows 95/98, , Windows NT/2K/XP, Using the parallel port 2224@subsubsection Windows 95/98 2225 2226@noindent 2227On Windows 95 and 98 the giveio.sys driver is not needed. 2228 2229 2230@c 2231@c Node 2232@c 2233@node Documentation, Credits., Using the parallel port, Windows 2234@subsection Documentation 2235 2236@noindent 2237AVRDUDE installs a manual page as well as info, HTML and PDF 2238documentation. The manual page is installed in 2239@code{/usr/local/man/man1} area, while the HTML and PDF documentation 2240is installed in @code{/usr/local/share/doc/avrdude} directory. The 2241info manual is installed in @code{/usr/local/info/avrdude.info}. 2242 2243Note that these locations can be altered by various configure options 2244such as @option{--prefix} and @option{--datadir}. 2245 2246 2247@c 2248@c Node 2249@c 2250@node Credits., , Documentation, Windows 2251@subsection Credits. 2252 2253@noindent 2254Thanks to: 2255 2256@itemize @bullet 2257@item 2258Dale Roberts for the giveio driver. 2259 2260@item 2261Paula Tomlinson for the loaddrv sources. 2262 2263@item 2264Chris Liechti <cliechti@@gmx.net> for modifying loaddrv to be command 2265line driven and for writing the batch files. 2266 2267@end itemize 2268 2269@c 2270@c Node 2271@c 2272@node Troubleshooting, ,Platform Dependent Information ,Top 2273@appendix Troubleshooting 2274 2275@noindent 2276In general, please report any bugs encountered via 2277@* 2278@url{http://savannah.nongnu.org/bugs/?group=avrdude}. 2279 2280 2281@itemize @bullet 2282 2283@item 2284Problem: I'm using a serial programmer under Windows and get the following 2285error: 2286 2287@code{avrdude: serial_open(): can't set attributes for device "com1"}, 2288 2289Solution: This problem seems to appear with certain versions of Cygwin. Specifying 2290@code{"/dev/com1"} instead of @code{"com1"} should help. 2291 2292 2293@item 2294Problem: I'm using Linux and my AVR910 programmer is really slow. 2295 2296Solution (short): @code{setserial @var{port} low_latency} 2297 2298Solution (long): 2299There are two problems here. First, the system may wait some time before it 2300passes data from the serial port to the program. Under Linux the following 2301command works around this (you may need root privileges for this). 2302 2303@code{setserial @var{port} low_latency} 2304 2305Secondly, the serial interface chip may delay the interrupt for some time. 2306This behaviour can be changed by setting the FIFO-threshold to one. Under Linux this 2307can only be done by changing the kernel source in @code{drivers/char/serial.c}. 2308Search the file for @code{UART_FCR_TRIGGER_8} and replace it with @code{UART_FCR_TRIGGER_1}. Note that overall performance might suffer if there 2309is high throughput on serial lines. Also note that you are modifying the kernel at 2310your own risk. 2311 2312 2313@item 2314Problem: I'm not using Linux and my AVR910 programmer is really slow. 2315 2316Solutions: The reasons for this are the same as above. 2317If you know how to work around this on your OS, please let us know. 2318 2319@item 2320Problem: Updating the flash ROM from terminal mode does not work with the 2321JTAG ICEs. 2322 2323Solution: None at this time. Currently, the JTAG ICE code cannot 2324write to the flash ROM one byte at a time. 2325 2326@item 2327Problem: Page-mode programming the EEPROM (using the -U option) does 2328not erase EEPROM cells before writing, and thus cannot overwrite any 2329previous value != 0xff. 2330 2331Solution: None. This is an inherent feature of the way JTAG EEPROM 2332programming works, and is documented that way in the Atmel AVR 2333datasheets. 2334In order to successfully program the EEPROM that way, a prior chip 2335erase (with the EESAVE fuse unprogrammed) is required. 2336This also applies to the STK500 and STK600 in high-voltage programming mode. 2337 2338@item 2339Problem: How do I turn off the @var{DWEN} fuse? 2340 2341Solution: If the @var{DWEN} (debugWire enable) fuse is activated, 2342the @var{/RESET} pin is not functional anymore, so normal ISP 2343communication cannot be established. 2344There are two options to deactivate that fuse again: high-voltage 2345programming, or getting the JTAG ICE mkII talk debugWire, and 2346prepare the target AVR to accept normal ISP communication again. 2347 2348The first option requires a programmer that is capable of high-voltage 2349programming (either serial or parallel, depending on the AVR device), 2350for example the STK500. In high-voltage programming mode, the 2351@var{/RESET} pin is activated initially using a 12 V pulse (thus the 2352name @emph{high voltage}), so the target AVR can subsequently be 2353reprogrammed, and the @var{DWEN} fuse can be cleared. Typically, this 2354operation cannot be performed while the AVR is located in the target 2355circuit though. 2356 2357The second option requires a JTAG ICE mkII that can talk the debugWire 2358protocol. The ICE needs to be connected to the target using the 2359JTAG-to-ISP adapter, so the JTAG ICE mkII can be used as a debugWire 2360initiator as well as an ISP programmer. AVRDUDE will then be activated 2361using the @var{jtag2isp} programmer type. The initial ISP 2362communication attempt will fail, but AVRDUDE then tries to initiate a 2363debugWire reset. When successful, this will leave the target AVR in a 2364state where it can accept standard ISP communication. The ICE is then 2365signed off (which will make it signing off from the USB as well), so 2366AVRDUDE has to be called again afterwards. This time, standard ISP 2367communication can work, so the @var{DWEN} fuse can be cleared. 2368 2369The pin mapping for the JTAG-to-ISP adapter is: 2370 2371@multitable @columnfractions .2 .2 2372@item @strong{JTAG pin} @tab @strong{ISP pin} 2373@item 1 @tab 3 2374@item 2 @tab 6 2375@item 3 @tab 1 2376@item 4 @tab 2 2377@item 6 @tab 5 2378@item 9 @tab 4 2379@end multitable 2380 2381@item 2382Problem: Multiple USBasp or USBtinyISP programmers connected simultaneously are not 2383found. 2384 2385Solution: The USBtinyISP code supports distinguishing multiple 2386programmers based on their bus:device connection tuple that describes 2387their place in the USB hierarchy on a specific host. This tuple can 2388be added to the @var{-P usb} option, similar to adding a serial number 2389on other USB-based programmers. 2390 2391The actual naming convention for the bus and device names is 2392operating-system dependent; AVRDUDE will print out what it found 2393on the bus when running it with (at least) one @var{-v} option. 2394By specifying a string that cannot match any existing device 2395(for example, @var{-P usb:xxx}), the scan will list all possible 2396candidate devices found on the bus. 2397 2398Examples: 2399@example 2400avrdude -c usbtiny -p atmega8 -P usb:003:025 (Linux) 2401avrdude -c usbtiny -p atmega8 -P usb:/dev/usb:/dev/ugen1.3 (FreeBSD 8+) 2402avrdude -c usbtiny -p atmega8 \ 2403 -P usb:bus-0:\\.\libusb0-0001--0x1781-0x0c9f (Windows) 2404@end example 2405 2406@item 2407Problem: I cannot do @dots{} when the target is in debugWire mode. 2408 2409Solution: debugWire mode imposes several limitations. 2410 2411The debugWire protocol is Atmel's proprietary one-wire (plus ground) 2412protocol to allow an in-circuit emulation of the smaller AVR devices, 2413using the @var{/RESET} line. 2414DebugWire mode is initiated by activating the @var{DWEN} 2415fuse, and then power-cycling the target. 2416While this mode is mainly intended for debugging/emulation, it 2417also offers limited programming capabilities. 2418Effectively, the only memory areas that can be read or programmed 2419in this mode are flash ROM and EEPROM. 2420It is also possible to read out the signature. 2421All other memory areas cannot be accessed. 2422There is no 2423@emph{chip erase} 2424functionality in debugWire mode; instead, while reprogramming the 2425flash ROM, each flash ROM page is erased right before updating it. 2426This is done transparently by the JTAG ICE mkII (or AVR Dragon). 2427The only way back from debugWire mode is to initiate a special 2428sequence of commands to the JTAG ICE mkII (or AVR Dragon), so the 2429debugWire mode will be temporarily disabled, and the target can 2430be accessed using normal ISP programming. 2431This sequence is automatically initiated by using the JTAG ICE mkII 2432or AVR Dragon in ISP mode, when they detect that ISP mode cannot be 2433entered. 2434 2435@item 2436Problem: I want to use my JTAG ICE mkII to program an 2437Xmega device through PDI. The documentation tells me to use the 2438@emph{XMEGA PDI adapter for JTAGICE mkII} that is supposed to ship 2439with the kit, yet I don't have it. 2440 2441Solution: Use the following pin mapping: 2442 2443@multitable @columnfractions .2 .2 .2 .2 2444@item @strong{JTAGICE} @tab @strong{Target} @tab @strong{Squid cab-} @tab @strong{PDI} 2445@item @strong{mkII probe} @tab @strong{pins} @tab @strong{le colors} @tab @strong{header} 2446@item 1 (TCK) @tab @tab Black @tab 2447@item 2 (GND) @tab GND @tab White @tab 6 2448@item 3 (TDO) @tab @tab Grey @tab 2449@item 4 (VTref) @tab VTref @tab Purple @tab 2 2450@item 5 (TMS) @tab @tab Blue @tab 2451@item 6 (nSRST) @tab PDI_CLK @tab Green @tab 5 2452@item 7 (N.C.) @tab @tab Yellow @tab 2453@item 8 (nTRST) @tab @tab Orange @tab 2454@item 9 (TDI) @tab PDI_DATA @tab Red @tab 1 2455@item 10 (GND) @tab @tab Brown @tab 2456@end multitable 2457 2458@item 2459Problem: I want to use my AVR Dragon to program an 2460Xmega device through PDI. 2461 2462Solution: Use the 6 pin ISP header on the Dragon and the following pin mapping: 2463 2464@multitable @columnfractions .2 .2 2465@item @strong{Dragon} @tab @strong{Target} 2466@item @strong{ISP Header} @tab @strong{pins} 2467@item 1 (MISO) @tab PDI_DATA 2468@item 2 (VCC) @tab VCC 2469@item 3 (SCK) @tab 2470@item 4 (MOSI) @tab 2471@item 5 (RESET) @tab PDI_CLK / RST 2472@item 6 (GND) @tab GND 2473@end multitable 2474 2475@item 2476Problem: I want to use my AVRISP mkII to program an 2477ATtiny4/5/9/10 device through TPI. How to connect the pins? 2478 2479Solution: Use the following pin mapping: 2480 2481@multitable @columnfractions .2 .2 .2 2482@item @strong{AVRISP} @tab @strong{Target} @tab @strong{ATtiny} 2483@item @strong{connector} @tab @strong{pins} @tab @strong{pin #} 2484@item 1 (MISO) @tab TPIDATA @tab 1 2485@item 2 (VTref) @tab Vcc @tab 5 2486@item 3 (SCK) @tab TPICLK @tab 3 2487@item 4 (MOSI) @tab @tab 2488@item 5 (RESET) @tab /RESET @tab 6 2489@item 6 (GND) @tab GND @tab 2 2490@end multitable 2491 2492@item 2493Problem: I want to program an ATtiny4/5/9/10 device using a serial/parallel 2494bitbang programmer. How to connect the pins? 2495 2496Solution: Since TPI has only 1 pin for bi-directional data transfer, both 2497@var{MISO} and @var{MOSI} pins should be connected to the @var{TPIDATA} pin 2498on the ATtiny device. 2499However, a 1K resistor should be placed between the @var{MOSI} and @var{TPIDATA}. 2500The @var{MISO} pin connects to @var{TPIDATA} directly. 2501The @var{SCK} pin is connected to @var{TPICLK}. 2502 2503In addition, the @var{Vcc}, @var{/RESET} and @var{GND} pins should 2504be connected to their respective ports on the ATtiny device. 2505 2506@item 2507Problem: How can I use a FTDI FT232R USB-to-Serial device for bitbang programming? 2508 2509Solution: When connecting the FT232 directly to the pins of the target Atmel device, 2510the polarity of the pins defined in the @code{programmer} definition should be 2511inverted by prefixing a tilde. For example, the @var{dasa} programmer would 2512look like this when connected via a FT232R device (notice the tildes in 2513front of pins 7, 4, 3 and 8): 2514 2515@example 2516programmer 2517 id = "dasa_ftdi"; 2518 desc = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts"; 2519 type = serbb; 2520 reset = ~7; 2521 sck = ~4; 2522 mosi = ~3; 2523 miso = ~8; 2524; 2525@end example 2526 2527Note that this uses the FT232 device as a normal serial port, not using the 2528FTDI drivers in the special bitbang mode. 2529 2530@item 2531Problem: My ATtiny4/5/9/10 reads out fine, but any attempt to program 2532it (through TPI) fails. Instead, the memory retains the old contents. 2533 2534Solution: Mind the limited programming supply voltage range of these 2535devices. 2536 2537In-circuit programming through TPI is only guaranteed by the datasheet 2538at Vcc = 5 V. 2539 2540@item 2541Problem: My ATxmega@dots{}A1/A2/A3 cannot be programmed through PDI with 2542my AVR Dragon. Programming through a JTAG ICE mkII works though, as does 2543programming through JTAG. 2544 2545Solution: None by this time (2010 Q1). 2546 2547It is said that the AVR Dragon can only program devices from the A4 2548Xmega sub-family. 2549 2550@item 2551Problem: when programming with an AVRISPmkII or STK600, AVRDUDE hangs 2552when programming files of a certain size (e.g. 246 bytes). Other 2553(larger or smaller) sizes work though. 2554 2555Solution: This is a bug caused by an incorrect handling of zero-length 2556packets (ZLPs) in some versions of the libusb 0.1 API wrapper that ships 2557with libusb 1.x in certain Linux distributions. All Linux systems with 2558kernel versions < 2.6.31 and libusb >= 1.0.0 < 1.0.3 are reported to be 2559affected by this. 2560 2561See also: @url{http://www.libusb.org/ticket/6} 2562 2563@item 2564Problem: after flashing a firmware that reduces the target's clock 2565speed (e.g. through the @code{CLKPR} register), further ISP connection 2566attempts fail. 2567 2568Solution: Even though ISP starts with pulling @var{/RESET} low, the 2569target continues to run at the internal clock speed as defined by the 2570firmware running before. Therefore, the ISP clock speed must be 2571reduced appropriately (to less than 1/4 of the internal clock speed) 2572using the -B option before the ISP initialization sequence will 2573succeed. 2574 2575As that slows down the entire subsequent ISP session, it might make 2576sense to just issue a @emph{chip erase} using the slow ISP clock 2577(option @code{-e}), and then start a new session at higher speed. 2578Option @code{-D} might be used there, to prevent another unneeded 2579erase cycle. 2580 2581@end itemize 2582 2583 2584 2585@bye 2586 2587