altos/test: Adjust CRC error rate after FEC fix
[fw/altos] / doc / updating-firmware.inc
1 [appendix]
2 == Updating Device Firmware
3
4         ifdef::telemega[]
5         TeleMega, TeleMetrum v2 and newer, EasyMega, EasyMini and TeleDongle v3
6         are all
7         endif::telemega[]
8         ifndef::telemega[]
9         EasyMini is
10         endif::telemega[]
11         programmed directly over their USB connectors (self
12         programming).
13         ifdef::telemega[]
14         TeleMetrum v1, TeleMini v1.0 and TeleDongle v0.2 are
15         all programmed by using another device as a programmer (pair
16         programming). It's important to recognize which kind of devices
17         you have before trying to reprogram them.
18         endif::telemega[]
19
20         TeleMini v3 can be updated directly over USB, but has no USB connector
21         on the board.  Instead, the USB signals are present on a row of 6
22         holes adjacent to the copyright assertion in the silk screen.  Thus, 
23         updating firmware on TeleMini v3 requires making up a special cable, 
24         after which you can treat it just like TeleMetrum or TeleMega.  Many
25         USB cables seem to follow the color code of red is +5V, black is GND,
26         green is USB +, and white is USB -.  On TeleMini v3, pin 3 which has 
27         a square copper pad is ground, pin 1 is USB -, and pin 2 is USB +.  
28
29         You may wish to begin by ensuring you have current firmware
30         images.  These are distributed as part of the AltOS software
31         bundle that also includes the AltosUI ground station program.
32         Newer ground station versions typically work fine with older
33         firmware versions, so you don't need to update your devices
34         just to try out new software features.  You can always
35         download the most recent version from
36         http://www.altusmetrum.org/AltOS/
37
38         ifdef::telemega[]
39
40         === Updating TeleMega, TeleMetrum v2 or newer, TeleMini v3, EasyMega, EasyMini, TeleDongle v3 or TeleBT v3 Firmware
41
42         endif::telemega[]
43         ifndef::telemega[]
44
45         === Updating EasyMini Firmware
46
47         endif::telemega[]
48
49                 Self-programmable devices are reprogrammed by
50                 connecting them to your computer over USB.
51
52                 . Attach a battery if necessary and power switch to
53                   the target device. Power up the device.
54
55                 . Using a Micro USB cable, connect the target device to your
56                   computer's USB socket.  If the target is a TeleMini v3,
57                   make up and attach a special USB cable.
58
59                 . Run AltosUI, and select 'Flash Image' from the File menu.
60
61                 . Select the target device in the Device Selection dialog.
62
63                 . Select the image you want to flash to the device,
64                   which should have a name in the form
65                   <product>-v<product-version>-<software-version>.ihx,
66                   such as EasyMini-v1.0-1.6.0.ihx.
67
68                 . Make sure the configuration parameters are
69                   reasonable looking. If the serial number and/or RF
70                   configuration values aren't right, you'll need to
71                   change them.
72
73                 . Hit the 'OK' button and the software should proceed
74                   to flash the device with new firmware, showing a
75                   progress bar.
76
77                 . Verify that the device is working by using the
78                   'Configure Altimeter' or 'Configure Groundstation'
79                   item to check over the configuration.
80
81                 ==== Recovering From Self-Flashing Failure
82
83                         If the firmware loading fails, it can leave the device
84                         unable to boot. Not to worry, you can force the device to
85                         start the boot loader instead, which will let you try to
86                         flash the device again.
87
88                         On each device, connecting two pins from one of the exposed
89                         connectors will force the boot loader to start, even if the
90                         regular operating system has been corrupted in some way.
91
92                         ifdef::telemega[]
93                         TeleMega::
94
95                         Connect pin 6 and pin 1 of the companion
96                         connector. Pin 1 can be identified by the square pad
97                         around it, and then the pins count sequentially across
98                         the board. Be very careful to *not* short pin 8 to
99                         anything as that is connected directly to the
100                         battery. Pin 7 carries 3.3V and the board will crash
101                         if that is connected to pin 1, but shouldn't damage
102                         the board.
103                         endif::telemega[]
104
105                         ifdef::easymega[]
106                         EasyMega::
107
108                         Connect pin 6 and pin 1 of the companion
109                         connector. Pin 1 can be identified by the square pad
110                         around it, and then the pins count sequentially across
111                         the board. Be very careful to *not* short pin 8 to
112                         anything as that is connected directly to the
113                         battery. Pin 7 carries 3.3V and the board will crash
114                         if that is connected to pin 1, but shouldn't damage
115                         the board.
116                         endif::easymega[]
117
118                         ifdef::easytimer[]
119                         EasyTimer::
120
121                         Connect pin 5 and pin 1 of the debug connector, which
122                         is the six holes next to the beeper. Pin 1 can be
123                         identified by the square pad around it, and then the
124                         pins count sequentially across the board, making Pin 5
125                         the one on the other end of the row.
126                         endif::easytimer[]
127
128                         ifdef::telemetrum[]
129                         TeleMetrum v2 and newer::
130
131                         Connect pin 6 and pin 1 of the companion
132                         connector. Pin 1 can be identified by the square pad
133                         around it, and then the pins count sequentially across
134                         the board. Be very careful to *not* short pin 8 to
135                         anything as that is connected directly to the
136                         battery. Pin 7 carries 3.3V and the board will crash
137                         if that is connected to pin 1, but shouldn't damage
138                         the board.
139                         endif::telemetrum[]
140
141                         ifdef::easymini[]
142                         EasyMini::
143
144                         Connect pin 6 and pin 1 of the debug connector, which
145                         is the six holes next to the beeper. Pin 1 can be
146                         identified by the square pad around it, and then the
147                         pins count sequentially across the board, making Pin 6
148                         the one on the other end of the row.
149                         endif::easymini[]
150
151                         TeleGPS v1::
152
153                         Connect pin 32 on the CPU to ground.  Pin 32 is the
154                         right-most pin on the bottom edge of the CPU when the
155                         board is oriented with the USB and battery connectors
156                         to the right.
157
158                         TeleGPS v2::
159
160                         Connect together pins 1 and 5 of the Debug connector.
161                         Pin 1 is the pin with the square pad around the hole.
162
163                         ifdef::telemetrum[]
164                         TeleDongle v3::
165
166                         Connect pin 32 on the CPU to ground. Pin 32 is closest
167                         to the USB wires on the row of pins towards the center
168                         of the board. Ground is available on the capacitor
169                         next to it, on the end towards the USB wires.
170                         
171                         TeleBT v3::
172
173                         Connect pin 4 on the CPU to 3.3V, which can be done by
174                         connecting pin 1 to pin 4.  Pin 1 is the left pin on
175                         the lower edge of the chip when the unit is oriented
176                         such that the SMA is at the top.
177
178                         TeleBT v4::
179
180                         Connect pin 30 on the CPU to ground. Pin 30 is the 6th
181                         pin from the right on the top when the unit is oriented
182                         such that the SMA is at the top.
183                         endif::telemetrum[]
184
185                         Once you've located the right pins:
186
187                         . Turn the altimeter power off.
188
189                         . Connect a battery.
190
191                         . Connect the indicated terminals together with a
192                           short piece of wire. Take care not to accidentally
193                           connect anything else.
194
195                         . Connect USB
196
197                         . Turn the board power on.
198
199                         The board should now be visible over USB as
200                         'AltosFlash' and be ready to receive firmware.  Once
201                         the board has been powered up, you can remove the
202                         piece of wire.
203
204         ifdef::telemetrum,telemini[]
205         === Pair Programming
206
207                 The big concept to understand is that you have to use
208                 a TeleMetrum v1.0, TeleBT v1.0 or TeleDongle v0.2 as a
209                 programmer to update a pair programmed device. Due to
210                 limited memory resources in the cc1111, we don't
211                 support programming directly over USB for these
212                 devices.
213
214                 If you need to update the firmware on a TeleDongle
215                 v0.2, we recommend updating the altimeter first,
216                 before updating TeleDongle.  However, note that
217                 TeleDongle rarely need to be updated.  Any firmware
218                 version 1.0.1 or later will work, version 1.2.1 may
219                 have improved receiver performance slightly.
220
221                 ==== Updating TeleMetrum v1.x Firmware
222
223                         . Find the 'programming cable' that you got as
224                           part of the starter kit, that has a red
225                           8-pin MicroMaTch connector on one end and a
226                           red 4-pin MicroMaTch connector on the other
227                           end.
228
229                         . Take the 2 screws out of the TeleDongle v0.2
230                           or TeleBT v1.0 case to get access to the
231                           circuit board.
232
233                         . Plug the 8-pin end of the programming cable
234                           to the matching connector on the TeleDongle
235                           v0.2 or TeleBT v1.0, and the 4-pin end to
236                           the matching connector on the TeleMetrum.
237                           Note that each MicroMaTch connector has an
238                           alignment pin that goes through a hole in
239                           the PC board when you have the cable
240                           oriented correctly.
241
242                         . Attach a battery to the TeleMetrum board.
243
244                         . Plug the TeleDongle v0.2 or TeleBT v1.0 into
245                           your computer's USB port, and power up the
246                           TeleMetrum.
247
248                         . Run AltosUI, and select 'Flash Image' from
249                           the File menu.
250
251                         . Pick the TeleDongle v0.2 or TeleBT v1.0
252                           device from the list, identifying it as the
253                           programming device.
254
255                         . Select the image you want put on the
256                           TeleMetrum, which should have a name in the
257                           form telemetrum-v1.2-1.0.0.ihx.  It should
258                           be visible in the default directory, if not
259                           you may have to poke around your system to
260                           find it.
261
262                         . Make sure the configuration parameters are
263                           reasonable looking. If the serial number
264                           and/or RF configuration values aren't right,
265                           you'll need to change them.
266
267                         . Hit the 'OK' button and the software should
268                           proceed to flash the TeleMetrum with new
269                           firmware, showing a progress bar.
270
271                         . Confirm that the TeleMetrum board seems to
272                           have updated OK, which you can do by
273                           plugging in to it over USB and using a
274                           terminal program to connect to the board and
275                           issue the 'v' command to check the version,
276                           etc.
277
278                         If something goes wrong, give it another try.
279
280                 ==== Updating TeleMini v1.0 Firmware
281
282                         You'll need a special 'programming cable' to
283                         reprogram the TeleMini v1.0.  You can make your own
284                         using an 8-pin MicroMaTch connector on one end
285                         and a set of four pins on the other.
286
287                         . Take the 2 screws out of the TeleDongle v0.2
288                           or TeleBT v1.0 case to get access to the
289                           circuit board.
290
291                         . Plug the 8-pin end of the programming cable
292                           to the matching connector on the TeleDongle
293                           v0.2 or TeleBT v1.0, and the 4-pins into the
294                           holes in the TeleMini v1.0 circuit board.  Note
295                           that the MicroMaTch connector has an
296                           alignment pin that goes through a hole in
297                           the PC board when you have the cable
298                           oriented correctly, and that pin 1 on the
299                           TeleMini v1.0 board is marked with a square pad
300                           while the other pins have round pads.
301
302                         . Attach a battery to the TeleMini v1.0 board.
303
304                         . Plug the TeleDongle v0.2 or TeleBT v1.0 into
305                           your computer's USB port, and power up the
306                           TeleMini v1.0
307
308                         . Run AltosUI, and select 'Flash Image' from
309                           the File menu.
310
311                         . Pick the TeleDongle v0.2 or TeleBT v1.0
312                           device from the list, identifying it as the
313                           programming device.
314
315                         . Select the image you want put on the
316                           TeleMini v1.0, which should have a name in the
317                           form telemini-v1.0-1.0.0.ihx.  It should be
318                           visible in the default directory, if not you
319                           may have to poke around your system to find
320                           it.
321
322                         . Make sure the configuration parameters are
323                           reasonable looking. If the serial number
324                           and/or RF configuration values aren't right,
325                           you'll need to change them.
326
327                         . Hit the 'OK' button and the software should
328                           proceed to flash the TeleMini v1.0 with new
329                           firmware, showing a progress bar.
330
331                         . Confirm that the TeleMini v1.0 board seems to
332                           have updated OK, which you can do by
333                           configuring it over the radio link through
334                           the TeleDongle, or letting it come up in
335                           “flight” mode and listening for telemetry.
336
337                         If something goes wrong, give it another try.
338
339                 ==== Updating TeleDongle v0.2 Firmware
340
341                 Updating TeleDongle v0.2 firmware is just like
342                 updating TeleMetrum v1.x or TeleMini v1.0 firmware, but you
343                 use either a TeleMetrum v1.x, TeleDongle v0.2 or
344                 TeleBT v1.0 as the programmer.
345
346                 . Find the 'programming cable' that you got as part of
347                   the starter kit, that has a red 8-pin MicroMaTch
348                   connector on one end and a red 4-pin MicroMaTch
349                   connector on the other end.
350
351                 . Find the USB cable that you got as part of the
352                   starter kit, and plug the “mini” end in to the
353                   mating connector on TeleMetrum v1.x, TeleDongle v0.2
354                   or TeleBT v1.0.
355
356                 . Take the 2 screws out of the TeleDongle v0.2 or
357                   TeleBT v1.0 case to get access to the circuit board.
358
359                 . Plug the 8-pin end of the programming cable to the
360                   matching connector on the programmer, and the 4-pin
361                   end to the matching connector on the TeleDongle
362                   v0.2.  Note that each MicroMaTch connector has an
363                   alignment pin that goes through a hole in the PC
364                   board when you have the cable oriented correctly.
365
366                 . Attach a battery to the TeleMetrum v1.x board if
367                   you're using one.
368
369                 . Plug both the programmer and the TeleDongle into
370                   your computer's USB ports, and power up the
371                   programmer.
372
373                 . Run AltosUI, and select 'Flash Image' from the File
374                   menu.
375
376                 . Pick the programmer device from the list,
377                   identifying it as the programming device.
378
379
380                 . Select the image you want put on the TeleDongle
381                   v0.2, which should have a name in the form
382                   teledongle-v0.2-1.0.0.ihx.  It should be visible in
383                   the default directory, if not you may have to poke
384                   around your system to find it.
385
386                 . Make sure the configuration parameters are
387                   reasonable looking. If the serial number and/or RF
388                   configuration values aren't right, you'll need to
389                   change them.  The TeleDongle v0.2 serial number is
390                   on the “bottom” of the circuit board, and can
391                   usually be read through the translucent blue plastic
392                   case without needing to remove the board from the
393                   case.
394
395                 . Hit the 'OK' button and the software should proceed
396                   to flash the TeleDongle v0.2 with new firmware,
397                   showing a progress bar.
398
399                 . Confirm that the TeleDongle v0.2 board seems to have
400                   updated OK, which you can do by plugging in to it
401                   over USB and using a terminal program to connect to
402                   the board and issue the 'v' command to check the
403                   version, etc.  Once you're happy, remove the
404                   programming cable and put the cover back on the
405                   TeleDongle v0.2.
406
407                 If something goes wrong, give it another try.
408
409                 Be careful removing the programming cable from the
410                 locking 8-pin connector on TeleMetrum.  You'll need a
411                 fingernail or perhaps a thin screwdriver or knife
412                 blade to gently pry the locking ears out slightly to
413                 extract the connector.  We used a locking connector on
414                 TeleMetrum to help ensure that the cabling to
415                 companion boards used in a rocket don't ever come
416                 loose accidentally in flight.
417         endif::telemetrum,telemini[]