Bootloader update

From FlySight
Jump to: navigation, search

To operate the hardware programmer, the first thing you'll want to do is to download and install WinAVR:

http://sourceforge.net/projects/winavr/

Next, let's look at the hardware. I sent a couple of components... One has a USB plug on it. That's the USBasp programmer. You can find more information about the programmer here:

http://www.fischl.de/usbasp/

On the USBasp, there is a small "jumper" which selects between 5 V and 3.3 V. It's right next to the cable connector. Make sure the jumper goes between the middle pin and the 3.3 V pin. This selects the voltage that will be supplied to the board. Since the FlySight works on 3.3 V, it could be damaged if we applied 5 V to it.

You should also have a small adapter board labeled "FlySight Programmer v1.2". You can plug the adapter board into the end of the USBasp's cable.

Once you've got WinAVR installed, you can plug the USBasp into your computer. You'll need to install a driver for the USBasp, which can be found on the USBasp web page under the heading "Drivers".

Next, follow these steps:

  1. Open up the FlySight's case and remove the printed circuit board (PCB).
  2. Remove the sticker on the microSD card and then remove the microSD card itself.
  3. Check that the FlySight is turned off (switch in the outward position).
  4. The FlySight Programmer board has one end that looks like a microSD card. Plug this into the microSD slot with the metal contacts facing toward the FlySight PCB.

Looking at the FlySight PCB, you will see a large module with a white label that says "NEO-something" on it. Holding the board so that you can read the label, to the left of that module you should see a button labeled S2 and below that a black resistor (small rectangular component) labeled R1. R1 is soldered to the board on the left and right sides, which is where it has a metallic colour. The left side of R1 is what I'm going to call RESET.

Let's see if the USBasp will talk to the FlySight. With the FlySight Programmer plugged into the microSD slot, follow these steps:

  1. Go to a command line in Windows. To do this, I usually hit the Start button and then type "cmd" in the search box.
  2. At the command line, type "avrdude". You should see a description of how to use the avrdude utility. Let me know if the system doesn’t find avrdude at all.
  3. At the command line, type "avrdude -c usbasp -p at90usb646", but don't press enter just yet.
  4. On the FlySight Programmer, there is a small pin attached to the end of a short wire. Hold the tip of the pin against the left side of R1 (RESET) while you press enter on the command line. Hold the tip to RESET until the command is complete.

You should get a result like this:

   avrdude: warning: cannot set sck period. please check for usbasp firmware update.
   avrdude: AVR device initialized and ready to accept instructions
   Reading | ################################################## | 100% 0.02s
   avrdude: Device signature = 0x1e9682
   avrdude: safemode: Fuses OK
   avrdude done.  Thank you.

There are a couple of things which could go "wrong" here…

FlySights with serial number 98 through 497 (manufactured in 2010-2011) used the AT90USB1287 chip instead of the AT90USB646. If you're updating one of those units, you'll need to modify the command slightly:

   avrdude -c usbasp -p at90usb1287

You have to hold the pin against the left side of R1 throughout this process. If the pin comes loose momentarily, you might get an error message.

Pretty simple. Now that we know the USBasp can talk to the FlySight, the final thing we want to do is to update the bootloader. Attached to this email you'll find two bootloader files--one for units using the AT90USB646 (bl_usb_64k.a90) and the other for units using the AT90USB1287 (bl_usb_128k.a90). Copy these to a place you can easily access them from the command line. The desktop is pretty easy, so I'll use that. Then go to the command line window again and do the following:

Change to the desktop folder. On my system, I do that with cd Desktop. I'm not sure if there will be a language difference on that one. At the command line, type avrdude -c usbasp -p at90usb646 -U flash:w:bl_usb_64k.a90, but don't press enter. If you're working with the AT90USB1287, you'll want to use avrdude -c usbasp -p at90usb1287 -U flash:w:bl_usb_128k.a90 instead. Hold the tip of the FlySight Programmer's pin to the left side of R1 (RESET) while you press enter on the command line. Hold the tip to RESET until the command is complete.

The output should look like this:

   avrdude: warning: cannot set sck period. please check for usbasp firmware update.
   avrdude: AVR device initialized and ready to accept instructions
   
   Reading | ################################################## | 100% 0.03s
   
   avrdude: Device signature = 0x1e9682 (probably usb647)
   avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
   		 To disable this feature, specify the -D option.
   avrdude: erasing chip
   avrdude: warning: cannot set sck period. please check for usbasp firmware update.
   avrdude: reading input file "bl_usb_64k.a90"
   avrdude: input file bl_usb_64k.a90 auto detected as Intel Hex
   avrdude: writing flash (65536 bytes):
   
   Writing | ################################################## | 100% 0.29s
   
   avrdude: 65536 bytes of flash written
   avrdude: verifying flash memory against bl_usb_64k.a90:
   avrdude: load data flash data from input file bl_usb_64k.a90:
   avrdude: input file bl_usb_64k.a90 auto detected as Intel Hex
   avrdude: input file bl_usb_64k.a90 contains 65536 bytes
   avrdude: reading on-chip flash data:
   
   Reading | ################################################## | 100% 0.28s
   
   avrdude: verifying ...
   avrdude: 65536 bytes of flash verified
   
   avrdude: safemode: Fuses OK (E:F3, H:9B, L:5E)
   
   avrdude done.  Thank you.

If you've gotten this far, then the bootloader on your FlySight is updated. The firmware has been erased in the process, but you can now update the firmware on a Windows 8 machine using the steps here:

http://flysight.ca/wiki/index.php/New_firmware_update_(Windows)

You should only have to update the bootloader once to make your FlySight Windows 8 compatible. For future firmware updates, you can simply follow the usual instructions.