Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

GSG: DVEVM Software Setup for DM3xx Platforms

From Texas Instruments Wiki
Jump to: navigation, search

Note: This software setup page covers page covers how to install the Linux tools, (DV)SDK software, and Linux Product Support Package for the DM365 DVEVM (for DVSDK 3.10: which supports Community Linux Kernel), assuming a Ubuntu 8.04 LTS (or similar) distribution. If you want view software setup page for DVSDK 2.10, which is based on MontaVista Linux Kernel please use see link DM365 DVEVM Software Setup for MontaVista Kernel.

Note: This software setup page covers how to install the Linux tools, (DV)SDK software, and Linux Support Package for the DVEVMs on platforms that have only an ARM chip, such as the DM355 and DM365.

Software Overview

Terminology: "DVEVM" is the physical kit, including EVM hardware, software and everything included in the kit. The "DVSDK" refers to the TI software included in the DVEVM.

To begin developing applications, you need to install the DVSDK development environment. This chapter outlines the steps required to load the DVSDK onto the development host. You will need the distribution disks or the files provided as a part of the DVEVM.

The DVSDK provides inter-operable, optimized, production-ready video and audio codecs that leverage integrated accelerators. These codecs are built into configurable frameworks, and are presented via published APIs within popular operating systems (such as Linux) for rapid software implementation.

The software that is made available with the DVSDK, some included with the kit and some can be downloaded with registration. Please see DVSDK release notes under the DVSDK download link for details on this.

Guidelines to migrate from MontaVista-based releases can be found in Community Linux DVEVM Software Migration Guide.

Command Prompts in This Guide

In this guide, commands are preceded by prompts that indicate the environment where the command is to be typed. For example:

host $

Indicates command to be typed into the shell window of the host Linux workstation.

EVM #

Indicates commands to be typed into the U-Boot shell in a console window connected to the EVM board's serial port.

target $

Indicates commands to be typed into the Linux shell in the terminal window connected to the EVM board's serial port.

Software Components

The following figure shows the software components used for application development with the DVSDK (e.g., DM355, DM365):

DVSDK Linux SW Stack withGStreamer noDSP.jpg

In the above figure, everything runs on the ARM. The application handles I/O and application processing. To process video, image, speech, and audio signals, it uses the DMAI APIs provided by DMAI. The DMAI talks to PSP for capture, display/playout of audio/video and to Codec Engine for codec processing. The Codec Engine, in turn, uses xDM-based codecs.

In addition, Linux running on the ARM makes a large number of APIs available to your application, including drivers and timers.

Note: GStreamer and other components highlighted in pink are not provided in the DVSDK release.

Preparing to Install

On a host Linux system (Ubuntu 8.04 was used for this guide), download and copy the following files to a temporary location with at least 1.2 GB available space. Since you can delete the installation files after installing the software, a directory like /tmp is recommended. We will be referring to this directory as the "download area". The following can be downloaded from the DVSDK release page

  • linux-davinci-staging.tar.gz - contains the kernel source tree with the TI modifications, also known as the Product Support Package (PSP)
  • linuxlibs-####.##-armv5te.tar.gz - contains PSP pre-compiled Linux libraries
  • dvsdk_#_##_##_##_Setup.bin - contains the DVSDK itself
  • arago-demo-image-dm####-evm.tar.gz - for root filesystem

Updates to these installers may be available in subsequent releases.

The DVSDK also needs the Code Sourcery tools

  • Please download Sourcery G++ Lite 2009q1-203 for ARM GNU/Linux from the download link provided under Installing Software Components section as given below.

Installing the Software

Installing the software used by the DVSDK involves performing the following steps:

Installing Software Components

This section explains how to install the required software components on the host.

  1. Log in to your host Linux workstation.
  2. The commands in this section install all components in the /home/user/dvsdk directory. If you prefer a different location, modify the commands as necessary. Open a command prompt in user mode and go to the download directory as follows:
host $ mkdir -p /home/user/dvsdk
host $ cd /home/user/dvsdk
  1. Download and unpack the tool chain: The link Getting_CodeSourcery_Toolchain provides the information you need to download the toolchain. You can download the Advanced Packages from the link which provides the linux tar ball. The other options would be to download the Recommended Packages which provides the tools in a linux installer. These commands assume you want to download the toolchain (Advanced Packages) and install it in the /opt/arm-2009q1 directory. Note: The "sudo" is not necessary if you want to install the toolchain in some other place. The toolchain can be installed anywhere in the system as long as the directory has the necessary write permissions.
