📄 avrdude.texi
字号:
avrdude: erasing chipavrdude: erase-rewrite cycle count is now 52avrdude: done.avrdude: reading input file "m128diag.hex"avrdude: input file m128diag.hex auto detected as Intel Hexavrdude: writing flash (18130 bytes): 18175avrdude: 18176 bytes of flash writtenavrdude: verifying flash memory against m128diag.hex:avrdude: reading on-chip flash data: 18175avrdude: verifying ...avrdude: 18176 bytes of flash verifiedavrdude done. Thank you.% @end cartouche@end example@noindentUpload the flash memory from the ATmega128 connected to the STK500programmer and save it in raw binary format in the file named@code{m128diag.flash}:@example@cartouche% avrdude -p m128 -c stk500 -f r -o m128diag.flash avrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x1e9702avrdude: current erase-rewrite cycle count is 52 (if being tracked)avrdude: reading flash memory:131071avrdude: writing output file "m128diag.flash"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.@item ?@itemx helpGive a short on-line summary of the available commands.@item quitLeave terminal mode and thus AVRDUDE.@end table@c@c Node@c@node Terminal Mode Examples, , Terminal Mode Commands, Terminal Mode Operation@section Terminal Mode Examples@noindentDisplay part parameters, modify eeprom cells, perform a chip erase:@example@cartouche% avrdude -p m128 -c stk500 -tavrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x1e9702avrdude: current erase-rewrite cycle count is 52 (if being tracked)avrdude> part>>> part AVR Part : ATMEGA128Chip Erase delay : 9000 usPAGEL : PD7BS2 : PA0RESET disposition : dedicatedRETRY pulse : SCKserial program mode : yesparallel program mode : yesMemory Detail : Page Polled Memory Type Paged Size Size #Pages MinW MaxW ReadBack ----------- ------ ------ ---- ------ ----- ----- --------- eeprom no 4096 8 0 9000 9000 0xff 0xff flash yes 131072 256 512 4500 9000 0xff 0x00 lfuse no 1 0 0 0 0 0x00 0x00 hfuse no 1 0 0 0 0 0x00 0x00 efuse no 1 0 0 0 0 0x00 0x00 lock no 1 0 0 0 0 0x00 0x00 calibration no 1 0 0 0 0 0x00 0x00 signature no 3 0 0 0 0 0x00 0x00avrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|avrdude> write eeprom 0 1 2 3 4>>> write eeprom 0 1 2 3 4 avrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000 01 02 03 04 ff ff ff ff ff ff ff ff ff ff ff ff |................|avrdude> erase>>> erase avrdude: erasing chipavrdude> dump eeprom 0 16>>> dump eeprom 0 16 0000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|avrdude> @end cartouche@end example@noindentProgram the fuse bits of an ATmega128 (disable M103 compatibility,enable high speed external crystal, enable brown-out detection). Firstdisplay the factory defaults, then reprogram:@example@cartouche% avrdude -p m128 -c stk500 -tavrdude: AVR device initialized and ready to accept instructionsavrdude: Device signature = 0x1e9702avrdude: current erase-rewrite cycle count is 52 (if being tracked)avrdude> d efuse>>> d efuse 0000 fd |. |avrdude> d hfuse>>> d hfuse 0000 99 |. |avrdude> d lfuse>>> d lfuse 0000 e1 |. |avrdude> w efuse 0 0xff>>> w efuse 0 0xff avrdude> w hfuse 0 0x89>>> w hfuse 0 0x89 avrdude> w lfuse 0 0x2e>>> w lfuse 0 0x2e avrdude> @end cartouche@end example@c@c Node@c@node Configuration File, Platform Dependent Information, Terminal Mode Operation, Top@chapter Configuration File@noindentAVRDUDE reads a configuration file upon startup which describes all ofthe parts and programmers that it knows about. The advantage of this isthat if you have a chip that is not currently supported by AVRDUDE, youcan add it to the configuration file without waiting for a new releaseof AVRDUDE. Likewise, if you have a parallel port programmer that isnot supported by AVRDUDE, chances are good that you can copy andexisting programmer definition, and with only a few changes, make yourprogrammer work with AVRDUDE.AVRDUDE first looks for a system wide configuration file in a platformdependent location. On Unix, this is usually@code{/usr/local/etc/avrdude.conf}, while on Windows it is usally in thesame location as the executable file. The name of this file can bechanged using the @option{-C} command line option. After the system wideconfiguration file is parsed, AVRDUDE looks for a per-user configurationfile to augment or override the system wide defaults. On Unix, theper-user file is @code{.avrduderc} within the user's home directory. OnWindows, this file is the @code{avrdude.rc} file located in the samedirectory as the executable.@menu* AVRDUDE Defaults:: * Programmer Definitions:: * Part Definitions:: * Other Notes:: @end menu@c@c Node@c@node AVRDUDE Defaults, Programmer Definitions, Configuration File, Configuration File@section AVRDUDE Defaults@table @code@item default_parallel = "@var{default-parallel-device}";Assign the default parallel port device. Can be overidden using the@option{-P} option.@item default_serial = "@var{default-serial-device}";Assign the default serial port device. Can be overidden using the@option{-P} option.@item default_programmer = "@var{default-programmer-id}";Assign the default programmer id. Can be overidden using the @option{-c}option.@end table@c@c Node@c@node Programmer Definitions, Part Definitions, AVRDUDE Defaults, Configuration File@section Programmer Definitions@noindentThe format of the programmer definition is as follows:@exampleprogrammer id = <id1> [, <id2> [, <id3>] ...] ; # <idN> are quoted strings desc = <description> ; # quoted string type = par | stk500 ; # programmer type vcc = <num1> [, <num2> ... ] ; # pin number(s) reset = <num> ; # pin number sck = <num> ; # pin number mosi = <num> ; # pin number miso = <num> ; # pin number errled = <num> ; # pin number rdyled = <num> ; # pin number pgmled = <num> ; # pin number vfyled = <num> ; # pin number ;@end example@c@c Node@c@node Part Definitions, Other Notes, Programmer Definitions, Configuration File@section Part Definitions@examplepart id = <id> ; # quoted string desc = <description> ; # quoted string devicecode = <num> ; # numeric chip_erase_delay = <num> ; # micro-seconds pagel = <num> ; # pin name in hex, i.e., 0xD7 bs2 = <num> ; # pin name in hex, i.e., 0xA0 reset = dedicated | io; retry_pulse = reset | sck; pgm_enable = <instruction format> ; chip_erase = <instruction format> ; memory <memtype> paged = <yes/no> ; # yes / no size = <num> ; # bytes page_size = <num> ; # bytes num_pages = <num> ; # numeric min_write_delay = <num> ; # micro-seconds max_write_delay = <num> ; # micro-seconds readback_p1 = <num> ; # byte value readback_p2 = <num> ; # byte value pwroff_after_write = <yes/no> ; # yes / no read = <instruction format> ; write = <instruction format> ; read_lo = <instruction format> ; read_hi = <instruction format> ; write_lo = <instruction format> ; write_hi = <instruction format> ; loadpage_lo = <instruction format> ; loadpage_hi = <instruction format> ; writepage = <instruction format> ; ; ;@end example@menu* Instruction Format:: @end menu@c@c Node@c@node Instruction Format, , Part Definitions, Part Definitions@subsection Instruction Format@noindentInstruction formats are specified as a comma seperated list of stringvalues containing information (bit specifiers) about each of the 32 bitsof the instruction. Bit specifiers may be one of the following formats:@table @code@item 1The bit is always set on input as well as output@item 0the bit is always clear on input as well as output@item xthe bit is ignored on input and output@item athe bit is an address bit, the bit-number matches this bit specifier'sposition within the current instruction byte@item a@var{N}the bit is the @var{N}th address bit, bit-number = N, i.e., @code{a12}is address bit 12 on input, @code{a0} is address bit 0.@item ithe bit is an input data bit@item othe bit is an output data bit@end tableEach instruction must be composed of 32 bit specifiers. The instructionspecification closely follows the instruction data provided in Atmel'sdata sheets for their parts. For example, the EEPROM read and writeinstruction for an AT90S2313 AVR part could be encoded as:@exampleread = "1 0 1 0 0 0 0 0 x x x x x x x x", "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o";write = "1 1 0 0 0 0 0 0 x x x x x x x x", "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i";@end example@c@c Node@c@node Other Notes, , Part Definitions, Configuration File@section Other Notes@itemize @bullet@itemThe @code{devicecode} parameter is the device code used by the STK500and are obtained from the software section (@code{avr061.zip} ofAtmel's AVR061 application note available from@url{http://www.atmel.com/atmel/acrobat/doc2525.pdf}.@itemNot all memory types will implement all instructions.@itemAVR Fuse bits and Lock bits are implemented as a type of memory.@itemExample memory types are: @code{flash}, @code{eeprom}, @code{fuse},@code{lfuse} (low fuse), @code{hfuse} (high fuse), @code{efuse}(extended fuse), @code{signature}, @code{calibration}, @code{lock}.@itemThe memory type specified on the AVRDUDE command line must match one ofthe memory types defined for the specified chip.@itemThe @code{pwroff_after_write} flag causes AVRDUDE to attempt to powerthe device off and back on after an unsuccessful write to the affectedmemory area if VCC programmer pins are defined. If VCC pins are notdefined for the programmer, a message indicating that the device needs apower-cycle is printed out. This flag was added to work around aproblem with the at90s4433/2333's; see the at90s4433 errata at: @url{http://www.atmel.com/atmel/acrobat/doc1280.pdf}@end itemize@c@c Node@c@node Platform Dependent Information, , Configuration File, Top
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -