Getting Started Guide for the AVNET OMAPL138 EVM

From RidgeRun Developer Connection

Revision as of 20:46, 15 December 2010 by Jweber (Talk | contribs)
Jump to:navigation, search

Contents

Installation Guide

Step 1)  Setting up a Linux host for development

This SDK requires a Linux host.  This guide assumes that you are running Ubuntu 10.4.  For a list of support Linux hosts please go here. For a guide on setting up a Linux host from scratch, go to <here>. To download Ubuntu for desktop computers, go here.

Step 2)  Download the SDK

The evaluation SDK contains everything you need to build Linux for the S6-OMAP CoProcessing kit.  It includes the kernel source, the toolchain, and a number of applications already ported to the OMAP-L138.  Go here for a complete list of SDK features.  You will need to dowload an evaluation SDK from the download center.  You will fill out a form.  Once you have submitted the form, you will be emailed instructions on how to download the SDK.   You can put the downloaded SDK installer anywhere on your filesystem.

Step 3) Installing the SDK

The SDK comes in the form of a binary installer (.bin file).  You will first need to make the file excutable using the following command:

chmod +x s6omapSDK-beta-Linux-x86-Install.bin

The installer must be able to write to the /opt directory in order to install the toolchain.  You can allow it to do this in one of two ways.  The first way is to run the installer as root using the sudo command or the su (switch user) command.  The other way to do this is to change the ownership of /opt such that you as a user and write to it.

$ sudo chown $USER /opt

Then you will be able to run the installer:

$ ./s6omapSDK-beta-Linux-x86-Install.bin

After accepting a license agreement, the installer will ask for for a default location at which to install the SDK.  If you are running the installer as a user, the default location is in /home/$USER/s6omapsdk. You can change this to any directory to which you have write permission.  You will also be prompted to select if you want a "Typical" or "Custom" install. Select "Typical."

Step 4) Running 'make' for the first time

Now that you have the SDK installed, you can build your Linux system.  You do that by using the 'make' command.

$ cd $HOME/s6omapsdk
$ make

Host OS Check: Changing the link from /bin/sh to /bin/bash

The first time that you run make, it will ask you to do a couple of things in order to proceed.  The first thing it might ask of you (particularly if you are running an Ubuntu host), is to change the shell that is run when scripts run /bin/sh.  You should see this message.

$ make
bash is not your default shell.
Please run:
  sudo rm /bin/sh
  sudo ln -s /bin/bash /bin/sh
make: *** [.oscheck] Error 255

By default on Ubuntu systems, /bin/sh is linked to /bin/dash and that causes problems with certain build scripts. It should be linked to /bin/bash.  Run the following commands to fix this problem:

$ sudo rm /bin/sh
$ sudo ln -s /bin/bash /bin/sh

Once you do this, you will need to run make again.

Host OS Check: Installing required host packages

This time, it will exit because it might find a number of packages that you need to install on your host in order for it to run.  Below is a complete list of the required host packages.  Your host system might or might not need all of them and the SDK will tell you which ones are missing.  You can install them by running the following command (assumes your host has a valid connection to the internet):

$ sudo apt-get install build-essential libtool libncurses5-dev texinfo minicom quilt subversion curl \
git-core libdbus-glib-1-dev libgtk2.0-dev flex bison gperf autoconf automake libusb-dev libexpect-perl \
mono-devel

First build: Top level configation menu

After you've installed the missing packages, you will run make again.  This time, it should present you with the top-level configuration menu.

Rr-sdk-config-screen.png

This menu is the main way for you to customize your Linux system. You can make modifications to the kernel configuration, select user applications, change the type of filesystem to build, and so on.

Since you are just getting started, just take the default settings by selecting "Exit" with the cursor key and hit the enter key. The menu will exit and it the SDK will be built automatically.  This can take a while, depending on the performance of your host system.

First build: Installation of TI packages

The first time you build the SDK, it will automatically attempt to download, install, and build various packages from TI. These include DSP/BIOS, DSPlink, Codec Engine, Code Generation Tools, and XDCtools.  Each of these takes some time to download and each comes with its own click-through license agreement that you will need to accept.

By default, the TI packages are all downloaded and installed into the s6omapsdk/downloads directory.  Make sure to keep this default installation location. Once you have installed all of the necessary TI packages, the SDK build will complete.

First build: Location of build kernel and filesystem

When the SDK build is complete, you will have a kernel and filesystem (and many other things as well, but we won't go into that in this guide). The kernel and filesystem are located at:

$DEVDIR/images/kernel.uImage (uboot loadable binary image)

$DEVIDR/fs/fs (NFS-mountable filesystem directory by default)

You should now be ready to use these on your board.

Step 5) Booting your board with the new kernel and NFS filesystem

In order to configure your board, load the board with the kernel, and use the NFS filesystem, you will need to do some basic host setup.

Here is a diagram showing the data connections between the board and the host computer.

Setup block diagram.png

