| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
| 5 |
<meta name="description" content="dfu-programmer man page" /> |
| 6 |
<meta name="author" content="Simon Large" /> |
| 7 |
<title>dfu-programmer</title> |
| 8 |
<style> |
| 9 |
body { background: #003366; color:#404040; font:76% Verdana,Tahoma,Arial,sans-serif; margin:0 auto; padding:0;} |
| 10 |
#wrap {background:#fff; color:#404040; margin:0 auto; margin-top:10px; margin-bottom:10px; padding:10px; width:760px;} |
| 11 |
a {background-color:inherit; color:#286ea0; font-weight:700; text-decoration:none;} |
| 12 |
a:hover {background-color:inherit; color:#286ea0; text-decoration:underline;} |
| 13 |
a img {border:0;} |
| 14 |
p {margin:0 0 1.4em;} |
| 15 |
#content {line-height:1.5em; margin:20px 50px 5px; padding:0 10px;} |
| 16 |
#content h2 {font-size:1.6em; margin:0 0 10px;} |
| 17 |
#content h3 {font-size:1.1em; margin:0 0 4px;} |
| 18 |
#content h4 {font-size:1.0em; font-weight:normal; margin:0;} |
| 19 |
#content hr {margin-bottom: 20px;} |
| 20 |
</style> |
| 21 |
</head> |
| 22 |
<body> |
| 23 |
<div id="wrap"> |
| 24 |
<div id="content"> |
| 25 |
<h1><a href="http://sourceforge.net/projects/dfu-programmer/">dfu-programmer</a></h1> |
| 26 |
<h2>USB firmware upgrading for Atmel microcontrollers</h2> |
| 27 |
<hr /> |
| 28 |
<h2>SYNOPSIS</h2> |
| 29 |
<p> |
| 30 |
<b>dfu-programmer</b> target[:usb-bus,usb-addr] command [options] [parameters] |
| 31 |
<br /> |
| 32 |
<b>dfu-programmer</b> --help |
| 33 |
<br /> |
| 34 |
<b>dfu-programmer</b> --targets |
| 35 |
<br /> |
| 36 |
<b>dfu-programmer</b> --version |
| 37 |
</p> |
| 38 |
<h2>DESCRIPTION</h2> |
| 39 |
<p> |
| 40 |
<b>dfu-programmer</b> |
| 41 |
is a multi-platform command line Device Firmware Upgrade (DFU) based programmer |
| 42 |
for the flash memory on Atmel AVR, AVR32, XMEGA and 8051 based microcontrollers |
| 43 |
which ship with a USB boot loader. |
| 44 |
It supports In System Programming (ISP) for developers and potentially |
| 45 |
product updates in the field. |
| 46 |
Those boot loaders are patterned after the standard USB DFU 1.0 class |
| 47 |
specification, but depend on extensions defined by Atmel to the extent |
| 48 |
that standard DFU drivers will not work. |
| 49 |
</p> |
| 50 |
<p> |
| 51 |
To use it, first connect the device to be programmed and ensure that it |
| 52 |
comes up in DFU mode. |
| 53 |
The microcontrollers come up in that mode as shipped by Atmel; |
| 54 |
or they may reenter that mode after a special hardware reset. |
| 55 |
Then invoke this program to issue one or more DFU commands. |
| 56 |
You will normally need to start by issuing the "erase" command; |
| 57 |
the default security policies prevent extracting firmware, to prevent |
| 58 |
reverse engineering of what is usually proprietary code. |
| 59 |
</p> |
| 60 |
<h2>SUPPORTED MICROCONTROLLERS</h2> |
| 61 |
<p> |
| 62 |
These chip names are used as the command line "target" parameter. |
| 63 |
</p> |
| 64 |
<h3>8051 based controllers:</h3> |
| 65 |
<p> |
| 66 |
at89c51snd1c, at89c51snd2c, at89c5130, at89c5131, |
| 67 |
at89c5132 |
| 68 |
</p> |
| 69 |
<h3>AVR based controllers:</h3> |
| 70 |
<p> |
| 71 |
at90usb1287, at90usb1286, at90usb1287-4k, at90usb1286-4k, |
| 72 |
at90usb647, at90usb646, at90usb162, at90usb82, |
| 73 |
atmega32u6, atmega32u4, atmega32u2, atmega16u4, |
| 74 |
atmega16u2, atmega8u2 |
| 75 |
</p> |
| 76 |
<h3>AVR32 based controllers:</h3> |
| 77 |
<p> |
| 78 |
at32uc3a0128, at32uc3a1128, at32uc3a0256, at32uc3a1256, |
| 79 |
at32uc3a0512, at32uc3a1512, at32uc3a0512es, at32uc3a1512es, |
| 80 |
at32uc3a364, at32uc3a364s, at32uc3a3128, at32uc3a3128s, |
| 81 |
at32uc3a3256, at32uc3a3256s, at32uc3a4256s, at32uc3b064, |
| 82 |
at32uc3b164, at32uc3b0128, at32uc3b1128, at32uc3b0256, |
| 83 |
at32uc3b1256, at32uc3b0256es, at32uc3b1256es, at32uc3b0512, |
| 84 |
at32uc3b1512, at32uc3c064, at32uc3c0128, at32uc3c0256, |
| 85 |
at32uc3c0512, at32uc3c164, at32uc3c1128, at32uc3c1256, |
| 86 |
at32uc3c1512, at32uc3c264, at32uc3c2128, at32uc3c2256, |
| 87 |
at32uc3c2512 |
| 88 |
</p> |
| 89 |
<h3>XMEGA based controllers:</h3> |
| 90 |
<p> |
| 91 |
atxmega64a1u, atxmega128a1u, atxmega64a3u, atxmega128a3u, |
| 92 |
atxmega192a3u, atxmega256a3u, atxmega16a4u, atxmega32a4u, |
| 93 |
atxmega64a4u, atxmega128a4u, atxmega256a3bu, atxmega64b1, |
| 94 |
atxmega128b1, atxmega64b3, atxmega128b3, atxmega64c3, |
| 95 |
atxmega128c3, atxmega256c3, atxmega384c3, atxmega16c4, |
| 96 |
atxmega32c4 |
| 97 |
</p> |
| 98 |
|
| 99 |
<h2>USAGE</h2> |
| 100 |
<p> |
| 101 |
There are no mechanisms to implement gang programming. |
| 102 |
By default, the first device that matches the id codes for the |
| 103 |
given target is selected. Many targets share the same id codes. |
| 104 |
Accordingly, you will usually avoid connecting more than one |
| 105 |
device of a given family (AVR, XMEGA, AVR32 or 8051) at a time. |
| 106 |
</p> |
| 107 |
<p> |
| 108 |
The target may be qualified with the USB bus and address number |
| 109 |
of the device you wish to program. This allows programming multiple |
| 110 |
devices of the same family at the same time. |
| 111 |
</p> |
| 112 |
<p> |
| 113 |
All of these commands support the "global options". |
| 114 |
Unless you override it, |
| 115 |
commands which write to the microcontroller will perform |
| 116 |
a validation step that rereads the data which was written, |
| 117 |
compares it to the expected result, and reports any errors. |
| 118 |
</p> |
| 119 |
<p> |
| 120 |
Note that unlike Atmel's BatchISP program, dfu-programmer will |
| 121 |
only perform a single operation at a time. Erasing and programming |
| 122 |
require separate commands. |
| 123 |
</p> |
| 124 |
|
| 125 |
<h4><b>configure</b> register [--suppress-validation] data</h4> |
| 126 |
<p> |
| 127 |
Bootloaders for 8051 based controllers support writing certain |
| 128 |
configuration bytes. |
| 129 |
</p> |
| 130 |
<h4><b>dump</b> [--force] [--bin] [(flash)|--user|--eeprom]</h4> |
| 131 |
<p> |
| 132 |
Reads the program memory in flash and output non-blank pages in ihex format |
| 133 |
to stdout. Use --force to output the entire memory and --bin for binary |
| 134 |
output. User page and eeprom are selected using --user and --eeprom. |
| 135 |
</p> |
| 136 |
<h4><b>erase</b> [--force]</h4> |
| 137 |
<p> |
| 138 |
Erases all the flash memory. For AT90 and ATmega type devices a |
| 139 |
chip erase must be performed before other commands become available. |
| 140 |
Erase first checks if the memory is blank unless --force flag is set. |
| 141 |
</p> |
| 142 |
<h4><b>flash</b> [--force] [(flash)|--user|--eeprom] [--suppress-validation] |
| 143 |
[--suppress-bootloader-mem] [--validate-first] [--ignore-outside]<br /> |
| 144 |
[--serial=hexbytes:offset] file or STDIN</h4> |
| 145 |
<p> |
| 146 |
Writes flash memory. The input file (or stdin) must use the "ihex" file |
| 147 |
format convention for a memory image. --suppress-bootloader-mem |
| 148 |
ignores any data written to the bootloader memory space when flashing |
| 149 |
the device. This option is particularly useful for the AVR32 chips. |
| 150 |
The --force flag tells the program to ignore whether memory inside |
| 151 |
the program region is blank. |
| 152 |
User page and eeprom are selected using --user and --eeprom. |
| 153 |
The user space flash on AVR32 chips lies outside of the normal range |
| 154 |
of flash blocks and is designed to contain configuration parameters. |
| 155 |
Bootloader configuration uses the last 4 to 8 bytes of the user page. |
| 156 |
If this data is corrupted, the device will restart into the |
| 157 |
bootloader until valid data is used (see atmel doc7745 or doc32166). |
| 158 |
--force is always required here. |
| 159 |
</p> |
| 160 |
<p> |
| 161 |
--serial provides a way to inject a serial number or other unique |
| 162 |
sequence of bytes into the memory image programmed into the |
| 163 |
device. This allows using a single .ihex file to program multiple |
| 164 |
devices, and still give each device its own unique serial number. For |
| 165 |
example, --serial=ABCDEF01:0x6000 would program the byte at 0x6000 |
| 166 |
with the hex value AB, the byte at 0x6001 with the value CD, and so |
| 167 |
on. There must be an even number of hex digits, but the sequence can |
| 168 |
be any length. The offset is assumed to be given in hex if it starts |
| 169 |
with a "0x" prefix, octal if it begins with a "0", otherwise is it |
| 170 |
assumed to be decimal. |
| 171 |
</p> |
| 172 |
<p> |
| 173 |
--validate-first add a validate before writing the flash memory. If the |
| 174 |
validate succeeds (i.e. the firmware in the chip is the same as the one |
| 175 |
given as input), then no further operations are done, and the flash is |
| 176 |
reported as successful. |
| 177 |
</p> |
| 178 |
<p> |
| 179 |
--ignore-outside changes the validate behavior to ignore any error |
| 180 |
outside the programming region. This can be useful for programming a |
| 181 |
single part of the chip (where errors outside region are expected) without |
| 182 |
ignoring the validate result. |
| 183 |
</p> |
| 184 |
<h4><b>setsecure</b></h4> |
| 185 |
<p> |
| 186 |
Sets the security bit on AVR32 chips. This prevents the content being |
| 187 |
read back from the chip, except in the same session in which it was |
| 188 |
programmed. When the security fuse is set, almost nothing will work |
| 189 |
without first executing the erase command. The only way to clear the |
| 190 |
security fuse once set is to use a JTAG chip erase, which will also |
| 191 |
erase the bootloader. |
| 192 |
</p> |
| 193 |
<h4><b>get</b> register</h4> |
| 194 |
<p> |
| 195 |
Displays various product identifier bytes. |
| 196 |
</p> |
| 197 |
</p> |
| 198 |
<h4><b>launch</b> [--no-reset]</h4> |
| 199 |
<p> |
| 200 |
Launch the application by resetting the device. The --no-reset flag |
| 201 |
can be used to launch the device without a reset (jump to the start |
| 202 |
address of the program). |
| 203 |
</p> |
| 204 |
<h3>Global Options</h3> |
| 205 |
<h4><b>--quiet</b></h4> |
| 206 |
<p> |
| 207 |
minimizes the output |
| 208 |
</p> |
| 209 |
<h4><b>--debug</b> level</h4> |
| 210 |
<p> |
| 211 |
enables verbose output at the specified level |
| 212 |
</p> |
| 213 |
|
| 214 |
<h3>Configure Registers</h3> |
| 215 |
<p> |
| 216 |
The standard bootloader for 8051 based chips supports writing |
| 217 |
data bytes which are not relevant for the AVR based chips. |
| 218 |
</p> |
| 219 |
<p> |
| 220 |
BSB - boot status byte |
| 221 |
<br /> |
| 222 |
SBV - software boot vector |
| 223 |
<br /> |
| 224 |
SSB - software security byte |
| 225 |
<br /> |
| 226 |
EB - extra byte |
| 227 |
<br /> |
| 228 |
HSB - hardware security byte |
| 229 |
</p> |
| 230 |
|
| 231 |
<h3>Get Register</h3> |
| 232 |
<p> |
| 233 |
bootloader-version - currently flashed bootloader version |
| 234 |
<br /> |
| 235 |
ID1 - device boot identification 1 |
| 236 |
<br /> |
| 237 |
ID2 - device boot identification 2 |
| 238 |
<br /> |
| 239 |
manufacturer - the hardware manufacturer code |
| 240 |
<br /> |
| 241 |
family - the product family code |
| 242 |
<br /> |
| 243 |
product-name - the product name |
| 244 |
<br /> |
| 245 |
product-revision - the product revision |
| 246 |
<br /> |
| 247 |
HSB - same as the configure_register version |
| 248 |
<br /> |
| 249 |
BSB - same as the configure_register version |
| 250 |
<br /> |
| 251 |
SBV - same as the configure_register version |
| 252 |
<br /> |
| 253 |
SSB - same as the configure_register version |
| 254 |
<br /> |
| 255 |
EB - same as the configure_register version |
| 256 |
</p> |
| 257 |
|
| 258 |
<h2>BUGS</h2> |
| 259 |
<p> |
| 260 |
None known. |
| 261 |
</p> |
| 262 |
|
| 263 |
<h2>KNOWN ISSUES</h2> |
| 264 |
<p> |
| 265 |
The at90usb series chips do not make available any read/write protect |
| 266 |
flags so the |
| 267 |
<b>dump</b> |
| 268 |
or |
| 269 |
<b>flash</b> |
| 270 |
command may fail with a less than helpful error message. |
| 271 |
To remove |
| 272 |
<b>any</b> |
| 273 |
write or read protection from any chips, a full chip erasure is required. |
| 274 |
For AVR32 chips an erase operation over USB will remove protection until the |
| 275 |
device is rebooted. To remove the protection more permanently requires a |
| 276 |
JTAG erase (which will also erase the bootloader). |
| 277 |
</p> |
| 278 |
<p> |
| 279 |
You may need to be a member of the |
| 280 |
<b>uucp</b> |
| 281 |
group in order to have access to the device without needing to be root. |
| 282 |
</p> |
| 283 |
|
| 284 |
<h2>AUTHOR</h2> |
| 285 |
<p> |
| 286 |
Weston Schmidt <[email protected]> |
| 287 |
</p> |
| 288 |
|
| 289 |
<h2>SEE ALSO</h2> |
| 290 |
<p> |
| 291 |
<a href="http://dfu-programmer.sourceforge.net">dfu-programmer.sourceforge.net</a>,<br /> |
| 292 |
<a href="http://www.atmel.com/Images/doc7618.pdf">USB DFU Bootloader Datasheet (8051, AVR)</a>,<br /> |
| 293 |
<a href="http://www.atmel.com/Images/doc32131.pdf">AVR32 UC3 USB DFU Bootloader Protocol</a>,<br /> |
| 294 |
<a href="http://www.atmel.com/Images/doc8457.pdf">FLIP USB DFU Protocol</a>,<br /> |
| 295 |
<a href="http://www.atmel.com/Images/doc7745.pdf">AVR32 UC3 USB DFU Bootloader</a> |
| 296 |
</p> |
| 297 |
|
| 298 |
<h2>COPYRIGHT</h2> |
| 299 |
<p> |
| 300 |
Copyright © 2005-2014 Weston Schmidt |
| 301 |
</p> |
| 302 |
<p> |
| 303 |
This program is free software; you can redistribute it and/or modify |
| 304 |
it under the terms of the GNU General Public License as published by |
| 305 |
the Free Software Foundation; either version 2 of the License, or |
| 306 |
(at your option) any later version. |
| 307 |
</p> |
| 308 |
<p> |
| 309 |
This program is distributed in the hope that it will be useful, |
| 310 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 311 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 312 |
GNU General Public License for more details. |
| 313 |
</p> |
| 314 |
<p> |
| 315 |
You should have received a copy of the GNU General Public License |
| 316 |
along with this program; if not, write to the Free Software |
| 317 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 318 |
</p> |
| 319 |
|
| 320 |
</div> |
| 321 |
</div> |
| 322 |
</body> |
| 323 |
</html> |