Hello!
My name is Vlad Ungureanu and this summer I worked for BealgeBoard during Google Summer of Code and developed a way to flash the eMMC or the uSD of a BeagleBone Black using an Android device. All the sources for my project are located at : https://github.com/ungureanuvladvictor/BeagleDroid and I am running a blog where I have described in each week all my problems for the project http://beagleboot.vdev.ro/ . The app works on any Android device that supports USB Host.
There are a few drawbacks about the project:
- the AM335x SoC from the BeagleBone Black advertises USB OTG in it`s descriptor and the Android kernel tries to do HNP *host negotiation protocol* but the AM335x does not know how to do that and it cannot be enumerated properly. This issue can be solved my recompiling the kernel for your device and removing USB OTG support from it.
- the AM335x does over USB RNDIS and in my app I figured out in a really advance stage of the project that I need to code the initialization protocol as well and just decied to activate in the Android kernel support for RNDIS_HOST_DRIVER to get rid of this issue.
Once you have the app on your phone you can flash the eMMC/uSD card, you choose. The app offers you possiblity to download prebuilt images which can be flashed or supply your own image from the internal memory of the Android device. The supported extensions of images are .xz and .zip. In a future release I will implement more supported extensions.
The neat thing is that you can put Android on a BBB and use it to flash another BBB!
In the future I am planning to port all these things to Linux and with the help of libusb achieve the same thingie. A nice idea for production is to chain flash them *flash one board using a PC then that board automatically flashes another one and so on until it finishes the chain*.
Let me speak a bit about the internal of the app:
-when the board is connected to the Android device it first receives MLO over USB
-MLO then receives U-Boot over USB
-U-Boot receives a FIT Image *flatten image tree*. FIT is the same as DTB*syntax wise* it has in it the kernel, ramdisk and the dtb file.
-when the kernel finally booted it brings up an emulated serial port with the help of g_serial and it receives the image
-when the image is on the board *everything stored in the RAM* it flashed based on your choice from the app
eMMC flashing takes like 20 minutes with the sending of image to the board. If we compare this with the eMMC flasher from Koen it is a big improvement. Making an uSD card with the 4 gigs Angstrom it takes like 40~50 minutes with a no name uSD card. Did not test with a good SanDisk uSD card.
The app has been tested on Nexus 7 *old model* and Galaxy Nexus. I will appreciate if more people will take some time to test my work and be back with comments!
In 2 weeks GSoC finishes and until then I will have a full how-to-use guide which I will also post here.
Best,
Vlad Ungureanu *vvu on #beagle*