Friday, April 15, 2011

Deconstructing the AR.drone: Part 6

The other day the Free Flight app on my iPad told me that there was a new firmware release available for my AR.drone. I figured there was no better time to try loading new firmware using the diagnostic port on the bottom of the device.

AR.drone Bottom Close-Up

Here is the bottom of my drone with the rubber plug with the USB symbol on it removed. You can see the port just to the lower left of center, and you can see the missing indexing pin of the eight-pin header in the upper left of the port.

Here's what I needed:


Molex Eight-Pin to USB

Here's the cable I fabricated, with the eight-pin Molex connector on the left and the Type A USB connector on the right. You can see the blocked socket that will match the missing indexing pin on the port when the cable is inserted in the correct orientation.

ARDrone-USB-Cable.png

Here's the diagram of the cable that was provided by Parrot.

I unloaded all of the AR.drone tool zip files into separate directories on my Windows laptop so that the README files wouldn't overwrite one another, but consolidated all of the sub-directories, dynamic link libraries, and executables, plus the ardrone_usb_bootloader.zip file, into a single directory. There was a drivers sub-directory with the P6_USB_Stage1 device driver.

I used the plf_inst_extract tool to extract the ardrone_installer.plf file from the ardrone_update.plf file. The README file that comes with the usb_flash tool says to use a command like this

plf_inst_extract -i ardrone_update.plf -o ardrone_installer.plf

but as usual I am incapable of following simple instructions. Here's a screen shot.

Running plf_inst_extract Against ardrone_update.plf

I omitted the -o ardrone_installer.plf option. The plf_inst_extract tool uses the name extract_installer.plf by default, but the usb_flash tool expects it to be named ardrone_installer.plf. So I renamed it. Here's what was in the directory after doing that.

After Running plf_inst_extract against ardrone_update.plf
The order of these next steps is important. I connected my laptop to the unpowered drone using the cable that I had made. The diagnostic LED on the bottom of the drone lit up as a portion of the digital logic in the drone was powered from the USB cable itself. Then I connected the drone to its battery. The USB interface in the drone enumerated on my laptop. I went through the Windows device driver installation dialog to point it to the drivers subdirectory of the AR.drone tools. Windows installed the P6_USB_Stage1 driver. Here's a screen snapshot of the Windows Device Manager following that process.

Device Manager After Powering Up USB-attached AR.drone

I ran the usb_flash tool without any arguments at all. The first time it failed to establish contact with the drone, probably because I botched the order of something, but it worked fine the second time. Here's the successful run split into two screen snapshots.

Running usb_flash Part 1 of 2

Running usb_flash Part 2 of 2

I disconnected everything, cycled power on the AR.drone, connected my iPad to it, and the Free Flight app reported that the drone was running the new version of firmware.

This is a great example of how this kind of hacking depends upon the kindness of strangers. From the wiring diagram provided by the AR.drone's manufacturer Parrot, to the software tools developed and provided by skorpion2k, to the boot loader binary provided by MAPGPS, it is a combined effort of an avid community of AR.drone enthusiasts.

4 comments:

ICEMAN said...

Outstanding, any difference in the way it flys? Response time, etc?

Anonymous said...

I recently had to replace my Drone's motherboard. Funny enough, the "new" mobo came with a pre-stone-age version of firmware. So the drone is giving me a "PIC version emergency" error, presumably because the NAV board has younger firmware than the mobo. The mobo firmware also does not respond to any conventional upgrade procedures (e.g. not even listening to port 5551). So it seems USB flashing is my only option! Thanks for the guide.

RensD Drone said...

Might be a strange question, but if I wanted the most simple way with as less components as possible to just use the video signal, wich PCB's would I need?

RensD Drone said...

Might be a strange question, but if I wanted the most simple way with as less components as possible to just use the video signal, wich PCB's would I need?