Avrdude

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://ojiqovam.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
----
 
=[http://ojiqovam.co.cc CLICK HERE]=
 
----
 
</div>
 
 
For detailed info:
 
For detailed info:
&lt;pre&gt;
+
<pre>
 
$ man avrdude
 
$ man avrdude
&lt;/pre&gt;
+
</pre>
  
&lt;h2&gt;See Also&lt;/h2&gt;
+
<h2>See Also</h2>
[[avr-gcc]]&lt;br&gt;
+
[[avr-gcc]]<br>
[[bus pirate]]&lt;br&gt;
+
[[bus pirate]]<br>
[[atmega328p]]&lt;br&gt;
+
[[atmega328p]]<br>
 
http://doswa.com/blog/2010/08/24/avrdude-5-10-with-ftdi-bitbang/
 
http://doswa.com/blog/2010/08/24/avrdude-5-10-with-ftdi-bitbang/
  
&lt;h2&gt;Useful Lines&lt;/h2&gt;
+
<h2>Useful Lines</h2>
&lt;h3&gt;For using the Arduino bootloader&lt;/h3&gt;
+
<h3>For using the Arduino bootloader</h3>
&lt;pre&gt;
+
<pre>
 
$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
 
$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
 
$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i
 
$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i
&lt;/pre&gt;
+
</pre>
&lt;h3&gt;For using the buspirate&lt;/h3&gt;
+
<h3>For using the buspirate</h3>
&lt;pre&gt;
+
<pre>
 
$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
 
$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
 
$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i
 
$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i
&lt;/pre&gt;
+
</pre>
  
&lt;h2&gt;Parameters&lt;/h2&gt;
+
<h2>Parameters</h2>
Parameters marked with a &lt;span style=&quot;color:red&quot;&gt;*&lt;/span&gt; are required.
+
Parameters marked with a <span style="color:red">*</span> are required.
&lt;h3&gt;&lt;span style=&quot;color:red&quot;&gt;*&lt;/span&gt; Programmer Type&lt;/h3&gt;
+
<h3><span style="color:red">*</span> Programmer Type</h3>
* &lt;code&gt;-c buspirate&lt;/code&gt; - for use with the buspirate
+
* <code>-c buspirate</code> - for use with the buspirate
* &lt;code&gt;-c stk500v1&lt;/code&gt; - for use with the Arduino bootloader
+
* <code>-c stk500v1</code> - for use with the Arduino bootloader
 
* other (see the man page)
 
* other (see the man page)
  
&lt;h3&gt;&lt;span style=&quot;color:red&quot;&gt;*&lt;/span&gt; Programmer Port&lt;/h3&gt;
+
<h3><span style="color:red">*</span> Programmer Port</h3>
* &lt;code&gt;-P /dev/ttyUSB1&lt;/code&gt; - the most likely for my systems
+
* <code>-P /dev/ttyUSB1</code> - the most likely for my systems
  
&lt;h3&gt;&lt;span style=&quot;color:red&quot;&gt;*&lt;/span&gt; Part Identifier&lt;/h3&gt;
+
<h3><span style="color:red">*</span> Part Identifier</h3>
* &lt;code&gt;-p m168&lt;/code&gt; - for use with an ATMega168
+
* <code>-p m168</code> - for use with an ATMega168
* &lt;code&gt;-p m328p&lt;/code&gt; - for use with an ATMega328p
+
* <code>-p m328p</code> - for use with an ATMega328p
* &lt;code&gt;-p m1280&lt;/code&gt; - for use with an ATMega1280
+
* <code>-p m1280</code> - for use with an ATMega1280
  
&lt;h3&gt;&lt;span style=&quot;color:red&quot;&gt;*&lt;/span&gt; Burn Counter&lt;/h3&gt;
+
<h3><span style="color:red">*</span> Burn Counter</h3>
 
Not technically required, but a good idea. The burn counter is stored in the last 4 bytes of eeprom
 
Not technically required, but a good idea. The burn counter is stored in the last 4 bytes of eeprom
* &lt;code&gt;-y&lt;/code&gt; - to increment the burn counter each burn
+
* <code>-y</code> - to increment the burn counter each burn
* &lt;code&gt;-Y &lt;i&gt;value&lt;/i&gt;&lt;/code&gt; - to initialise the burn counter
+
* <code>-Y <i>value</i></code> - to initialise the burn counter
  
&lt;h3&gt;Baud Rate&lt;/h3&gt;
+
<h3>Baud Rate</h3>
Required for &lt;code&gt;stk500v1&lt;/code&gt;&lt;br&gt;
+
Required for <code>stk500v1</code><br>
* &lt;code&gt;-b 57600&lt;/code&gt; - for most of mine
+
* <code>-b 57600</code> - for most of mine
  
&lt;h3&gt;Terminal Mode&lt;/h3&gt;
+
<h3>Terminal Mode</h3>
* &lt;code&gt;-t&lt;/code&gt; - see [[#terminal_mode]] for mode
+
* <code>-t</code> - see [[#terminal_mode]] for mode
  
&lt;h3&gt;Memory Access&lt;/h3&gt;
+
<h3>Memory Access</h3>
 
There are others, but these are the most common
 
There are others, but these are the most common
* &lt;code&gt;-U flash:&lt;i&gt;operation&lt;/i&gt;:&lt;i&gt;filename&lt;/i&gt;[:&lt;i&gt;format&lt;/i&gt;]&lt;/code&gt; - where the firmware lives
+
* <code>-U flash:<i>operation</i>:<i>filename</i>[:<i>format</i>]</code> - where the firmware lives
* &lt;code&gt;-U eeprom:&lt;i&gt;operation&lt;/i&gt;:&lt;i&gt;filename&lt;/i&gt;[:&lt;i&gt;format&lt;/i&gt;]&lt;/code&gt; - non-volatile memory
+
* <code>-U eeprom:<i>operation</i>:<i>filename</i>[:<i>format</i>]</code> - non-volatile memory
* &lt;code&gt;-U lfuse:&lt;i&gt;operation&lt;/i&gt;:&lt;i&gt;filename&lt;/i&gt;[:&lt;i&gt;format&lt;/i&gt;]&lt;/code&gt; - low fuse byte
+
* <code>-U lfuse:<i>operation</i>:<i>filename</i>[:<i>format</i>]</code> - low fuse byte
* &lt;code&gt;-U hfuse:&lt;i&gt;operation&lt;/i&gt;:&lt;i&gt;filename&lt;/i&gt;[:&lt;i&gt;format&lt;/i&gt;]&lt;/code&gt; - high fuse byte
+
* <code>-U hfuse:<i>operation</i>:<i>filename</i>[:<i>format</i>]</code> - high fuse byte
* &lt;code&gt;-U efuse:&lt;i&gt;operation&lt;/i&gt;:&lt;i&gt;filename&lt;/i&gt;[:&lt;i&gt;format&lt;/i&gt;]&lt;/code&gt; - extended fuse byte
+
* <code>-U efuse:<i>operation</i>:<i>filename</i>[:<i>format</i>]</code> - extended fuse byte
  
&lt;code&gt;&lt;i&gt;operation&lt;/i&gt;&lt;/code&gt; can be:
+
<code><i>operation</i></code> can be:
* &lt;code&gt;r&lt;/code&gt; - read
+
* <code>r</code> - read
* &lt;code&gt;w&lt;/code&gt; - write
+
* <code>w</code> - write
* &lt;code&gt;v&lt;/code&gt; - verify
+
* <code>v</code> - verify
  
&lt;code&gt;&lt;i&gt;filename&lt;/i&gt;&lt;/code&gt; points to the file to use
+
<code><i>filename</i></code> points to the file to use
  
&lt;code&gt;&lt;i&gt;format&lt;/i&gt;&lt;/code&gt; can be:
+
<code><i>format</i></code> can be:
* &lt;code&gt;a&lt;/code&gt; or omitted - for auto-detection
+
* <code>a</code> or omitted - for auto-detection
* &lt;code&gt;i&lt;/code&gt; - Intel Hex (output from obj-dump)
+
* <code>i</code> - Intel Hex (output from obj-dump)
* &lt;code&gt;r&lt;/code&gt; - Raw binary
+
* <code>r</code> - Raw binary
 
* other (see the man page)
 
* other (see the man page)
  
&lt;h2 id=&quot;terminal_mode&quot;&gt;Terminal Mode Commands&lt;/h2&gt;
+
<h2 id="terminal_mode">Terminal Mode Commands</h2>
&lt;h3&gt;&lt;code&gt;dump&lt;/code&gt;&lt;/h3&gt;
+
<h3><code>dump</code></h3>
* &lt;code&gt;dump &lt;i&gt;memtype&lt;/i&gt; &lt;i&gt;address&lt;/i&gt; &lt;i&gt;nBytes&lt;/i&gt;&lt;/code&gt; - dump &lt;i&gt;nBytes&lt;/i&gt; from &lt;i&gt;address&lt;/i&gt; in hex and ASCII
+
* <code>dump <i>memtype</i> <i>address</i> <i>nBytes</i></code> - dump <i>nBytes</i> from <i>address</i> in hex and ASCII
* &lt;code&gt;dump&lt;/code&gt; - continue for another &lt;i&gt;nBytes&lt;/i&gt;
+
* <code>dump</code> - continue for another <i>nBytes</i>
  
&lt;h3&gt;&lt;code&gt;write&lt;/code&gt;&lt;/h3&gt;
+
<h3><code>write</code></h3>
* &lt;code&gt;write &lt;i&gt;memtype&lt;/i&gt; &lt;i&gt;address&lt;/i&gt; &lt;i&gt;byte1&lt;/i&gt; &lt;i&gt;...&lt;/i&gt; &lt;i&gt;byteN&lt;/i&gt;&lt;/code&gt; - write to memory by hand, currently doesn't work with flash :(
+
* <code>write <i>memtype</i> <i>address</i> <i>byte1</i> <i>...</i> <i>byteN</i></code> - write to memory by hand, currently doesn't work with flash :(
  
&lt;h3&gt;&lt;code&gt;parm&lt;/code&gt;&lt;/h3&gt;
+
<h3><code>parm</code></h3>
* &lt;code&gt;part&lt;/code&gt; - display information on the connected part
+
* <code>part</code> - display information on the connected part

Revision as of 23:39, 18 December 2010

For detailed info:

$ man avrdude

Contents

See Also

avr-gcc
bus pirate
atmega328p
http://doswa.com/blog/2010/08/24/avrdude-5-10-with-ftdi-bitbang/

Useful Lines

For using the Arduino bootloader

$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
$ avrdude -c stk500v1 -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i

For using the buspirate

$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:w:main.hex
$ avrdude -c buspirate -P /dev/ttyUSB1 -p m328p -y -U flash:r:main.hex:i

Parameters

Parameters marked with a * are required.

* Programmer Type

  • -c buspirate - for use with the buspirate
  • -c stk500v1 - for use with the Arduino bootloader
  • other (see the man page)

* Programmer Port

  • -P /dev/ttyUSB1 - the most likely for my systems

* Part Identifier

  • -p m168 - for use with an ATMega168
  • -p m328p - for use with an ATMega328p
  • -p m1280 - for use with an ATMega1280

* Burn Counter

Not technically required, but a good idea. The burn counter is stored in the last 4 bytes of eeprom

  • -y - to increment the burn counter each burn
  • -Y value - to initialise the burn counter

Baud Rate

Required for stk500v1

  • -b 57600 - for most of mine

Terminal Mode

Memory Access

There are others, but these are the most common

  • -U flash:operation:filename[:format] - where the firmware lives
  • -U eeprom:operation:filename[:format] - non-volatile memory
  • -U lfuse:operation:filename[:format] - low fuse byte
  • -U hfuse:operation:filename[:format] - high fuse byte
  • -U efuse:operation:filename[:format] - extended fuse byte

operation can be:

  • r - read
  • w - write
  • v - verify

filename points to the file to use

format can be:

  • a or omitted - for auto-detection
  • i - Intel Hex (output from obj-dump)
  • r - Raw binary
  • other (see the man page)

Terminal Mode Commands

dump

  • dump memtype address nBytes - dump nBytes from address in hex and ASCII
  • dump - continue for another nBytes

write

  • write memtype address byte1 ... byteN - write to memory by hand, currently doesn't work with flash :(

parm

  • part - display information on the connected part
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox