forked from nicsure/TD-H3-Engineering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirmware_flash_protocol.txt
200 lines (161 loc) · 13 KB
/
firmware_flash_protocol.txt
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
Serial Data
@ 115200 baud, 8 Data bits, 1 Stop Bit, No Parity
When the radio is powered on with the PTT key pressed it will continually send the same byte to the host
0xA5
This is the signal to the host that radio has been turned on in flash mode and flashing can now commence.
The host should now send the following data
A0 EE 74 71 07 74 55 55 55 55 55 55 55 55 55 55
55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55
55 55 55 55
Timing is critical here, the radio will continue to send the 0xA5 bytes to the host. The host should keep reading
these bytes until it detects they've stopped being sent.
At this point the host has about 500 milliseconds to start sending the data.
First Data Packet
Packet ID Block Number CheckSum
A1 00 00 FE
Firmware Data
02 C3 CA E4 FB FD 7F 24 02 EC AD 02 76 A4 E4 F5
38 75 39 51 85 38 3A F5 37 AF 3A 05 3A 75 6A FF
Each packet should be acknowledged by the radio with a single byte
0xA3
Second Data Packet
Packet ID Block Number CheckSum
A1 00 01 6B
AD 39 12 00 8F 94 80 40 F0 85 38 3A E5 39 24 27
F5 3B E4 F5 37 AF 3A 05 3A 75 6A FF AD 3B 12 00
As you can see, the block number is not an address, it counts up for
each data packet that's sent.
This continues all the way to the end of the firmware data, at which point
the last data packet is different.
Last Data Packet
Packet ID Block Number CheckSum
A2 07 AF A1
7F 01 02 BC 59 7F 02 02 BC 59 7F 03 02 BC 59 7F
2D DF FE 22 7F 0C 02 CE 3A B2 C6 22 DF FE 22 00
The very last packet must have a Packet ID of A2. The radio will respond as usual with 0xA3
This packet should be padded with 00's at the end to make it 32 bytes.
And that completes the firmware flash process.
ComSnooper Output COM24=Radio COM12=Host
========================================
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:2) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A0 EE 74 71 07 74 55 55 55 55 55 55 55 55 55 55 | ··tq·tUUUUUUUUUU |
| 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 | UUUUUUUUUUUUUUUU |
| 55 55 55 55 | UUUU |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A5 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A1 00 00 FE 02 C3 CA E4 FB FD 7F 24 02 EC AD 02 | ···········$···· |
| 76 A4 E4 F5 38 75 39 51 85 38 3A F5 37 AF 3A 05 | v···8u9Q·8:·7·:· |
| 3A 75 6A FF | :uj· |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A1 00 01 6B AD 39 12 00 8F 94 80 40 F0 85 38 3A | ···k·9·····@··8: |
| E5 39 24 27 F5 3B E4 F5 37 AF 3A 05 3A 75 6A FF | ·9$'·;··7·:·:uj· |
| AD 3B 12 00 | ·;·· |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A1 00 02 9A 8F 94 80 40 F0 12 50 06 AD 3B 05 3B | ·······@··P··;·; |
| 75 6A FF 7B FF AF 38 12 E5 F0 05 37 E5 37 C3 94 | uj·{··8····7·7·· |
| 27 40 E9 12 | '@·· |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+
...
...
...
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A1 07 AD 95 D2 B7 D2 B6 22 12 F4 23 7F 20 02 D6 | ········"··#· ·· |
| A9 E4 90 02 B0 F0 A3 F0 22 E4 FF 0F BF 05 FC 22 | ········"······" |
| 12 37 2F 02 | ·7/· |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A1 07 AE 19 DF 14 12 37 4F 02 DF 14 12 37 6A 02 | ·······7O····7j· |
| DF 14 12 37 7A 02 DF 14 20 7D 02 C2 C3 22 12 D6 | ···7z··· }···"·· |
| A9 02 F2 6E | ···n |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM12 -> COM24 (Length:36) |
+--------------------------------------------------------------------+
| A2 07 AF A1 7F 01 02 BC 59 7F 02 02 BC 59 7F 03 | ········Y····Y·· |
| 02 BC 59 7F 2D DF FE 22 7F 0C 02 CE 3A B2 C6 22 | ··Y·-··"····:··" |
| DF FE 22 00 | ··"· |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| COM24 -> COM12 (Length:1) |
+--------------------------------------------------------------------+
| A3 | · |
+--------------------------------------------------------------------+