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