mavlink/qgroundcontrol — pull request #904 by DonLakeFlyer (2014-10-22 04:25:22+00:00)
Title: New Firmware Upgrade implementation

This is a re-write of the Firmware Upgrade code. The main driver for this was to fix all the problems users have been reporting with Firmware Upgrade. In running the old upgrade code as well as the python upload code from PX4Firmware I've found what seems to be a problem with the bootloader code which causes it to fail intermittently during program. The new code tries to work around this as much as I could figure out, but the problem is still there and will cause intermittent failures just less often hopefully.

Some major differences:
- To start the process you are asked to first unplug the board. Then start upgrade and plug the board in. It does not attempt to reboot the board itself to get to the bootloader. I could not get reboot to work 100% reliably across the different OS. So instead of fighting with it (which I did for days), I changed the process. This leads to much better reliability in connecting to the bootloader.
- Flashing is slower. I had to send fewer bytes across the USB with each program step to get better reliability.
- The code has error checking and error reporting from hell. This should help us debug strange issues that users are seeing much more easily than before. If everything works fine, you shouldn't see anything different. But if something fails, you'll be told exactly what and where.
- The UI matches the wizard UI from RC Calibration. My plan is to carry this style to the rest of the config screens as appropriate.

Some differences:

What I could use some help with:
- I've tested this on both OS X and Windows for more hours than I care to say with a Pixhawk board.
- I could use some help with the other board types since I don't have any of those.
- I could also use help with testing on Linux. I only have Ubuntu in a VM. The virtual device connection in Parallels causes all sorts of strangeness which means my Ubuntu VM won't see the board until after the boot loader has gone by. Hence I can't upgrade.
- I'm also unsure where I can get a Rev 2 bootloader build so I can test that. The verify step for Rev 2 bootloaders is different. I've coded it, but haven't been able to test it.

Here are some screen shots of the new ui:
![screen shot 2014-10-21 at 8 59 48 pm](https://cloud.githubusercontent.com/assets/5876851/4730866/987cdc6e-59a1-11e4-8164-b50c835ce38f.png)

Here is what it looks like when the upgrade is complete:
![screen shot 2014-10-21 at 9 11 51 pm](https://cloud.githubusercontent.com/assets/5876851/4730868/9dc2b478-59a1-11e4-9f7d-2ac2be4c5b7a.png)