Tuesday, October 26, 2010

Working with Android on development boards

This will be the first of a set of post on a project we are doing where we will use an Android powered dev board to provide UI and user control features for an embedded system. I will get back to the setup in later posts but in brief it will consist of two boards, one running a traditional control system and one running a slightly adapted Android platform with extra API:s to interact with the control system. This part focuses on working with Android on dev boards in general and discusses a couple of boards in particular.


For platform level hacking the open source project provides a good start with the emulator and that is useful for things like working with the base applications and examining the framework. The emulator is however limited and for a lot of platform level work real hardware is the best way to go. For real hardware there are two routes, either use an existing phone or use some kind of development board. Existing phones are fun platforms for tinkering and enabling features in the way they to it at xda-developers and other forums. As a general lab environment they are limited since they often have very few hardware interfaces exposed and they are often locked down in ways that make interacting with them difficult.


Development boards on the other hand are often made especially for trying out new designs, connecting hardware and having easy debug access. These are often the best platform for working with low level stuff on Android. In fact most phone manufacturers start out with some kind of platform dev board to facilitate early development before they wrap everything in great looking metal and plastic.

So let us look at working with Android on embedded development boards. First you should decide on why you want to go this route. Dev boards are excellent for:

  • Low level work on the Android open source project, testing and debugging hardware interaction etc.
  • Hobby projects where you want to design a great Android based interface for your home-made toaster and need to hook up the android system to some outside electronics.
  • Professional projects where you are considering building an Android based product, be it a phone, a tablet, music player etc.
  • Anyone else who wants to explore the full capabilities of Android and understand the platform without the limitations of the emulator or set hardware design of a phone.

Dev boards are probably not the way to go for:

  • Getting a basic understanding of how to build and run the Android source code. The open source project and the emulator are more than sufficient for that.
  • Application development work. The SDK and existing phones are perfect for that and saves you a lot of hassle with jumpers, adb bridging and so on.


Factors to consider

Now let us say that you are still interested in working with Android on a development board. Then we get to the interesting part on deciding on which one to get. Here I would say there are a few important factors to consider:

  • Purpose - what to you plan to do with the board
  • Price
  • Performance
  • Existing Android ports for the board
  • Community
  • Debugging utilities
  • Expansion possibilities

All of these are important but do not underestimate the power of having an active community around your platform that can help you out if you run into problems. Start by looking at the above factors and note down your requirements in each aspect. And do not forget to take into account other things that I have left out in this bullet list. Once you have some idea of what you need we can start looking at what is available. And that is becoming quite a lot.


Let me start by grouping the different boards into a few categories. And here I will add in a limitation. I will mostly consider ARM-based dev boards since this is the architecture with the widest Android adoption so far and almost all commercial devices shipped so far are based on ARM. That said there is a very active community around Android on x86 and also MIPS ports. And probably a few more. The most prominent feature of any dev board is the applications processor and system on chip design that will run the actual Android system. Based on that I will use the following categories for ARM based designs:
  • State of the art - these are dev boards with high performance system on chips that are often prototypes of platforms that are not even available in commercial products yet.
  • High end, these are dev boards with an applications processor that matches the high end Android phones that are available today.
  • Mid and low end - these are either boards with performance that matches early or low end Android phones.

State of the art development boards

These platforms are based  on dual-core Arm Cortex A9, 1 GHz plus, system on chips with graphics acceleration and other features. In this category I am only aware of a couple of platforms that can be obtained as development boards for general purposes. Two are based on the TI Omap 4 system on chip and can be ordered either as the cheap panda board or as the more full featured Blaze kit which include touch screens and keyboard. If you are based in North America it is also possible to get the Tegra 250 dev kit from Nvidia with similar specs. These boards are interesting since they have more processing power available than anything else on the market but they are also fairly new designs with limited community track record. They may be perfect for experienced embedded hobbyists that want to build a HTPC setup or similar. If you have very little experience working with embedded development it may be better to start out with something with a longer track record and more information available on forums, blogs and wikis. For professionals you need to consider if you really need this kind of processing power in your design. Maybe advanced 3D graphics and full HD video is not part of your use case and then maybe these types of platforms will eat more power and cause more issues with advanced features than they provide benefits.


High end development boards.

These are ARM Cortex A8 based designs similar to what is powering most of the high end Android smarthphones that are available today. In this category we have a number of SoC and a large amount of development boards based on these SoCs. To mention a few of the families we have the Freescale i.Mx 515, evolution dev kit and android tool and the Texas Instruments OMAP3, most notable the Beagle board and the Zoom II dev kit. Since these run on the same CPU family (ARM Cortex A8) as most of the commercially available Android phones do and have been around for a while they are often well tested and relatively stable. This is especially true of the Omap based Beagle board which features a large developer community. The Omap on the Beagle board is also very similar to the Omap that powers the popular Motorola Droid phone. There are a number of derivatives from the Beagle with more peripherals and expansion possibilities.


Mid and low end development boards.

This is a more unexplored area but with some interesting products. Android this far has been a lot about performance and most community boards have been higher end boards but as interest for using Android outside the smartphone space is increasing so is the number of low cost platforms with support for the system. These boards are generally based on ARM926 or ARM11 CPUs and have a limited set of accellerators and peripherals. Many dev boards in this category have too little memory to run Android (128 MB RAM is some kind of current minimum but more is even better). There are some Samsung boards, something from Renesas and once again probably a lot of others. The board that we have worked with in this category is from Atmel, the AT91SAM9M10-EKES borad. While their Android community is relatively young compared to the Beagle board Atmel has a tradition of having a thriving community around their at91 platforms in general.


Some practical details

Now that we are finally past the overview we can get to the practical details on working with development boards. If you are considering to get a develoment board for Android I would suggest that you try to download and build whatever Android distribution is availble for that board before you get the hardware. The state of the distribution will tell you a lot about how hard it will be to get the hardware working later on. If there is no Android distribution available for your hardware make sure that you are aware what the porting effort will be and also analyze that the hardware will even be capable of running Android in terms of performance and memory available.

Another thing to investigate is how you will boot and run Android on the dev board. Does it contain a NAND flash or SD card interface. Is it possible to set up a network file system and boot Android from that? Having working adb tools are also very nice when working on a dev board. It is much more convenient to update just your shared library through an adb sync instead of having to build, generate a system image and flash it to the board every time you need to test an update.
Regardless of what board you choose prepare to spend some time understanding how to boot it up with your Android build. Often they are delivered with some other software as default configuration. Prepare to spend a few hours up to a few days just to get familiar with boot and flash options. How to set the jumpers in the correct state to be able reflash the board etc.


Our experience

These are some impressions for three of the different boards that we have worked with so far.

Beagle board:
BeagleBoard in action
Pros:
  • Very powerful board for the price tag.
  • Good community around Android and the Rowboat distribution on TI Omap
  • Well tested CPU for Android, very similar to the SoC powering the Motorola Droid and other devices
  • A lot of other Linux work happening on the Omap platform such as MeeGo
  • Decent debug support
  • Relatively easy to get started with and several boot options
Cons:
  • No ethernet support in default configuration, has to be added via USB.
  • No touch screen or other peripherals included, not even power adapter
Summary:
The Beagle board is a very powerful board for the price ($149) and if you connect to a regular monitor and keyboard it is a very capable development platform for low level work. We have run a number of projects on this platform ranging from initial demos and driver projects to advanced research stuff. The limitations made to keep the price down are a bit annoying and nowadays I would recommend getting the updated BeagleBoard xM version instead. That will add an ethernet port and more USB ports. There are also versions and derivatives that include screens etc.

Zoom II:
This is another OMAP based device but includes and the SoC is very similar to the BeagleBoard but it is packaged more like a real device with touch screen and keyboard.
Pros:
  • Much more peripherals included compared to the Beagle
  • Portable device like package, good for demos
Cons:
  • More expensive than the Beagle
Summary:
This device is very similar to the Beagle board and shares the same attributes beyond the two things mentioned here.

Atmel AT91SAM9M10-EKES:
An Atmel boad with Android up and running
Pros:
  • Includes touch screen directly on the board
  • Connection cables and power supply included
  • Good community around the at91 boards in general, emerging Android community
  • Based on relatively small and low cost ARM926 CPU
  • Good value for money for a relatively complete kit
Cons:
  • Dev tools seem a bit Windows focused, it was a little bit tricky to get started from a Linux dev machine
  • Android support is relatively new for this platform, not as well tested as the Omap distributions
Summary:
I think this is a really interesting dev kit. Especially when looking at developing things that do not have the high-end smartphone level of performance requirements. Since it includes a screen and decent amount of connections it can be used as a compact demo board. We got this relatively recently and will probably base our next demo on it. After some initial hickups with the tools it is straight forward to develop on and the support from Atmel and the community seems to be growing rapidly. We still need to do some benchmarking though and see how it handles Android compared to higher end alternatives.


I hope this article provides some insight on working with Android on development boards. With the amount of Android related news currently I am sure I have missed some capable platforms. Feel free to add whatever platform you are familiar with in the comments and I will update this post with more info. Once again I would like to remind you that I have skipped entire architectures such as x86, MIPS and PowerPC in this article.

/Mattias

