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