host $ sudo mkdir -p /opt
host $ sudo tar -xjf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C /opt
Note: Please note that arm-2009q1-203-arm-none-linux-gnueabi.bin is an assumed installer name from the Code Sourcery if Recommended Packages is selected from the link for the linux installer. Please execute arm-2009q1-203-arm-none-linux-gnueabi.bin to install the toolchain to /opt/arm-2009q1 directory if linux installer is considered for the toolchain instead of the tarball.

These command line tools are available at no cost. Code Sourcery also offers more fully featured tools for a cost. The Sourcery G++ Lite package includes all of the following components:

  • CodeSourcery Debug Sprite for ARM
  • GNU Binary Utilities (Binutils)
  • GNU C Compiler (GCC)
  • GNU C Library (GLIBC)
  • GNU C++ Compiler (G++)
  • GNU C++ Runtime Library (Libstdc++)
  • GNU Debug Server (GDBServer)
  • GNU Debugger (GDB)
  1. Unpack the PSP pre-compiled Linux libraries package as follows. It puts the library headers in linuxlibs-####.##-armv5te/include directory and pre-compiled libraries in linuxlibs-####.##-armv5te/lib directory.
host $ tar -xzf linuxlibs-####.##-armv5te.tar.gz -C /home/user/dvsdk
  1. Unpack the Linux PSP source. The Linux kernel can be found in /home/user/dvsdk/git.
host $ tar -xzf linux-davinci-staging.tar.gz  -C /home/user/dvsdk
  1. Install the DVSDK software:
host $ chmod  a+x dvsdk_#_##_##_##_Setup.bin
host $ ./dvsdk_#_##_##_##_Setup.bin

Note: The $(DVSDK_INSTALL_DIR) variable in the installer points to the DVSDK install directory, e.g., $(DVSDK_INSTALL_DIR) is set to /home/user/dvsdk/dvsdk_#_##_##_## for this setup.

  1. The command mentioned in step 6 opens the installer window. Please choose the appropriate options and enter the required paths to complete the installation.
  2. You can choose to update the paths later by editing the Rules.make file present in /home/user/dvsdk/dvsdk_#_##_##_## directory.


Note: You can uninstall these components by using the rm -rf command on its directory. You should ignore the uninstall files created by the installer.

Creating a Target and Host Shared File System and Exporting It

Although the EVM board's (that is, the target's) NAND flash contains a file system, during development it is more convenient to have the target board NFS mount a file system on a host Linux workstation. Once you have tested the application, you can store it on the board's flash for a standalone demonstration.

Before the EVM can mount a shared target file system, you must export that target file system on the host Linux workstation. The shared file system uses an NFS (Network File System) server. The exported file system will contain the target file system and your executables.

The Installing a NFS Server page provides information on installing NFS server in a Ubuntu machine.

This link provides the detailed description on setting up the Target Filesystem for DM365.

The typical boot setup is given in Sample U-Boot parameters required for the DVSDK demo.

Please refer to this link for booting the DM365 EVM using the pre-built binaries.

Setting Up the Build/Development Environment

To set up the development and build environment, follow these steps:

  1. Log in to your user account (and not as root) on the NFS host system.
  2. Set your PATH environment variable so that the tool chain host tools and cross compiler (arm-none-linux-gnueabi-gcc) can be found. To do this, you should open your .bashrc file in a text editor such as vi or gedit and add the export command line to the file, for example run the command below:
host $ gedit /home/user/.bashrc
  1. Next, add the export command below to the .bashrc file. If you installed in a location other than /opt/arm-2009q1/bin, use your own location in the PATH.
export PATH="/opt/arm-2009q1/bin:$PATH"
  1. Remember to use the following command after modifying your .bashrc file. The source command essentially executes the .bashrc script such that the path you just added to it is placed in your current environment variables:
host $ source /.bashrc
  1. If you want to verify your new PATH variable you can run either of the commands below:
    • This prints just the PATH variable:
host $ echo $PATH
  • This prints all of the system's current environment variables:
host $ printenv

Building the DVSDK Software for the Target

You can build both the Linux kernel and DVSDK from dvsdk_#_##_##_##. The following steps assume you have installed all components described above in /home/user/dvsdk.

