0c75fdeed6c4edbb6e9256d1b596689d151425b3
[fw/altos] / doc / updating-firmware.inc
1 [appendix]
2 == Updating Device Firmware
3
4         ifdef::telemega[]
5         TeleMega, TeleMetrum v2, 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, EasyMega, EasyMini or TeleDongle 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::telemetrum[]
109                         TeleMetrum v2::
110
111                         Connect pin 6 and pin 1 of the companion
112                         connector. Pin 1 can be identified by the square pad
113                         around it, and then the pins could sequentially across
114                         the board. Be very careful to *not* short pin 8 to
115                         anything as that is connected directly to the
116                         battery. Pin 7 carries 3.3V and the board will crash
117                         if that is connected to pin 1, but shouldn't damage
118                         the board.
119                         endif::telemetrum[]
120
121                         ifdef::easymini[]
122                         EasyMini::
123
124                         Connect pin 6 and pin 1 of the debug connector, which
125                         is the six holes next to the beeper. Pin 1 can be
126                         identified by the square pad around it, and then the
127                         pins could sequentially across the board, making Pin 6
128                         the one on the other end of the row.
129                         endif::easymini[]
130
131                         TeleGPS v1::
132
133                         Connect pin 32 on the CPU to ground.  Pin 32 is the
134                         right-most pin on the bottom edge of the CPU when the
135                         board is oriented with the USB and battery connectors
136                         to the right.
137
138                         TeleGPS v2::
139
140                         Connect together pins 1 and 5 of the Debug connector.
141                         Pin 1 is the pin with the square pad around the hole.
142
143                         ifdef::telemetrum[]
144                         TeleDongle v3::
145
146                         Connect pin 32 on the CPU to ground. Pin 32 is closest
147                         to the USB wires on the row of pins towards the center
148                         of the board. Ground is available on the capacitor
149                         next to it, on the end towards the USB wires.
150                         
151                         TeleBT v3::
152
153                         Connect pin 4 on the CPU to 3.3V, which can be done by
154                         connecting pin 1 to pin 4.  Pin 1 is the left pin on
155                         the lower edge of the chip when the unit is oriented
156                         such that the SMA is at the top.
157
158                         TeleBT v4::
159
160                         Connect pin 30 on the CPU to ground. Pin 30 is the 6th
161                         pin from the right on the top when the unit is oriented
162                         such that the SMA is at the top.
163                         endif::telemetrum[]
164
165                         Once you've located the right pins:
166
167                         . Turn the altimeter power off.
168
169                         . Connect a battery.
170
171                         . Connect the indicated terminals together with a
172                           short piece of wire. Take care not to accidentally
173                           connect anything else.
174
175                         . Connect USB
176
177                         . Turn the board power on.
178
179                         The board should now be visible over USB as
180                         'AltosFlash' and be ready to receive firmware.  Once
181                         the board has been powered up, you can remove the
182                         piece of wire.
183
184         ifdef::telemetrum,telemini[]
185         === Pair Programming
186
187                 The big concept to understand is that you have to use
188                 a TeleMetrum v1.0, TeleBT v1.0 or TeleDongle v0.2 as a
189                 programmer to update a pair programmed device. Due to
190                 limited memory resources in the cc1111, we don't
191                 support programming directly over USB for these
192                 devices.
193
194                 If you need to update the firmware on a TeleDongle
195                 v0.2, we recommend updating the altimeter first,
196                 before updating TeleDongle.  However, note that
197                 TeleDongle rarely need to be updated.  Any firmware
198                 version 1.0.1 or later will work, version 1.2.1 may
199                 have improved receiver performance slightly.
200
201                 ==== Updating TeleMetrum v1.x Firmware
202
203                         . Find the 'programming cable' that you got as
204                           part of the starter kit, that has a red
205                           8-pin MicroMaTch connector on one end and a
206                           red 4-pin MicroMaTch connector on the other
207                           end.
208
209                         . Take the 2 screws out of the TeleDongle v0.2
210                           or TeleBT v1.0 case to get access to the
211                           circuit board.
212
213                         . Plug the 8-pin end of the programming cable
214                           to the matching connector on the TeleDongle
215                           v0.2 or TeleBT v1.0, and the 4-pin end to
216                           the matching connector on the TeleMetrum.
217                           Note that each MicroMaTch connector has an
218                           alignment pin that goes through a hole in
219                           the PC board when you have the cable
220                           oriented correctly.
221
222                         . Attach a battery to the TeleMetrum board.
223
224                         . Plug the TeleDongle v0.2 or TeleBT v1.0 into
225                           your computer's USB port, and power up the
226                           TeleMetrum.
227
228                         . Run AltosUI, and select 'Flash Image' from
229                           the File menu.
230
231                         . Pick the TeleDongle v0.2 or TeleBT v1.0
232                           device from the list, identifying it as the
233                           programming device.
234
235                         . Select the image you want put on the
236                           TeleMetrum, which should have a name in the
237                           form telemetrum-v1.2-1.0.0.ihx.  It should
238                           be visible in the default directory, if not
239                           you may have to poke around your system to
240                           find it.
241
242                         . Make sure the configuration parameters are
243                           reasonable looking. If the serial number
244                           and/or RF configuration values aren't right,
245                           you'll need to change them.
246
247                         . Hit the 'OK' button and the software should
248                           proceed to flash the TeleMetrum with new
249                           firmware, showing a progress bar.
250
251                         . Confirm that the TeleMetrum board seems to
252                           have updated OK, which you can do by
253                           plugging in to it over USB and using a
254                           terminal program to connect to the board and
255                           issue the 'v' command to check the version,
256                           etc.
257
258                         If something goes wrong, give it another try.
259
260                 ==== Updating TeleMini v1.0 Firmware
261
262                         You'll need a special 'programming cable' to
263                         reprogram the TeleMini v1.0.  You can make your own
264                         using an 8-pin MicroMaTch connector on one end
265                         and a set of four pins on the other.
266
267                         . Take the 2 screws out of the TeleDongle v0.2
268                           or TeleBT v1.0 case to get access to the
269                           circuit board.
270
271                         . Plug the 8-pin end of the programming cable
272                           to the matching connector on the TeleDongle
273                           v0.2 or TeleBT v1.0, and the 4-pins into the
274                           holes in the TeleMini v1.0 circuit board.  Note
275                           that the MicroMaTch connector has an
276                           alignment pin that goes through a hole in
277                           the PC board when you have the cable
278                           oriented correctly, and that pin 1 on the
279                           TeleMini v1.0 board is marked with a square pad
280                           while the other pins have round pads.
281
282                         . Attach a battery to the TeleMini v1.0 board.
283
284                         . Plug the TeleDongle v0.2 or TeleBT v1.0 into
285                           your computer's USB port, and power up the
286                           TeleMini v1.0
287
288                         . Run AltosUI, and select 'Flash Image' from
289                           the File menu.
290
291                         . Pick the TeleDongle v0.2 or TeleBT v1.0
292                           device from the list, identifying it as the
293                           programming device.
294
295                         . Select the image you want put on the
296                           TeleMini v1.0, which should have a name in the
297                           form telemini-v1.0-1.0.0.ihx.  It should be
298                           visible in the default directory, if not you
299                           may have to poke around your system to find
300                           it.
301
302                         . Make sure the configuration parameters are
303                           reasonable looking. If the serial number
304                           and/or RF configuration values aren't right,
305                           you'll need to change them.
306
307                         . Hit the 'OK' button and the software should
308                           proceed to flash the TeleMini v1.0 with new
309                           firmware, showing a progress bar.
310
311                         . Confirm that the TeleMini v1.0 board seems to
312                           have updated OK, which you can do by
313                           configuring it over the radio link through
314                           the TeleDongle, or letting it come up in
315                           “flight” mode and listening for telemetry.
316
317                         If something goes wrong, give it another try.
318
319                 ==== Updating TeleDongle v0.2 Firmware
320
321                 Updating TeleDongle v0.2 firmware is just like
322                 updating TeleMetrum v1.x or TeleMini v1.0 firmware, but you
323                 use either a TeleMetrum v1.x, TeleDongle v0.2 or
324                 TeleBT v1.0 as the programmer.
325
326                 . Find the 'programming cable' that you got as part of
327                   the starter kit, that has a red 8-pin MicroMaTch
328                   connector on one end and a red 4-pin MicroMaTch
329                   connector on the other end.
330
331                 . Find the USB cable that you got as part of the
332                   starter kit, and plug the “mini” end in to the
333                   mating connector on TeleMetrum v1.x, TeleDongle v0.2
334                   or TeleBT v1.0.
335
336                 . Take the 2 screws out of the TeleDongle v0.2 or
337                   TeleBT v1.0 case to get access to the circuit board.
338
339                 . Plug the 8-pin end of the programming cable to the
340                   matching connector on the programmer, and the 4-pin
341                   end to the matching connector on the TeleDongle
342                   v0.2.  Note that each MicroMaTch connector has an
343                   alignment pin that goes through a hole in the PC
344                   board when you have the cable oriented correctly.
345
346                 . Attach a battery to the TeleMetrum v1.x board if
347                   you're using one.
348
349                 . Plug both the programmer and the TeleDongle into
350                   your computer's USB ports, and power up the
351                   programmer.
352
353                 . Run AltosUI, and select 'Flash Image' from the File
354                   menu.
355
356                 . Pick the programmer device from the list,
357                   identifying it as the programming device.
358
359
360                 . Select the image you want put on the TeleDongle
361                   v0.2, which should have a name in the form
362                   teledongle-v0.2-1.0.0.ihx.  It should be visible in
363                   the default directory, if not you may have to poke
364                   around your system to find it.
365
366                 . Make sure the configuration parameters are
367                   reasonable looking. If the serial number and/or RF
368                   configuration values aren't right, you'll need to
369                   change them.  The TeleDongle v0.2 serial number is
370                   on the “bottom” of the circuit board, and can
371                   usually be read through the translucent blue plastic
372                   case without needing to remove the board from the
373                   case.
374
375                 . Hit the 'OK' button and the software should proceed
376                   to flash the TeleDongle v0.2 with new firmware,
377                   showing a progress bar.
378
379                 . Confirm that the TeleDongle v0.2 board seems to have
380                   updated OK, which you can do by plugging in to it
381                   over USB and using a terminal program to connect to
382                   the board and issue the 'v' command to check the
383                   version, etc.  Once you're happy, remove the
384                   programming cable and put the cover back on the
385                   TeleDongle v0.2.
386
387                 If something goes wrong, give it another try.
388
389                 Be careful removing the programming cable from the
390                 locking 8-pin connector on TeleMetrum.  You'll need a
391                 fingernail or perhaps a thin screwdriver or knife
392                 blade to gently pry the locking ears out slightly to
393                 extract the connector.  We used a locking connector on
394                 TeleMetrum to help ensure that the cabling to
395                 companion boards used in a rocket don't ever come
396                 loose accidentally in flight.
397         endif::telemetrum,telemini[]