📄 avrdude.texi
字号:
@itemx stk500v2Atmel STK500, running a verrsion 2.x firmware@end table@item -C @var{config-file}Use the specified config file for configuration data. This filecontains all programmer and part definitions that AVRDUDE knows about.If you have a programmer or part that AVRDUDE does not know about, youcan add it to the config file (be sure and submit a patch back to theauthor so that it can be incorporated for the next version). If notspecified, AVRDUDE reads the configuration file from/usr/local/etc/avrdude.conf (FreeBSD and Linux). See Appendix A forthe method of searching for the configuration file for Windows.@item -DDisable auto erase for flash. When the -U option with flash memory is specified, avrdude will perform a chip erase before starting any of the programming operations, since it generally is a mistake to program the flashwithout performing an erase first. This option disables that. However, to remain backward compatible, the -i, and -m options automatically disable the auto erase feature.@item -eCauses a chip erase to be executed. This will reset the contents of theflash ROM and EEPROM to the value `0xff', and is basically aprerequisite command before the flash ROM can be reprogrammed again.The only exception would be if the new contents would exclusively causebits to be programmed from the value `1' to `0'. Note that in orderto reprogram EERPOM cells, no explicit prior chip erase is requiredsince the MCU provides an auto-erase cycle in that case beforeprogramming the cell.@item -E @var{exitspec}[,@dots{}]By default, AVRDUDE leaves the parallel port in the same state at exitas it has been found at startup. This option modifies the state of the`/RESET' and `Vcc' lines the parallel port is left at, according tothe exitspec arguments provided, as follows:@table @code@itemx resetThe `/RESET' signal will be left activated at program exit, that is itwill be held low, in order to keep the MCU in reset state afterwards.Note in particular that the programming algorithm for the AT90S1200device mandates that the `/RESET' signal is active before powering upthe MCU, so in case an external power supply is used for this MCU type,a previous invocation of AVRDUDE with this option specified is one ofthe possible ways to guarantee this condition.@itemx noresetThe `/RESET' line will be deactivated at program exit, thus allowing theMCU target program to run while the programming hardware remainsconnected.@itemx vccThis option will leave those parallel port pins active (i. e. high) thatcan be used to supply `Vcc' power to the MCU.@itemx novccThis option will pull the `Vcc' pins of the parallel port down atprogram exit.@end tableMultiple @var{exitspec} arguments can be separated with commas.@item -FNormally, AVRDUDE tries to verify that the device signature read fromthe part is reasonable before continuing. Since it can happen from timeto time that a device has a broken (erased or overwritten) devicesignature but is otherwise operating normally, this options is providedto override the check.@item -nNo-write - disables actually writing data to the MCU (useful fordebugging AVRDUDE).@item -P @var{port}Use port to identify the device to which the programmer is attached.Normally, the default parallel port is used, but if the programmer typenormally connects to the serial port, the default serial port will beused. See Appendix A, Platform Dependent Information, to find out thedefault port names for your platform. If you need to use a differentparallel or serial port, use this option to specify the alternate port name.For the JTAG ICE mkII, if AVRDUDE has been built with libusb support,@var{port} may alternatively be specified as@var{usb}[:@var{serialno}]. In that case, the JTAG ICE mkII will belooked up on USB. If @var{serialno} is also specified, it will bematched against the serial number read from any JTAG ICE mkII found onUSB. The match is done after stripping any existing colons from thegiven serial number, and right-to-left, so only the least significantbytes from the serial number need to be given.@item -qDisable (or quell) output of the progress bar while reading or writingto the device. Specify it a second time for even quieter operation.@item -uDisables the default behaviour of reading out the fuses three times beforeprogramming, then verifying at the end of programming that the fuses have notchanged. If you want to change fuses you will need to specify this option,as avrdude will see the fuses have changed (even though you wanted to) andwill change them back for your "saftey". This option was designed toprevent cases of fuse bits magically changing (usually called @emph{safemode}).@item -tTells AVRDUDE to enter the interactive ``terminal'' mode instead of up-or downloading files. See below for a detailed description of theterminal mode.@item -U @var{memtype}:@var{op}:@var{filename}[:@var{format}]Perform a memory operation, equivalent to specifing the @option{-m},@option{-i} or @option{-o}, and @option{-f} options, except thatmultiple @option{-U} optins can be specified in order to operate onmulitple memories on the same command-line invocation. The@var{memtype} field specifies the memory type to operate on. Usethe @option{-v} option on the command line or the @code{part} command fromterminal mode to display all the memory types supported by a particulardevice.Typically, a device's memory configuration at least containsthe memory types@code{flash}and@code{eeprom}.All memory types currently known are:@table @code@item calibrationOne or more bytes of RC oscillator calibration data.@item eepromThe EEPROM of the device.@item efuseThe extended fuse byte.@item flashThe flash ROM of the device.@item fuseThe fuse byte in devices that have only a single fuse byte.@item hfuseThe high fuse byte.@item lfuseThe low fuse byte.@item lockThe lock byte.@item signatureThe three device signature bytes (device ID).@end tableThe @var{op} field specifies what operation to perform:@table @code@itemx rread the specified device memory and write to the specified file@itemx wread the specified file and write it to the specified device memory@itemx vread the specified device memory and the specified file and perform a verify operation@end tableThe @var{filename} field indicates the name of the file to read orwrite. The @var{format} field is optional and contains the format ofthe file to read or write. Possible values are:@table @code@itemx iIntel Hex@itemx sMotorola S-record@itemx rraw binary; little-endian byte order, in the case of the flash ROM data@itemx mimmediate mode; actual byte values specified on the command line,seperated by commas or spaces in place of the @var{filename} field ofthe @option{-i}, @option{-o}, or @option{-U} options. This is usefulfor programming fuse bytes without having to create a single-byte fileor enter terminal mode. If the number specified begins with @code{0x},it is treated as a hex value. If the number otherwise begins with aleading zero (@code{0}) it is treated as octal. Otherwise, the value istreated as decimal.@itemx aauto detect; valid for input only, and only if the input is not providedat stdin.@end tableThe default is to use auto detection for input files, and raw binaryformat for output files.Note that if @var{filename} contains a colon, the @var{format} field isno longer optional since the filename part following the colon wouldotherwise be misinterpreted as @var{format}.@item -vEnable verbose output.@item -VDisable automatic verify check when uploading data.@item -yTells AVRDUDE to use the last four bytes of the connected parts' EEPROMmemory to track the number of times the device has been erased. Whenthis option is used and the @option{-e} flag is specified to generate achip erase, the previous counter will be saved before the chip erase, itis then incremented, and written back after the erase cycle completes.Presumably, the device would only be erased just before beingprogrammed, and thus, this can be utilized to give an indication of howmany erase-rewrite cycles the part has undergone. Since the FLASHmemory can only endure a finite number of erase-rewrite cycles, one canuse this option to track when a part is nearing the limit. The typicallimit for Atmel AVR FLASH is 1000 cycles. Of course, if theapplication needs the last four bytes of EEPROM memory, this optionshould not be used.@item -Y @var{cycles}Instructs AVRDUDE to initialize the erase-rewrite cycle counter residingat the last four bytes of EEPROM memory to the specified value. If theapplication needs the last four bytes of EEPROM memory, this optionshould not be used.@end table@page@c@c Node@c@node Example Command Line Invocations, , Option Descriptions, Command Line Options@section Example Command Line Invocations@noindentDownload the file @code{diag.hex} to the ATmega128 chip using theSTK500 programmer connected to the default serial port:@example@cartouche% avrdude -p m128 -c stk500 -e -U flash:w:diag.hex avrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.03savrdude: Device signature = 0x1e9702avrdude: erasing chipavrdude: done.avrdude: performing op: 1, flash, 0, diag.hexavrdude: reading input file "diag.hex"avrdude: input file diag.hex auto detected as Intel Hexavrdude: writing flash (19278 bytes):Writing | ################################################## | 100% 7.60savrdude: 19456 bytes of flash writtenavrdude: verifying flash memory against diag.hex:avrdude: load data flash data from input file diag.hex:avrdude: input file diag.hex auto detected as Intel Hexavrdude: input file diag.hex contains 19278 bytesavrdude: reading on-chip flash data:Reading | ################################################## | 100% 6.83savrdude: verifying ...avrdude: 19278 bytes of flash verifiedavrdude: safemode: Fuses OKavrdude done. Thank you.%@end cartouche@end example@page@noindentUpload the flash memory from the ATmega128 connected to the STK500programmer and save it in raw binary format in the file named@code{c:/diag flash.bin}:@example@cartouche% avrdude -p m128 -c stk500 -U flash:r:"c:/diag flash.bin":r avrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.03savrdude: Device signature = 0x1e9702avrdude: reading flash memory:Reading | ################################################## | 100% 46.10savrdude: writing output file "c:/diag flash.bin"avrdude: safemode: Fuses OKavrdude done. Thank you.% @end cartouche@end example@page@noindentUsing the default programmer, download the file @code{diag.hex} toflash, @code{eeprom.hex} to EEPROM, and set the Extended, High, and Lowfuse bytes to 0xff, 0x89, and 0x2e respectively:@example@cartouche% avrdude -p m128 -u -U flash:w:diag.hex \> -U eeprom:w:eeprom.hex \> -U efuse:w:0xff:m \> -U hfuse:w:0x89:m \> -U lfuse:w:0x2e:mavrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.03savrdude: Device signature = 0x1e9702avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option.avrdude: erasing chipavrdude: reading input file "diag.hex"avrdude: input file diag.hex auto detected as Intel Hexavrdude: writing flash (19278 bytes):Writing | ################################################## | 100% 7.60savrdude: 19456 bytes of flash writtenavrdude: verifying flash memory against diag.hex:avrdude: load data flash data from input file diag.hex:avrdude: input file diag.hex auto detected as Intel Hexavrdude: input file diag.hex contains 19278 bytesavrdude: reading on-chip flash data:Reading | ################################################## | 100% 6.84savrdude: verifying ...avrdude: 19278 bytes of flash verified[ ... other memory status output skipped for brevity ... ]avrdude done. Thank you.% @end cartouche@end example@page@noindentConnect to the JTAG ICE mkII which serial number ends up in 1C37 viaUSB, and enter terminal mode:@example@cartouche% avrdude -c jtag2 -p m649 -P usb:1c:37 -tavrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.03savrdude: Device signature = 0x1e9603[ ... terminal mode output skipped for brevity ... ]avrdude done. Thank you.@end cartouche@end example@c@c Node@c@node Terminal Mode Operation, Configuration File, Command Line Options, Top@chapter Terminal Mode OperationAVRDUDE has an interactive mode called @var{terminal mode} that isenabled by the @option{-t} option. This mode allows one to enterinteractive commands to display and modify the various device memories,perform a chip erase, display the device signature bytes and partparameters, and to send raw programming commands. Commands andparameters may be abbreviated to their shortest unambiguous form.Terminal mode also supports a command history so that previously enteredcommands can be recalled and edited.@menu* Terminal Mode Commands:: * Terminal Mode Examples:: @end menu@node Terminal Mode Commands, Terminal Mode Examples, Terminal Mode Operation, Terminal Mode Operation@section Terminal Mode Commands@noindentThe following commands are implemented:@table @code@item dump @var{memtype} @var{addr} @var{nbytes}Read @var{nbytes} from the specified memory area, and display them inthe usual hexadecimal and ASCII form.@item dumpContinue dumping the memory contents for another @var{nbytes} where theprevious dump command left off.@item write @var{memtype} @var{addr} @var{byte1} @dots{} @var{byteN}Manually program the respective memory cells, starting at address addr,using the values @var{byte1} through @var{byteN}. This feature is notimplemented for bank-addressed memories such as the flash memory ofATMega devices.@item erasePerform a chip erase.@item send @var{b1} @var{b2} @var{b3} @var{b4}Send raw instruction codes to the AVR device. If you need access to afeature of an AVR part that is not directly supported by AVRDUDE, thiscommand allows you to use it, even though AVRDUDE does not implement thecommand.@item sigDisplay the device signature bytes.@item partDisplay the current part settings and parameters. Includes chipspecific information including all memory types supported by thedevice, read/write timing, etc.@item ?@itemx helpGive a short on-line summary of the available commands.@item quitLeave terminal mode and thus AVRDUDE.@end table@noindentIn addition, the following commands are supported on the STK500programmer:@table @code
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -