-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupditool.1
178 lines (143 loc) · 4.91 KB
/
upditool.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
.Dd DATE Sun 13 Sep 2020
.Os
.Dt UPDITOOL
.Sh NAME
.Nm upditool
.Nd driver program for read/write Microchip UPDI based devices using ``usb-serial programmer''
.Sh SYNOPSIS
.Nm
.Fl p Ar partno
.Fl P Ar port
.Op Fl b Ar baudrate
.Op Fl D
.Op Fl e
.Op Fl F
.Op Fl U Ar memtype:op:filename:filefmt
.Op Fl V
.Sh DESCRIPTION
.Nm upditool
is a program for read/write memories in Microchip microcontrollers over UPDI
interface.
.Nm upditool
Supports USB-SERIAL TTL adapter as programmer. Several types of USB
to serial converter can be used, here connection schematics:
.nf
PL2303HX UART
CP2102/CP2109 UART
CH340 UART
Microchip UPDI device
+---------+ +--------------------+
| 3.3/5V +-------------------+ Vcc |
+----| | | |
| U | RX +--------------+----+ UPDI |
| S | | | | |
| B | | +------+ | | |
+----| TX +---| 2k2 |---+ | |
| | +------+ | |
| GND +-------------------+ GND |
+---------+ +--------------------+
.fi
.Ss Options
.Bl -tag -offset indent -width indent
.It Fl p Ar partno
mandatory, device name
.It Fl b Ar baudrate
Set baudrate for UPDI (75000 to 1600000), default is 115200. Serial adapters
does not allow arbitrary speed, 76800 is usualy minimal available speed.
.It Fl D
Disable auto erase for flash. When the
.It Fl e
Causes a chip erase to be executed. This will reset the contents of the
FLASH and EEPROM to the value
.It Fl F
Disable signature verification
.It Fl V
Disable automatic verify check when uploading data.
.It Fl P Ar port
Use
.Ar port
to identify the device to which the programmer is attached. For example
.Pa /dev/ttyUSB0
.It Fl U
This man page is incomplette, please read avrdude manual for memory
specification and read examples below.
.El
STATUS
\fBAVR128DA(28,32,48,64):\fP
.nf
(serial speed 230400)
CHIP ERASE OK
FLASH read/write OK
EEPROM read/write OK
FUSES read/write OK
LOCK read/write OK
USERROW read/write OK
USERROW write on locked device OK
SIGNATURE read OK
TEMPSENSE read OK
SERIAL read OK
.fi
You can read all supported memory names inclusive aliases for fuses etc.
by running:
\fB upditool -p avr128da32 -P /dev/null -U help::: \fP
Speed:
FLASH 64kiB write - about 18 seconds, verify 64kiB - about 10 seconds
FLASH 128kiB read - about 20 seconds
\fBATmega4808/4809\fP (untested but may work on ATmega3208/3209):
.nf
(serial speed 115200)
CHIP ERASE OK
FLASH read/write unstable
EEPROM read/write OK
FUSES read/write OK
LOCK read/write OK
USERROW read/write OK
USERROW write on locked device not supported/planed
SIGNATURE read OK
TEMPSENSE read OK
SERIAL read OK
OSC16ERR3V read OK
OSC16ERR5V read OK
OSC20ERR3V read OK
OSC20ERR5V read OK
.fi
unstable - working for me at 76800, but at 115200 sometime response from UPDI is lost
You can read all supported memory names inclusive aliases for fuses etc.
by running:
\fB upditool -p mega4808 -P /dev/null -U help::: \fP
Examples:
read flash into file flash.bin (raw)
.br
\fBupditool-U flash:r:flash.bin:r -p avr128da32 -P /dev/ttyUSB2\fP
read eeprom into file eeprom.bin (raw):
.br
\fBupditool-U eeprom:r:eeprom.bin:r -p avr128da32 -P /dev/ttyUSB2\fP
read eeprom into file eeprom.hex (intel hex)
.br
\fBupditool-U eeprom:r:eeprom.hex:i -p avr128da32 -P /dev/ttyUSB2\fP
read signature (to display as hexdump, 3 bytes)
.br
\fBupditool-U signature:r:-:h -p avr128da32 -P /dev/ttyUSB2\fP
.brread serial into file serial.bin (raw. device dependent size)
\fBupditool-U serial:r:serial.bin:r -p avr128da32 -P /dev/ttyUSB2\fP
.br
read userrow into file userrow.bin (raw. device dependent size)
\fBupditool-U usersig:r:userrow.bin:r -p avr128da32 -P /dev/ttyUSB2\fP
or
.br
\fBupditool-U userrow:r:userrow.bin:r -p avr128da32 -P /dev/ttyUSB2\fP
write userrow (only 1st two bytes) from command line immediete arguments
.br
\fBupditool -p avr128da32 -P /dev/ttyUSB2 -U userrow:w:0x55,0xaa:m\fP
read lock byte(s) into file lock.bin (raw. device dependent size)
.br
\fBupditool -U lock:r:lock.bin:r -p avr128da32 -P /dev/ttyUSB2 -b 115200\fP
multiple memories read:
.br
\fBupditool -U signature:v:0x1e,0x97,0x09:m -U serial:r:/dev/null:h
-U eeprom:r:-:h -U TEMPSENSE0:r:-:h -U TEMPSENSE1:r:-:h
-U lock:r:-:h -U userrow:r:-:h
-p avr128da32 -P /dev/ttyUSB2\fP
lock device
.br
\fBupditool -p avr128da32 -P /dev/ttyUSB2 -U lock0:w:0x00:m\fP