OMAP Angstrom

From OMAPpedia

Jump to: navigation, search

Contents

[edit] Overview

Ångström is versatile & scalable linux distribution and is based on OpenEmbedded.

Ångström is part of the Openembedded framework and is available as a selected distro version when building the complete file system. Currently Zoom2 machine config is available in Ångström's unstable environment. Refer to www.cgit.openembedded.org to review current repository.


References on OE, Angstrom, Bitbake etc can be found in Technical References page

[edit] Building Angstrom using Openembedded

Angstrom follows the same procedure as Openembedded. The only difference is selecting Angstrom as the distro and selecting omapzoom2 as machine. Both of these variables can be set within the "local.conf".

For more information regarding building instructions refer to www.openembedded.org


[edit] Openembedded Ubuntu system requirements

sudo apt-get install help2man gawk texi2html texinfo build-essential unzip diffstat subversion texinfo cvs chrpath


Ubuntu requires /bin/sh to point to /bin/bash rather than /bin/dash. Run the command below and select "No" from the menu.

sudo dpkg-reconfigure dash

Note: Around 35GB of hard disk space is required to build complete OE


[edit] Troubleshooting Openembedded compilation

***** DO NOT run OE as root/sudoer user *****

While compiling Openembedded you might run into following issues;

1. import types, sets ERROR: no files to build. ERROR: Nothing PROVIDES 'nano'.

The BBFILES in local.conf or env BBPATH might be set wrong.

BBFILES = "/stuff/openembedded/recipes/*/*.bb"

BBPATH = /stuff/build:/stuff/openembedded

2. /proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).

sudo -i
echo 0 >/proc/sys/vm/mmap_min_addr

3. Using dash as /bin/sh causes various subtle build problems, please use bash instead.

sudo dpkg-reconfigure bash

or

sudo apt-get remove dash

[edit] Build Angstrom using narcissus

You can build Angstrom for Zoom2 in minutes using the Online Image Builder available at http://www.angstrom-distribution.org/narcissus/

Note: It is recommended to build Angstrom for omapzoom2 platform through Openembedded framework.


Select the following items:

[edit] Building kernel, uboot, and xloader

Note: CONFIG_NEON has to be enabled in the Zoom2 config at the kernel for Angstrom to work

[edit] Zoom2 as Netbook/Desktop

For an user experience of the full blown Zoom2 platform with USB keyboard and mouse with HDMI, please view this Video playing an MPEG4 clip in the TV using GNOME media player from Angstrom.


[edit] USB Keyboard and Mouse

USB Keyboard and Mouse can be enabled on Angstrom by adding these features in the Zoom2 kernel config. Zoom2 has USB OTG support and the USB keyboard and mouse are used on gadget Zero (g_zero). There are connected to Zoom2 through a self powered USB hub connected to the USB OTG port.

This has been tested on the LO kernel from the TI sync tree.

To enable these features, please follow these intructions.



[edit] HDMI on Angstrom

Zoom2 provides a Netbook/Desktop like experience with HDMI enabled on it. This helps explore the capabilities of the Angstrom filesytem on a bigger display.

HDMI is enabled in the kernel and the display can be switched between LCD and HDMI. Intructions to enable and use HDMI are here.

This has been validated on the LO kernel from TI sync tree.

There is one limitation on this implementation that the display is not full screen in the TV while switching from LCD. This is being discussed with the Zoom2 and Angstrom communities for a fix. This is work in progress...


[edit] Graphics SDK

TI's Mobile Game Developer portal provides access to OMAP Graphics SDK's. The Graphics SDK typically have pre-built binaries for various platforms and example applications for software developers to utilize the OpenGLES 1.x, 2.x & OpenVG API's. Opensourced kernel drivers may be included in the package. There are several OMAP3430 SDK's supporting OMAP Zoom, Zoom2 & SDP platforms.

There are currently several ways how to get accelerated graphics working:

[edit] Obtaining the Graphics SDK from TI

     $ chmod +x OMAP34xx_GFX_SDK_K2.6.27_Zoom2-1.4.14.2514.bin
     $ ./OMAP34xx_GFX_SDK_K2.6.27_Zoom2-1.4.14.2514.bin

Read the license terms and accept them to install the graphics SDK on to your system. After successful installation you will get a directory with name OMAP34xx_GFX_SDK_Zoom2 in a given path. Refer the Readme.txt file in this package for using the package.

[edit] Using the binaries from the SDK

Once a filesystem is ready, either by building it from Openembedded or from downloading using narcissus, make the following changes to the environment:

      $ cd ../OMAP34xx_GFX_SDK_Zoom2
      $ export DISCIMAGE=<path/to/target/filesystem>
       $ ./build_SDK.sh --install libs
       $ ./build_SDK.sh --install demo
       $ ./build_SDK.sh --install course

All Demos and Courses will be copied to target file system's "/usr/local/bin"


Note: If filesystem was created using the narcissus progam, libstdc++.so.6 will be missing within the "/lib" directory of the target filesystem. This *.so file is needed to run some of the demos provided withing the SDK package. Some but not all demos will work unless this in included in the target filesystem.

To include this a full build must be done. Once a full build is completed using openembedded, perform the following:

      $ cd <path_to_openembedded_source>/tmp/cross/armv7a/arm-angstrom-linux gnueabi/lib/
      $ cp libstdc++.so.6 /home/<user_name>/<path_to_target_filesystem>/lib

Alternatively, if your target device has internet connectivity and there is an angstrom feed for it (as is the case with Zoom2), just issue:

      $ opkg install libstdc++6

(you might need "opkg update" prior to this)

[edit] Booting and running apps

       # /etc/init.d/rc.pvr start

Note: You might have to do a "depmod -a" after the first boot to generate module dependencies, so that the kernel module is loaded correctly by rc.pvr.

       # cd /usr/local/bin
       # ./gles2test1 1000
   By this command you should be able to see the two rotating triangle on the LCD screen.
       # cd /usr/local/bin/Demos
       # ./OGLESChameleonMan -quitafterframe=1000

Runs application for 1000 frames

       # cd /usr/local/bin/Course
       # ./OGLES2AlphaTest -quitaftertime=10

Runs application for 10 seconds

      $ /etc/init.d/rc.pvr stop

[edit] Building the SDK on your own

(This was tested with OMAP34xx_GFX_SDK_K2627_Zoom2_20090817.zip.)

To build the modules and demos, you have to have a tree with the appropriate kernel build first, for details see #Building Kernel Modules. You might want to use two different toolchains during the build -- one for the kernel and the kernel modules (2.6.27 doesn't compile with GCC 4.4.0), another for the userspace components (the SDK demos need libstdc++, but the one included in CSL 2008q3 toolchain is incompatible with current Angstrom libstdc++). That should be ok, as long as the C runtime of your toolchain/distro is compatible with that the prebuild SDK userspace binaries expect (the SDK includes binary-only dynamic libraries).

The SDK build scripts unfortunately don't always honour CROSS_COMPILE environment variable and use hardcoded CSL-like arm-none-linux-gnueabi- prefix. You can fix that with fix-sdk-cross-compile.sh.

You should do things in this order:

  1. Set up environment for the toolchain you want to use for the kernel part: export CROSS_COMPILE=your-toolchain-prefix- and update PATH if your toolchain lives off-path.
  2. Build kernel (make uImage && make modules) -- more info in #Building Kernel Modules
  3. Pick a dir for your root fs: export DISCIMAGE=/blah/rootfs; mkdir -p $DISCIMAGE (it can be yet unpopulated)
  4. Install kernel modules to rootfs: make INSTALL_MOD_PATH=$DISCIMAGE modules_install
  5. Extract SDK, cd OMAP34xx_GFX_SDK_Zoom2
  6. Fix SDK file permissions, links. etc: ./build_SDK.sh --set
  7. Fix broken cross-compilation: /path/to/fix-sdk-cross-compile.sh .
  8. Setup SDK environment: export KERNELDIR=/path/to/kernel/you/just/built (You also need DISCIMAGE as mentioned above.)
  9. To build the kernel modules: ./build_SDK.sh --kernel
  10. To install the modules and the basic userspace stuff: ./build_SDK.sh --install libs
  11. Optionally:
    1. If you want/have to use a different toolchain for userspace, adapt CROSS_COMPILE and PATH as needed.
    2. To build and install demos: ./build_SDK.sh --build demo && ./build_SDK.sh --install demo
    3. To build and install course: ./build_SDK.sh --build course && ./build_SDK.sh --install course
[edit] Building Kernel Modules

Some warnings first:

      $ cd OMAP34xx_GFX_SDK_Zoom2
      $ export KERNELDIR=/path/to/prebuilt/kernel
      $ ./build_SDK.sh --kernel

After successful build the kernel modules (*.ko) files will be copied to "bin/binary_omap3430_linux_release"

[edit] Using packages from the feed