Setting up serial access to the Linux console

You use a serial port with a terminal emulator to control u-boot and Linux.  The S6-OMAP CoProcessing Kit makes use of Silicon Labs CP2102 USB-UART bridge chips to provide serial ports.  Driver support for these chips is already included in Linux.  Simply connect the USB port J16 (labeled "OMAP UART") to your host computer.  The serial device should appear in /dev/ttyUSBn, where n is chosen by your particular machine (usually 0). 

Sometimes it is a little tricky to discover which device this is.  Here is a useful command that will tell you. Before you plug in the USB cable, run this command in a terminal:

$ watch "dmesg | tail 5"

This will show you the last 5 lines in the kernel message log (as reported by the 'dmesg' command). When you connect the USB cable, you should see something like this:

[175280.446497] usb 2-1: new full speed USB device using uhci_hcd and address 6
[175280.634470] usb 2-1: configuration #1 chosen from 1 choice
[175280.695555] cp210x 2-1:1.0: cp210x converter detected
[175280.861447] usb 2-1: reset full speed USB device using uhci_hcd and address 6
[175281.102604] usb 2-1: cp210x converter now attached to ttyUSB0

The last line in the dmesg output indicates the serial port device to use, which is /dev/ttyUSB0.

You need to use a terminal emulator program to use the serial port.  The picocom terminal emulator work well for this purpose.

Setting up Picocom - Ubuntu

Setting up a TFTP server

Using u-boot, you can speed downloads to the target hardware by using the OMAP Ethernet connection and Trivial File Transfer Protocol (TFTP).  You host PC needs to be configured as a TFTP server for this to work.

Setting Up A Tftp Service

Setting up an NFS server

For application development, it is convenient to use root NFS mount file system for the target hardware. This allows you to rebuild your application on the host and immediately run the application on the target hardware with no interveining steps. You host PC needs to be configured as a NFS server for this to work.

Setting Up A NFS Service


Additional Things to Do

Partitioning an SD card

You can store the file system on an SD card. To do this, you need to have the right partitions setup on the SD card. These steps will create two partitions, the second one is used to hold the target file system.

Creating a bootable SDcard

Checking out the binary images

If you simply want to run the pre-built versions of the Linux kernel using the pre-built file system,, the start by downloading the pre-built images from 're not able to use the SDK you could download the pre-built images.

https://www.ridgerun.com/support/avnet/downloads/

Saving pre-built kernel and file system on target hardware

Format an SD Card with 2 partitions in the first one use a FAT32 format with 32Mb of size and in the second one format it with EXT3 format and with the rest of the SD Card, as described above.

On your host computer, copy the image of the file system given in the web site to the second partition:

sudo tar -C /media/<MOUNT EXT3> -xzvf fs-avnet-evm.tar.gz

Plug the SD to the board and power on it. Using your terminal emulator (e.g. picocom), send the following commands to u-boot.

echo Initialize access to SPI flash
sf probe 0
echo Get IP address and configure networking
setenv autoload no
dhcp
setenv serverip <SERVER_WERE THE TFTP IS>
setenv autostart no

echo Load kernel image over the network using TFTP
tftp 0xC0700000  kernel.uImage.avnet.evm

echo Erasing SPI flash memory...
sf erase 0x50000 0x280000

echo Saving kernel...
sf write 0xC0700000 50000 24FF88

echo Saving new kernel load address...
setenv kernelloadaddr 0xC0700000

echo Saving new kernel save addresses and offset...
setenv kernelsaveaddr 0x50000
setenv kerneloffset 0x50000

echo Saving new kernel size...
setenv ksize 0x250000

echo Set kernel command line
setenv setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3 mem=34M' 

echo Set boot command 
setenv bootcmd 'sf probe 0;sf read ${kernelloadaddr} ${kerneloffset} ${ksize}; bootm ${kernelloadaddr}'
setenv autostart yes

echo Saving u-boot parameter environment
saveenv

What's Tested and Supported

AUDIO Audio test Spartan 6 LX45T/OMAP L138
USB-RS232 USB-RS232 test Spartan 6 LX45T/OMAP L138
Ethernet Ethernet Test Spartan 6 LX45T/OMAP L138
USB ports USB0 USB1 USB Test Spartan 6 LX45T/OMAP L138
SDCARD SLOT SD Card Test Spartan 6 LX45T/OMAP L138
SATA SATA Test Spartan 6 LX45T/OMAP L138
I2C Test I2C General

What's Tested and not Supported

Audio not working.
Logic PD 4.3� WQVGA DISPLAY KIT, model number: LCD-4.3-WQVGA-10R
Changing the mode with OMAPL138 related pins

What's not Tested

FPGA Communications Ports
OMAP DEBUG (JTAG Interface)
ALI Interface (AVNET LCD Interface)
USER switches
User LEDs
FPGA GTP Interfaces
installing an updated bootloader using make installbootloader

Bold text

Navigation
Toolbox