You need to do following once in the host machine to be able to build DVSDK
host $ sudo apt-get install libc6-dev
  1. Change directory to /home/user/dvsdk/dvsdk_#_##_##_##
  1. The following steps are not required if DVSDK is installed through the linux installer. The below steps can be used to verify the environment variables set in the Rules.make file in the dvsdk_#_##_##_##. directory.
host $ gedit Rules.make
  • Set PLATFORM to match your EVM board as follows:
PLATFORM=dm####

Note: valid options are dm365 or dm355 or dm6467

  • Set DVSDK_INSTALL_DIR to the top-level DVSDK installation directory as follows, note that by default ${HOME} refers to your /home/<user> directory:
DVSDK_INSTALL_DIR=/home/user/dvsdk/dvsdk_#_##_##_##
  • Make sure LINUXKERNEL_INSTALL_DIR is defined as follows so it points to where you copied the linux kernel tree in the Building a New Linux Kernel.
LINUXKERNEL_INSTALL_DIR=/home/user/dvsdk/git
  • Make sure LINUXLIBS_INSTALL_DIR points to the extracted PSP pre-compiled Libraries.
LINUXLIBS_INSTALL_DIR=/home/user/dvsdk/linuxlibs-####.##-armv5te
  • Make sure CSTOOL_DIR points to the Code Sourcery tools directory as follows:
CSTOOL_DIR=/opt/arm-2009q1
  • Make sure EXEC_DIR points to the opt directory on the NFS exported file system as follows:
EXEC_DIR=/home/<useracct>/workdir/filesys/opt/dvsdk/dm####
  1. Building Linux kernel image requires mkimage to be present in the system. The Ubuntu 8.04 LTS version does not have mkimage installed by default. One way to install mkimage in an Ubuntu machine is to follow instructions in the link uboot-mkimage.
  2. To build the Linux kernel (uImage) with the default settings, run the following command. (This step is needed to re-build kernel modules in DVSDK.) This step requires mkimage to be present in the system.
host $ make linux_clean
host $ make linux
  1. At the end of the build the make will output a message about where the uImage is located. Typically it will be in /home/user/dvsdk/git/arch/arm/boot/uImage.
  2. (Optional) Use the following command to copy uImage to a place where U-Boot can use TFTP to download it to the EVM. These commands assume you are using the default TFTP boot area, which is /tftpboot. If you use another TFTP root location, please change /tftpboot to your own TFTP root location. (Perform these commands as root or use a chown uImage command to get ownership of the file.) The Installing a TFTP Server page lists out steps to set up a TFTP server.
host $ cp /home/user/dvsdk/git/arch/arm/boot/uImage /tftpboot
host $ chmod a+r /tftpboot/uImage
  1. While in the same directory that contains Rules.make, use the following commands to build the DVSDK demo applications and put the resulting binaries on the target file system specified by EXEC_DIR. Note that the first time you run 'make clean' there may not be much to clean yet, so the output from make will have a lot of 'no such file or directory' messages. Also you must have built Linux kernel as described in previous step at least once before running following make. The make commands should be run as the user account.
host $ make clean
host $ make
host $ make install
  1. You can test the rebuilt DVSDK applications by booting your NFS file system and running the demos from the command line as described in Running the Demos from the Command Line.
  2. The DVSDK make system (Makefile) is also capable of building individual components separately. Type the following command to learn about all of its features.
host $ make help

Writing a Simple Program and Running it on the EVM

Make sure you followed the steps provided in Creating a Target and Host Shared File System and Exporting It section.

Perform the following steps on the NFS host system as user (not as root):

  1. Make a new directory for the simple program:
host $ mkdir -p /home/<useracct>/workdir/filesys/opt/hello
  1. Move to the new directory:
host $ cd /home/<useracct>/workdir/filesys/opt/hello
  1. Create a file named hello.c using a text editor (for example, gedit, kedit, xemacs, or vi).
host $ gedit hello.c
  1. Add the following contents to this file:
#include <stdio.h>
int main()
{
   printf("Buongiorno DaVinci!\n");
   return 0;
}
  1. Build the new c file:
host $ arm-none-linux-gnueabi-gcc hello.c -o hello

Perform the following steps on the target board:
You may use either the target's console window or a telnet session.

  1. Go to the new directory on the target:
target $ cd /opt/hello
  1. Run the new executable:
target $  ./hello
  1. The output should be:
Buongiorno DaVinci!


What's Next?

To continue the setup procedure, return to the DVEVM Getting Started Guide.