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