There are already build packages that add accelerated OGLES support included in the Angstrom Zoom2 feed. You need to install the following packages:

Furthermore, you can install:

for example:

# opkg update && opkg install omap3-sgx-modules libgles-omap3 libgles-omap3-rawdemos libgles-omap3-x11demos

To get a list of what is included in a package (e.g. to see what demos are there), after installing the package do:

# opkg files packagename

[edit] Enabling TI Hardware Accelerated Codecs

TI OpenMAX IL is released as open source (under LGPLv2) along with some DSP codecs are available under the OpenMax Project. v0.3.5 has support for MPEG-4 AAC and MPEG-4 decoders.

[edit] Extract and Install

This wiki assumes that you have unpacked, configured, and compiled the busybox file system, alsa, the kernel, and dspbrige. All of these are available on omappedia.org. You should follow the respective instructions to build each piece. Again, at this point, these pieces should be built and functioning.

Untar the main package & change to tiopenmax directory. You will find "TI-OMX-Sample-Firmware-0.X-Linux-x86-Install" in /lib/dsp. Run that installer by providing the path to the root of this package when asked for the destination directory. After installing, you should see files such as:

./lib/dsp/baseimage.dof
./lib/dsp/mp4vdec_sn.dll64P
.
.

[edit] Building

You need to set the following environment variables in order to succesfully build:

PREFIX - Where the output goes
CROSS - The cross compiler prefix (eg arm-none-linux-gnueabi-)
CROSS_COMPILER - same as above
TARGETDIR - should be $PREFIX/rootfs
OMXTESTOUTPUT - $PREFIX/rootfs/omx
BRIDGEINCLUDEDIR - Where your Bridge headers are (eg. dspbridge_mpu_api/mpu_api/inc)
BRIDGELIBDIR - Where you put your DSP libs (e.g. $TARGETDIR/rootfs/lib)

Change directory to 'tiopenmax' directory and run the following make commands:
make avplay.clobber avplay
This builds omx video decoder, display post processor, omx aac decoder & AV Play test application.
Similarly:
make video_display.clobber video_display
make image_display.clobber image_display

Check for the following files in your rootfs. If they are not present, they are included in the package for you.

/dspbridge 
cexec.out 
This application will load the DSP base image. 
/share 
Too many files to list. just copy the share tree from the location where you unpacked your tarball.
/lib 
libasound.so.2.0.0 
libasound.so.2 (softlink to the above) 
libdl-2.5.so 
libdl.so.2 (soflink to the above)

[edit] Testing

To run any test app, this step must be done first:

cd ./dspbridge  (This step need not be done if DSPBridge is built in to the kernel)
./uninstall_bridge
./install_bridge
mdev -s
./cexec.out /lib/dsp/baseimage.dof
../bin/OMXAudioManager &
../bin/OMXResourceManager &
echo -n 0 > /sys/power/enable_mpucoreoff
echo 0 > /sys/power/fb_timeout_value

These above OMX components could be used with the GStreamer plug-ins (using this library).

Please note that these steps haven't been validated yet on Zoom2 using L-O kernel as currently Zoom2 support is being added to the L-O sync kernel. 2.6.27 O-Z kernel could not be used successfully on Angstrom due to an Xserver crash that was observed.

[edit] Angstrom on Zoom OMAP 36xx

[edit] Build Angstrom

Build Angstrom for Zoom OMAP 36xx in minutes using the Online Image Builder available at http://www.angstrom-distribution.org/narcissus/

For now, please choose machine as omapzoom2 and the same works for OMAP36xx. The changes for 36xx will be pushed upstream.

Note: It is recommended to build Angstrom for omapzoom2 platform through Openembedded framework.

Select the following items:

[edit] Zoom 36xx Env Setup

Build Bootloader (u-boot and x-loader) and Kernel for Zoom 36xx following instructions in Omappedia.

Below are the Git Commit Ids from L23.i3.3 community release that have been validated.

Tested configuration on Zoom 36xx...

• U-Boot:

   git://git.omapzoom.org/repo/u-boot.git;branch=master;protocol=git Commit: ab45d2a787a9674bed30542139175d8e090e0749

• X-Loader:

   git://git.omapzoom.org/repo/x-loader.git;branch=master;protocol=git Commit: 251d92815500143aefdbe3b3558a0ce6daeaebdc

• Kernel:

   git://dev.omapzoom.org/pub/scm/integration/kernel-omap3.git;protocol=git;branch=L23.I3.3  Commit: 2e3c681c6228de2a3f8fbb0cfbc940e7ea825a09

