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