12 comments:

  1. Hi,

    nice description.
    My question is a little off-topic. I am investigating ways on running the android system on a kernel other than the linux variants. Specifically, the Minix microkernel. Do you have experience with android porting to different kernels? If so, it would be good to talk about it so that I have some reference point.

    Cheers,
    Earlence

    ReplyDelete
  2. Hi Earlance,
    We have looked a little bit into Android porting to different kernels/OSs. While it seems relatively straightforward to create a minimal port of the Dalvik VM there are a lot more to Android that makes lifting it to a different kernel a significant challenge. A lot of the framework and Android runtime is implemented in native code using external open source libraries such as WebKit, SQLite etc. These libraries would also have to be ported together with the Android specific c-runtime (the bionic c-lib) and a lot of other things.
    When I last took a look at this (about a year ago) there was only minimal ports available, i.e. a Dalvik VM running a small proof of concept program. There may have been some more work since then but in general porting the entire Android platform including the framework to a new kernel is a major undertaking. You would probably end up having to severely restrict the API:s available on such a port and then it would not be very Android compliant anyway.

    /Mattias B

    ReplyDelete
  3. A lot of the framework and Android runtime is implemented in native code using external open source libraries such as WebKit, SQLite etc. These libraries would also have to be ported together with the Android specific c-runtime (the bionic c-lib) and a lot of other thing
    Android

    ReplyDelete
  4. Dear Sir
    Your article is very useful to me,I am searching Android for Embedded Application.
    Reacently I purchased COREWIND Tyni6410 dev kit based on samsung S3C6410 (ARM11) processor with 4.3" TFT LCD/TOUCH,4 COM PORT , LAN ,USB HOST AND DEVICE,256 DDR RAM,2GB FLASH,INTERFACE FOR CAMERA,WIFI,IR SENSOR,TEMP SENSOR ETC.
    Software images provided for Android 2.3,Linux,WinCE and Ubuntu.I tested everithing ok but there is no online materials for the software development.
    Booting with SD ,Nand and USB provided.
    adb debug facility also working and my test applications loaded working ok.
    Actually I am working with Embedded System witout OS. PIC,ARM7 (LPC2148) are presently using.I don't know howmuch I can do with Android.I want good UI for my Embedded application and high end features like LAN,Bluetooth,USB,WiFi For achieving these target only I planed to learn Android,Now I think it is not so easy to interface Hardwares with Android.How can I approch for Low level embedded application?.Thanks for your article.

    ReplyDelete
  5. Android is best suitable for adding it in an embedded system as its close to hardware and it gives best option to make use of hardware and hope so there will be much more developers in future will make use of.

    ReplyDelete
  6. Hey there,
    thanks a lot for your insight! I was just wondering: which of these boards have ARM TrustZone enabled?

    With warm regards,
    JJ

    ReplyDelete
  7. Hi JJ,
    ARM TrustZone is generally a part of the HW security block and I do not think it is included on any of these dev boards. The reason for that is that dev boards and engineering devices ship with a general purpose device instead of a high security one. This is to avoid a lot of security issues when developing, such as accidentally locking down the device. Another reason is that the security technology is often surrounded by a lot of patents and proprietary solutions making harder to obtain without a lot of paperwork.

    ReplyDelete
  8. Are you aware of ARM development boards that have, or can be set up with, a UEFI boot capability?
    (Needed for Windows 8 on ARM ...)

    ReplyDelete
  9. Useful primer. Is there an update (2012 version) for the development boards?

    ReplyDelete
  10. @Arun, I have no big update for 2012 but a few things to consider. Primarily that Ice Cream Sandwich is resource heavy compared to Android 2.x so if you want to go with that choose a high end board (dual core, > 512 MB RAM). Basically that means the platforms that are mentioned as state of the art development boards here are the best suited for Android development now. The Beagle Board evolutions, xM and Beagle Bone also have releases for ICS and can probably run it to a decent level.
    In terms of new releases there should be boards based on Arm Cortex A9 quad core such as the Tegra 3 available soon, and TI are working hard on their OMAP5 though. With the Android x86 project being very healthy as well any x86 based board could also be an option.

    ReplyDelete
  11. Do you know developer boards on MIPS architecture? I try to find but I didn't.

    ReplyDelete
  12. Hi there,
    I'm new embedded system designer and know very little about android embedded development boards/kits, this article was very informative to me. The task given to me is to search for a suitable android development kit which mainly focuses on enabling usb host capability in earlier versions of android. For that, after finalizing the hardware requirements i am required to test the capability for all android versions before honeycomb. My questions are:

    Can you point me a development kit that has the capability of running multiple android versions?

    Drivers or any other customization performed on ABC kit will also work for any XYZ smartphone or tablet? or there is something more to the story that i am missing out?
    Regards
    I am Nisar

    ReplyDelete