[edit] Booting Angstrom

Angstrom on Zoom 36xx has been tested on SD boot. Copy bootloader and kernel to the Boot partition of the SD card. Angstrom file system built using Narcissus has to be copied to the secondary partition.

Once Angstrom loads, login as 'root'. Password is "no password" i.e. just press "Enter".


To log into Angstrom from the Zoom3 screen, a new user has to be created. Hence create a user at the hyper terminal.

$ adduser <name> password <pwd>

If you type the command cat /etc/passwrd, you should be able to see usr/<name> as a valid user.


Login using <name> and <pwd> on Zoom 36xx and Angstrom should load.

[edit] WLAN on Zoom 36xx

WLAN build based on community release L23.i3.3

L23.i3.3 WLAN firmware package is available through L23.i3.3 community release.

Download, Untar and click Install. This should provide the firmware file, Fw1273_CHIP.bin

  * Copy Fw1273_CHIP.bin to $WLAN_ROOT/fw/Latest/

1. Clone the WLAN source from the link git://dev.omapzoom.org/pub/scm/vijay/wlan.git;protocol=git;branch=master

2. Copy firmware (Fw1273_CHIP.bin) to $WLAN_ROOT/platforms/os/linux.

3. cd $WLAN_ROOT/platforms/os/linux.

4. Setup the environment

  * export CROSS_COMPILE=arm-none-linux-gnueabi-
  * export ARCH=arm
  * export HOST_PLATFORM=zoom3
  * export KERNEL_DIR=$KERNEL_ROOT 

5. make BUILD_SUPPL=n

6. The built packages are tarred as zoom3Binaries.tar containing the following binaries

  * sdio.ko
  * tiwlan_drv.ko
  * wlan_cu
  * tiwlan_loader
  * tiwlan.ini

7. Create a "wlan" folder in the root of the Angstrom filesystem and copy the files listed above

8. To load WLAN drivers at startup...

Install WLAN script (to be added) into etc/init.d/wlan and create the soft links as shown below

e.g. sudo ln -s ../init.d/wlan K29Wlan

In etc/rc0.d directory create soft link K29Wlan pointing to ../init.d/wlan

In etc/rc1.d also same as above

In etc/rc2.d directory create soft link S29Wlan pointing to ../init.d/wlan

In etc/rc3.d same as above

In etc/rc5.d directory create soft link S29Wlan pointing to ../init.d/wlan

In etc/rc6.d directory create soft link K29Wlan pointing to ../init.d/wlan

System boot ups with WLAN drivers installed


9. Test WLAN

By default, it is not connected to a wireless network. Wlan_Supplicant needs to be verified.

Start the WLAN-TI CLI to scan and connect to an AP

Once Angstrom loads and logged in as 'root', execute /wlan/wlan_cu to scan the available wireless networks.

- ./wlan_cu -b
- / a s              --> scan for the AP's in the vicinity
- / c b              --> List the AP's scanned thus far
- c "name_of_AP" --> connect to one of the AP's listed above; e.g. c "WAC"
  1. ifdown tiwlan0
  2. ifup tiwlan0

This will enable TI WLAN and select ifupdown(wlan0) in the Network Manager Applet in the Angstrom UI. The wireless connection will be established.

Internet can be accessed via any exlorer, Midori or Firefox.


     * ifconfig --> see all connections
     * ifdown <interface> --> turns off network driver
     * ifup <interface> -->turns on network drivers
        * e.g. interface=eth0, interface=tiwlan0

[edit] TI OMX with Angstrom on Zoom36x

TI OMX source and binaries are available as part of the L23.i3.3 community release that has been made on Poky. The same can be used with Angstrom. The below lists the supported features in the Community Release

[edit] MM Use Cases (DSP)and TI OMX Components

 MPEG4/H263 Video Dec
 MPEG4/H263 Video Enc
 H264 Video Dec
 JPEG Dec
 JPEG Enc
 AAC Dec

The package containing DSP binaries and OMX Components can be obtained from the OpenMax project site for OMAP https://gforge.ti.com/gf/project/openmax/frs/ This package is referenced as RLS23.i3.3.

[edit] Angstrom Filesystem with Pre-built binaries

The release package also contains pre-built binaries that can be used directly with Angstrom file system.

Build / Add the various components to use TI OMX/DSP

[edit] Test TI OMX

[edit] Building TI OMX within OE/Angstrom

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox