[Home] Installing OMAP DVSDK on Gumstix Overo

Goal

Get the TI demos running on the gumstix.

OMAP & DaVinci Software for Dummies might be worth reading...

TI's DVSDK & EVM packages

According to TI's Getting Started Guide: OMAP35x DVEVM Software Setup, you'll need the following packages:

For the sake of getting started things, I recommend trying the TI way first. From those packages, we won't actually use codesourcery_tools since gumstix provides gcc-cross, which fulfills the same function.

You'll may also want dsplib64plus, dsplib64plus.h, dsplib64plus.lib

Installing

Unpacking

You'll need to unpackage the downloads in specific locations and also unpackage some of the sub-packages. Assuming that you've downloaded all of the above into ~/Downloads:

cd ~/Downloads

./dvsdk_3_01_00_10_Setup.bin # installs to ~/dvsdk

./cs1omap3530_setupLinux_1_01_00-prebuilt-dvsdk3.01.00.10.bin # Installs to ~/cs1omap3530
ln -s ~/cs1omap3530/cs1omap3530_1_01_00 ~/dvsdk/dvsdk_3_01_00_10/cs1omap3530_1_01_00
sudo ./ti_cgt_c6000_6.1.12_setup_linux_x86.bin # Installs to /opt/TI/C6000CGT6.1.12
export C6X_C_DIR=/opt/TI/C6000CGT6.1.12/include:/opt/TI/C6000CGT6.1.12/lib
echo "export C6X_C_DIR=/opt/TI/C6000CGT6.1.12/include:/opt/TI/C6000CGT6.1.12/lib" >> ~/.bashrc

tar xf data_dvsdk_3_01_00_10.tar.gz -C ~/dvsdk/dvsdk_3_01_00_10/clips/

tar xf AM35x-OMAP35x-PSP-SDK-03.00.01.06.tar.gz -C ~/
cd ~/AM35x-OMAP35x-PSP-SDK-03.00.01.06/src/kernel/
tar xf linux-03.00.01.06.tar.gz
cd ~/AM35x-OMAP35x-PSP-SDK-03.00.01.06/src/u-boot/
tar xf u-boot-03.00.01.06.tar.gz
cd ~/AM35x-OMAP35x-PSP-SDK-03.00.01.06/src/examples
tar xf examples.tar.gz

mv sprc834.gz sprc834.tar.gz
tar xf sprc834.tar.gz
./C64x+DSPLIB-2.1-Linux-Install.bin # Installs to ~/C64x+DSPLIB
sed -i 's,\\,/,g' ~/C64x+DSPLIB/dsplib_v210/dsplib64plus.h # convert from windows `\` to normal `/`
cp ~/C64x+DSPLIB/dsplib_v210/dsplib64plus.h /opt/TI/C6000CGT6.1.12/include/
cp -a ~/C64x+DSPLIB/dsplib_v210/src /opt/TI/C6000CGT6.1.12/include/
cp ~/C64x+DSPLIB/dsplib_v210/dsplib64plus.lib /opt/TI/C6000CGT6.1.12/lib/

Now that everything is installed you must configure ~/dvsdk/dvsdk_3_01_00_10/Rules.make. Here's an example of what the values that should probably be chaged:

* `DVSDK_INSTALL_DIR=$(HOME)/dvsdk/dvsdk_3_01_00_10`
* `CODEGEN_INSTALL_DIR=/opt/TI/C6000CGT6.1.12`
* `OMAP3503_SDK_INSTALL_DIR=$(HOME)/AM35x-OMAP35x-PSP-SDK-03.00.01.06`
* `CSTOOL_DIR=${OVEROTOP}/tmp/sysroots/i686-linux/usr/armv7a`
* `CSTOOL_PREFIX=$(CSTOOL_DIR)/bin/arm-angstrom-linux-gnueabi-`

Because some of the packages don't respect CSTOOL_PREFIX as they ought, also link the OpenEmbedded toolchain to arm-none-linux-gnueabi-

cd ${OVEROTOP}/tmp/sysroots/i686-linux/usr/armv7a/bin
ls | cut -d'-' -f5-99 | while read COMP
do
  ln -s arm-angstrom-linux-gnueabi-${COMP} arm-none-linux-gnueabi-${COMP} 
done

To test that everything is installed correctly, try to compile all of the TI packages (probably takes 30 min+).

cd ~/dvsdk/dvsdk_3_01_00_10
make help
make clobber # super clean
make everything
make

Using the overo-patched TI PSP Kernel

Now that everything is installed correctly enough to compile the vanilla TI demos, let's get the overo psp kernel

Get linux-omap-psp (or any omap-psp based-branch of the kernel) downloaded and patched for the overo.

cd ${OVEROTOP}
bitbake -c configure linux-omap-psp # Downloads and patches `git_arago-project.org.git.people.sriram.ti-psp-omap.git_a6bad4464f985fdd3bed72e1b82dcbfc004d7869.tar.gz`
ls ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r81+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869/git

Right now /AM35x-OMAP35x-PSP-SDK-03.00.01.06/src/kernel/linux-03.00.01.06 is being used as the kernel dir in Rules.make. Change that to the desired kernel.

echo ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r81+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869/git
cd ~/dvsdk/dvsdk_3_01_00_10/
vim Rules.make
#LINUXKERNEL_INSTALL_DIR=$(HOME)/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r81+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869/git

Also, the Makefile is configured to build with the omap3_evm_defconfig, but we want the overo_defconfig

cd ~/dvsdk/dvsdk_3_01_00_10/
vim Makefile
# edit near "ifeq ($(PLATFORM),omap3530)"
# LINUXKERNEL_CONFIG=overo_defconfig

And try to compile the kernel now

make linux_clean
make linux

And now everything

make clobber
make everything

And lastly, copy some of the demo files out to ~/workdir/filesystem

make install

Running the demos

TI's Build/Run Instructions for Codec Engine Examples

Configure u-boot

The example loadscript for OMAP3530 assumes 80mb of OS memory, so that's what we'll set.

  1. reboot the overo
  2. press the 'any' key to enter u-boot
  3. set it to boot with only 80mb allocated for the OS
    • setenv mmcargs ${mmcargs} MEM=80M mem=80M
    • saveenv
    • run mmcboot

Copy the dvsdk examples to the overo

Modifying the examples

Appendix: Examining the TI Packages

dvsdk v3 (dvsdk_3_01_00_10_Setup.bin & data_dvsdk_3_01_00_10.tar.gz)

Unpacking:

  1. run ./dvsdk_3_01_00_10_Setup.bin and unpack as ~/dvsdk
  2. run tar xf data_dvsdk_3_01_00_10.tar.gz -C ~/dvsdk/dvsdk_3_01_00_10/clips
  3. run ls ~/dvsdk/dvsdk_3_01_00_10 to see that the results are as expected

This package contains these other packages:

It also contains these directories:

And these files:

cs1omap3530 v1 (cs1omap3530_setupLinux_1_01_00-prebuilt-dvsdk3.01.00.10.bin)

Unpacking:

  1. run ./cs1omap3530_setupLinux_1_01_00-prebuilt-dvsdk3.01.00.10.bin and unpack to ~/cs1omap3530/
  2. run mv ~/cs1omap3530/cs1omap3530_1_01_00 ~/dvsdk/dvsdk_3_01_00_10/cs1omap3530_1_01_00
  3. run ls ~/dvsdk/dvsdk_3_01_00_10/cs1omap3530_1_01_00 to see that the results are as expected

This package contains an example codec server

TI-C6x-CGT v6

Unpacking:

  1. run ./TI-C6x-CGT-v6.1.12.bin and unpack as /opt/TI/C6000CGT6.1.12
  2. run ls /opt/TI/C6000CGT6.1.12 to see that the results are as expected

This package contains the DSP Toolchain: C6000 CodeGen Tools

Scratchpad (unorganized, unfinished)

bitbake -c clean linux-omap-psp
bitbake -c clean ti-dsplink
bitbake -c clean ti-linuxutils
bitbake -c clean ti-dvsdk-demos

bitbake linux-omap-psp # Downloads `git_arago-project.org.git.people.sriram.ti-psp-omap.git_a6bad4464f985fdd3bed72e1b82dcbfc004d7869.tar.gz`
bitbake ti-dsplink # Downloads `dsplink_linux_1_65_00_02.tar.gz`
bitbake ti-linuxutils # Downloads `linuxutils_2_25_01_06.tar.gz`
bitbake ti-dvsdk-demos

You should be able to build the kernel just fine, but you'll need extra files from TI. I'm not sure which all of these are needed, but here are some links to files that will prove useful.

Building DVSDK

What we don't need

linux-omap-psp

This should build without issue.

If you get confused as to which of the lovely files in ~/overo-oe/tmp/deploy/glibc/images/ is the kerenl you're looking for, try ls -t which will list the most recenly built kernels first.

without bitbake

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=46&Itemid=54

bitbake -c configure linux-omap-psp
cd todo some directory
make menuconfig

no, really without bitbake

Grab the kernel source straight from the TI guy:

git clone git://arago-project.org/git/people/sriram/ti-psp-omap.git;protocol=git;branch=master

Set up a minimal set of env build variables

kernel.env:

CROSS_DIR=~/overo-oe/tmp/sysroots/i686-linux/usr/armv7a/bin
CROSS_PREFIX=arm-angstrom-linux-gnueabi-
export ARCH=arm
export CROSS_COMPILE=${CROSS_DIR}/${CROSS_PREFIX}

Configure the kernel

source kernel.env
make overo_defconfig
make menuconfig

kernel-dev.env:

if [[ -z "${KERNEL_CROSS_BUILD_ENVIRONMENT_SOURCED}" ]]; then

  # should work for MACHINE=beagleboard also, you will have to set OETMP correctly
  MACHINE=overo

  # Set OETMP to be your OE config TMPDIR. This is a configurable param for OE. 

  # For gumstix setups, look in ${OVEROTOP}/build/conf/site.conf
  # This is the gumstix default.
  OETMP=${OVEROTOP}/tmp

  # For beagleboard setups, look in ${OETREE}/build/conf/local.conf
  # This is the beagleboard default.
  # OETMP=${OETREE}/tmp

  SYSROOTSDIR=${OETMP}/sysroots
  STAGEDIR=${SYSROOTSDIR}/`uname -m`-linux
  CROSSBINDIR=${OETMP}/sysroots/i686-linux/usr/armv7a/bin

  export KERNELDIR=${SYSROOTSDIR}/${MACHINE}-angstrom-linux-gnueabi/kernel

  PATH=${STAGEDIR}/bin:${PATH}
  PATH=${STAGEDIR}/sbin:${PATH}
  PATH=${CROSSBINDIR}:${PATH}
  PATH=${STAGEDIR}/usr/bin:${PATH}
  PATH=${STAGEDIR}/usr/sbin:${PATH}
  PATH=${STAGEDIR}/usr/bin/armv7a-angstrom-linux-gnueabi:${PATH}

  unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE

  export ARCH="arm"
  export CROSS_COMPILE="arm-angstrom-linux-gnueabi-"
  export CC="arm-angstrom-linux-gnueabi-gcc"
  export LD="arm-angstrom-linux-gnueabi-ld"
  export KERNEL_CROSS_BUILD_ENVIRONMENT_SOURCED="true"

  echo "Altered environment for cross building kernel/u-boot with OE tools."
else
  echo "Cross build environment already configured."
fi

To include that in the environment:

source kernel-dev.env
make overo_defconfig
make menuconfig

ti-linuxutils

cmemk.ko

insmod /lib/modules/2.6.32/kernel/drivers/dsp/cmemk.ko 
CMEMK module: built on Jul 26 2010 at 17:53:26
  Reference Linux version 2.6.32
  File /home/user/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
no physical memory specified, continuing with no memory allocation capability...
cmemk initialized
rmmod cmemk.ko

Child Packages

A helpful FYI: Those two packages (ti-linuxutils, ti-dsplink) contain all of these:

./tmp/deploy/glibc/ipk/overo/
  kernel-firmware-ti-3410_2.6.33-r80.5_overo.ipk
  kernel-firmware-ti-5052_2.6.33-r80.5_overo.ipk
  kernel-module-ti-usb-3410-5052_2.6.33-r80.5_overo.ipk
  ti-biosutils-dbg_1_02_02-r1.5_overo.ipk
  ti-biosutils-dev_1_02_02-r1.5_overo.ipk
  ti-biosutils-sourcetree_1_02_02-r1.5_overo.ipk
  ti-biosutils_1_02_02-r1.5_overo.ipk
  ti-cgt6x-dbg_6_1_9-r4.5_overo.ipk
  ti-cgt6x-dev_6_1_9-r4.5_overo.ipk
  ti-cgt6x-sourcetree_6_1_9-r4.5_overo.ipk
  ti-cgt6x_6_1_9-r4.5_overo.ipk
  ti-codec-engine-dbg_2_25_01_06-r5.5_overo.ipk
  ti-codec-engine-dev_2_25_01_06-r5.5_overo.ipk
  ti-codec-engine-examples_2_25_01_06-r5.5_overo.ipk
  ti-codec-engine-sourcetree_2_25_01_06-r5.5_overo.ipk
  ti-codec-engine_2_25_01_06-r5.5_overo.ipk
  ti-dspbios-dbg_5_41_02_14-r1.5_overo.ipk
  ti-dspbios-dev_5_41_02_14-r1.5_overo.ipk
  ti-dspbios-sourcetree_5_41_02_14-r1.5_overo.ipk
  ti-dspbios_5_41_02_14-r1.5_overo.ipk
  ti-dsplink-dbg_1_64-r80f.5_overo.ipk
  ti-dsplink-dev_1_64-r80f.5_overo.ipk
  ti-dsplink-examples_1_64-r80f.5_overo.ipk
  ti-dsplink-module_1_64-r80f.5_overo.ipk
  ti-dsplink-sourcetree_1_64-r80f.5_overo.ipk
  ti-dsplink_1_64-r80f.5_overo.ipk
  ti-edma3lld-dbg_01_11_00_03-r0.5_overo.ipk
  ti-edma3lld-dev_01_11_00_03-r0.5_overo.ipk
  ti-edma3lld-sourcetree_01_11_00_03-r0.5_overo.ipk
  ti-edma3lld_01_11_00_03-r0.5_overo.ipk
  ti-framework-components-dbg_2_25_01_05-r1.5_overo.ipk
  ti-framework-components-dev_2_25_01_05-r1.5_overo.ipk
  ti-framework-components-sourcetree_2_25_01_05-r1.5_overo.ipk
  ti-framework-components_2_25_01_05-r1.5_overo.ipk
  ti-local-power-manager-dbg_1_24_01-r80d.5_overo.ipk
  ti-local-power-manager-dev_1_24_01-r80d.5_overo.ipk
  ti-local-power-manager-sourcetree_1_24_01-r80d.5_overo.ipk
  ti-local-power-manager_1_24_01-r80d.5_overo.ipk
  ti-lpm-module_1_24_01-r80d.5_overo.ipk
  ti-lpm-utils_1_24_01-r80d.5_overo.ipk
  ti-xdais-dbg_6_25_01_08-r1.5_overo.ipk
  ti-xdais-dev_6_25_01_08-r1.5_overo.ipk
  ti-xdais-sourcetree_6_25_01_08-r1.5_overo.ipk
  ti-xdais_6_25_01_08-r1.5_overo.ipk
  ti-xdctools-dbg_3_16_01_27-r2.5_overo.ipk
  ti-xdctools-dev_3_16_01_27-r2.5_overo.ipk
  ti-xdctools-sourcetree_3_16_01_27-r2.5_overo.ipk
  ti-xdctools_3_16_01_27-r2.5_overo.ipk

The individual bitbake files are these:

find ${OVEROTOP}/org.openembedded.dev/recipes/ | grep '\<ti\>' | grep bb | cut -d'/' -f3-99 | cut -d'_' -f1 | sort -u
org.openembedded.dev/recipes/
  firmwares/firmware-ti-wl1251.bb
  images/ti-codec-engine-test-image.bb
  images/ti-demo-x11-image.bb
  julius/ti-julius-demo
  tasks/task-gstreamer-ti.bb
  ti/am-benchmarks
  ti/am-sysinfo
  ti/bitblit
  ti/gstreamer-ti
  ti/matrix-gui
  ti/matrix-gui-common
  ti/matrix-gui-e
  ti/matrix-tui
  ti/ti-audio-soc-example
  ti/ti-biospsp
  ti/ti-biosutils
  ti/ti-cgt6x
  ti/ti-codec-engine
  ti/ti-codecs-dm355
  ti/ti-codecs-dm365
  ti/ti-codecs-dm6446
  ti/ti-codecs-dm6467
  ti/ti-codecs-omap3530
  ti/ti-codecs-omapl137
  ti/ti-codecs-omapl138
  ti/ti-devshell.bb
  ti/ti-dm355mm-module
  ti/ti-dm365mm-module
  ti/ti-dmai
  ti/ti-dspbios
  ti/ti-dsplib
  ti/ti-dsplink
  ti/ti-dvsdk-demos
  ti/ti-edma3lld
  ti/ti-framework-components
  ti/ti-linuxutils
  ti/ti-local-power-manager
  ti/ti-msp430-chronos
  ti/ti-sysbios
  ti/ti-xdais
  ti/ti-xdctools

Errors

If you try to compile from the default overo kernel (or your haven't cleaned your previous attempt of ti-xzy) you're likely to run into these errors:

bitbake ti-linuxutils
  |   CC [M]  /home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.o
  | /home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c:65:2: warning: #warning *** not a warning *** Note: LINUX_VERSION_CODE >= 2.6.26
  | /home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c: In function 'ioctl':
  | /home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c:1530: error: implicit declaration of function 'dmac_clean_range'
  | /home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c:1541: error: implicit declaration of function 'dmac_inv_range'
  | make[4]: *** [/home/tom/overo-oe/tmp/work/overo-angstrom-linux-gnueabi/ti-linuxutils-1_2_25_01_06-r80c/linuxutils_2_25_01_06/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.o] Error 1

According to the e2e forum it's possible to patch the kernel (essentially adding a http:// entry to the linux-omap3_2.6.33.bb (which has been removed, btw). The question remains: what replaces dmac_clean_range? and wouldn't it be better to patch cmemk with the update?, but judging by linux-ti-omap4 I'm guessing that the revert patch is pretty popular and perhaps the removal was premature.

Updated at 2010-08-16
blog comments powered by Disqus