Meego Wiki
Views

ARM/Meego on Beagleboard from scratch

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(News)
Line 11: Line 11:
= News =
= News =
-
* The set of supported UX now includes the tablet UX (See e.g. [[#Screenshots]]).
+
* The set of supported UX now includes the tablet UX (See, for example, [[#Screenshots]]).
* We now provide ready-to-run SD card images [http://bug10738.openaos.org/images/beagleboard/ here]
* We now provide ready-to-run SD card images [http://bug10738.openaos.org/images/beagleboard/ here]

Revision as of 22:32, 21 June 2011

May 31st 2011: The instructions on this page don't work anymore!

These instructions require the integration of closed third party code into MeeGo to enable the video acceleration required for a decent MeeGo user experience. Recently, MeeGo for the arm CPU (MeeGo/ARM) has switched to hardware floating point support (hardfp/armv7hl). This needs to be explicitly supported by all code supposed to be used on MeeGo/ARM. The previous software floating point based setup (armv7l) is not officially supported by MeeGo anymore.

Unfortunately, all closed source drivers incl. the SGX video acceleration drivers provided by TI for the beagle board are not available with hardfp/armv7hl support. This fact breaks the beagle board setup presented here and probably also all other arm based meego ports. Currently, the only exception is the n900, which is supported by nokia with matching closed source drivers.


This document describes how to create a MeeGo image for the beagleboard. More information regarding MeeGo on the Beagleboard can be found at ARM/Meego_on_the_Beagle.

Contents

News

  • The set of supported UX now includes the tablet UX (See, for example, #Screenshots).
  • We now provide ready-to-run SD card images here

(For details read #Prepared_images).

Introduction

[Youtube video of BeagleBoard running MeeGo handset UX]

Tested distros

Creating this image has been tested on Ubuntu 10.10, other distros may require some things to be done differently. Several people have tried and failed to make this work on Ubuntu 9.04 and Ubuntu 9.10. Ubuntu 10.04 requires some tweaks when installing the cross compilers. It is recommended to use Ubuntu 10.10, if you want the best chance of success. Conversely, if you have made this work for other versions of Ubuntu or other distros, please add to this page any information that will help others achieve the same success.

  • Debian Lenny (you'll need to install some packages from Sid and you'll need to build some software.)

This is a work in progress. However, if you think these instructions are incomplete or lack some important aspect, feel free to edit this page or ask for help on IRC in #meego-arm on irc.freenode.net.

What works, what remains to be done

Please keep in mind that MeeGo is a work in progress. Things which already worked may be broken again and you might not end up with a working setup even though you followed the instructions precisely. Everything up to the running TI demos will likely be stable, but the MeeGo UI itself is still broken every now and then.

Working:

  • Same features as MeeGo on n900
  • MeeGo UX with touchscreen and 800x480 video
  • 2D/3D video acceleration
  • Audio
  • Various USB add-ons incl. ethernet, mass-storage and bluetooth
  • Setup toolchain known working on Ubuntu 10.04/10.10
  • Support for handset, IVI and tablet UX

Todo:

  • Make mouse cursor visible under handset and tablet UX for users without touchscreen
  • Definitive works / does not work on other distros and other versions

Known issues:

  • Bug #5616
  • Bug #14480
  • All known n900 problems probably still apply (unless they are related to the n900 specific kernel/video drivers)

Supported BeagleBoard versions

The RevA and RevB boards have only 128MB RAM. This is not enough for the handset distribution of MeeGo. With swap enabled the UX boots, but is barely usable. Tested board revisions: B7

The RevC boards are the best choice at this moment as their hardware is fully supported by the Linux kernel and since their 256MB RAM allow for a more fluid UX experience. Tested board revisions: C3, C4

The XM RevA boots into handset UX and is very fast and responsive. The stock kernel doesn't yet fully support this board (CPU only runs at 800Mhz) and most important, the USB hub doesn't work under the MeeGo kernel. Tested board revisions: XM-A2

The only board currently fully supported is the BeagleBoard RevC!

Prepared images

Ready-to-run SD card images can be found on bug10738. These images can be copied directly onto a 2GB SD card:

dd if=<image name> of=/dev/<sd card device> bs=64k

It is possible that your SD card is slighty smaller than these images. In this case you can e.g. use fdisk to adjust the size of the 512MB swap partition on the card and afterwards use mkswap to reformat that partition.

The root password for this image is "meego" as usual.

Prerequisites

This document assumes that you have worked with the beagleboard before and it may be helpful if you e.g. know how to format a memory card to boot from.

If you are new to BeagleBoard you might want to learn the basics using the following resources:

The following instructions assume that your beagleboard boots from sd card. Xloader and uboot versions stored in beagleboard internal nand memory might prevent the following setup from working properly. If a bootloader is installed, you'll usually get its command prompt on the serial console when booting without sd card inserted. Entering

nand erase

there will erase the entire nand memory and reset the beagleboard into the state expected in the following instructions. Warning: Other beagleboard sd cards you might be using may rely on certain parts being store in nand and might not work anymore afterwards.

Please use a memory card of at least 2GB size for the following experiments. Otherwise the generated image may not fit onto the card.

Building MeeGo for the BeagleBoard

The beagleboard sd card image generation consists of three major steps:

  • Build of kernel and kernel modules
  • Assembly of root file system
  • Installation of bootloader, kernel and root file system on sd card

Shell scripts have been created to automate all of these steps as much as possible. You can get all necessary files here. These steps will require about 4GB of additional free disk space.

  • build_kernel.sh build the kernel and the modules,
  • build_image.sh assembles the root file system, and
  • setup_sdcard.sh creates an sd card from these

Build of kernel and kernel modules

To build the kernel and its modules, you'll need to cross compile for the ARM platform. The most convenient option under Ubuntu is to install the arm cross compiler that comes with ubuntu:

sudo apt-get install gcc-4.5-arm-linux-gnueabi

The kernel used in this project is not the MeeGo kernel (which doesn't include any beagleboard specific patches) but a port of the ubuntu kernel which is being maintained expecially for the beagleboard and related boards.

You can get the build scripts from https://launchpad.net/~beagleboard-kernel. Follow the instructions there to build a Ubuntu kernel. There are only two MeeGo specific things:

  • Set the CPUFreq governor to "userspace"
  • Add support for a 800x480 video mode

The CPUFreq governor can be adjusted in the kernel config dialog that will automatically open when you run the build_kernel.sh script from the 2.6.38-devel package. You need to set

CPU Power Management --> Default CPUFreq governor (ondemand)  ---> userspace

The 2.6.38-devel package allows for local patch directory which can be specified in the system.sh file. Just place the 800x480.patch there and it will automatically be included into the resulting kernel.

You should end up with a uImage and modules tarball in 2.6.28-devel/deploy.

Setup for Ubuntu 10.04 LTS Lucid Lynx

The gnueabi cross compiler is not available by default on the Lucid Lynx distribution. But you can get access to it using either the natty or maverick universe repositories (just be careful to disable them when you are done getting what you need).

Add the following line to your /etc/apt/sources.list. Or use the Synaptic package manager (sudo synaptic, Settings->Repositories, Other Software->Add). You may choose your own mirror if xmission is slow or doesn't work for you.

deb http://mirrors.xmission.com/ubuntu/ maverick main universe >> /etc/apt/sources.list

Do an update (hit Reload in synaptic or sudo apt-get update) and then install the gnueabi cross compiler + a few other programs that might be missing:

sudo apt-get install gcc-4.5-arm-linux-gnueabi rpm2cpio uboot-mkimage

Assembly of the root file system

The root file system (rootfs) is assembled from binary packages available in the MeeGo ARM repositories. The tool used to assemble the rootfs is called mic (MeeGo image creator). You need at least mic version 0.24.6 and you might have to grab the latest version from git following the instructions at Image_Creation#From_Development_Git_Tree.

When using ubuntu 10.04/10.10 you'll need to install qemu using the qemu-kvm-extras-static package. If you have an existing scratchbox setup, this will collide with qemu-kvm-extras-static. After installing that package scratchbox arm will not work anymore. Removing that package and restarting the scratchbox services makes scratchbox work again.

The rootfs image creation itself is started using the build_image.sh script the following way:

sudo ./build_image.sh

This will download all packages required to build the root file system from the internet into the ./mycachedir directory and assemble the root file system image.

If you need to save hard disk space you can remove the ../mycachedir directory once the image has successfully been built.

If you want to build an ivi or tablet images instead use

sudo TYPE=ivi ./build_image.sh

or

sudo TYPE=tablet ./build_image.sh

Installation on sd card

The last step is to put the kernel and the rootfs onto an sd card together with an xloader and uboot boot loader as required to boot the beagleboard. This is accomplished by invoking the setup_sdcard.sh shell script. This script has to be given the device name of the sd card you are intending to use. On my system the sd card is /dev/sdd, so i have to invoke the script as follows:

./setup_sdcard.sh --mmc /dev/sdd

The script will as you to acknowledge this. Please watch the output carefully. Specifying e.g. your systems hard drive will wipe your entire hard disk instead of the sd card.

This will take some time as the sd card is reformatted, all bootloaders are installed, file systems are created and the kernel and the contents of the root file system are copied onto the sd card.

Again, if you intend to use the IVI or tablet image use a slightly modified command:

TYPE=ivi ./setup_sdcard.sh --mmc /dev/sdd

or

TYPE=tablet ./setup_sdcard.sh --mmc /dev/sdd

Boot

Plug the resulting SD card into your beagleboard and power on. After a few seconds the video will switch to 800x480 pixels and the MeeGo handset UX should appear on the screen. The first boot will always take several minutes as some media files are copied forth and back on the card.

Meego beagle.jpg

Peripheral hardware

I have tested various peripheral devices on this setup and most of them are working out of the box.

USB hubs, mice and keyboards

These just work, nothing to configure.

Bluetooth keyboard

A CSR bluetooth dongle works out of the box. Hcitool is present to scan for devices as well as hidd to connect to bluetooth HID devices. This has been tested with a bluetooth keyboard.

Touchscreen

A 7 inch egalax based touchscreen worked nearly perfectly out of the box. It was just a little bit mis-calibrated.

The latest hal driven xorg can be given a input configuration file to deal with this.An example setup is already included at /etc/X11/xorg.conf.d/50-input-touch.conf. If you don't have a touchscreen this file is ignored.

This configuration is automatically applied to all touchscreen devices that map to /dev/input/event*. You may have to adjust the calibration values in that file to match your device.

Ethernet

A D-Link DUB-E100 ethernet dongle works out of the box and gets an IP address via DHCP. With this network connection i was able to verify that zypper and the package management also work. A "zypper up" successfully updated a few packages.

The beagleboard XM's onboard Ethernet (a SMSC95xx based USB device) also works.

WLAN

A Ralink RT2501 based USB dongle works, is detected and can scan for networks. But it isn't provided an address via dhcp.

Audio

Audio works out of the box. Appropriate configuration files for the beagleboard have been included.

Troubleshooting/hints

Starting X programs from the serial console

If you have a keyboard and mouse you can skip this section. If you don't have a keyboard connected and want to run X programs from the console, you need to set the DISPLAY environment variable. Also it's required to change to the meego user before doing so:

[root@localhost ~]# su meego
[meego@localhost root]$ export DISPLAY=:0
[meego@localhost root]$ xeyes

Making screenshots

Do you like what you see? Want to share it? Make a screenshot! This doesn't need any special software. Just copy the framebuffer contents into some file:

cp /dev/fb0 screenshot.raw

The resulting file should have a size of exactly 770048 bytes (800x480x2) if you are using a 800x480 display size at 16 bits per pixel.

On your host use ffmpeg to convert this into some standard format like png:

ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 800x480 -i screenshot.raw -f image2 -vcodec png screenshot.png

Beagle-Main.jpg

Screenshot of an early handset UX on beagle (jul 2010)

Beagle-Ivi.png

Screenshot of IVI UX on beagle (nov 2010)

Beagle-Tablet.png

Screenshot of tablet UX on beagle (apr 2011)

Related links

Personal tools