OMAP35x DSPLink and OpenEmbedded Tutorial

The TMS320C64x+ is a DSP core used in several Texas Instruments ICs. It is fixed point and runs in the OMAP 35x CPU at 430 MHz.

<box red 60% round left>:!: Gumstix Overo is now supported by the default OpenEmbedded DSPLink version.</box>


Documentation





<box red 80% round>This tutorial is only useful if you just want to download and compile DSPLink code. For developing your own application, we heavily recommend to read our OMAP3 DSP Toolchain page. It provides installation instructions for Linux and Windows and will get you started easily.</box>



OMAP35x/36x DSPLink and Codec Engine

DSPLink is a library which handles the communication between the different cores (e.g. ARM Cortex-A8 and TMS320C64x+ DSP) on the OMAP35x SoC. The Codec Engine is a codec library accelerating various multimedia codecs with the onboard DSP.

:!: Much more detail about this API can be found on this page: DSPLink API Guide.

Download the required files

Download these files to a convenient location, e.g. '~/Desktop' (Ubuntu/Firefox default).

Texas Instruments does not grant public access to these files. The access to the copies on this server is therefore restricted to our team. However you can obtain these files yourself directly from TI by signing up for a free TI account. You can download them right after you registered with their site.

Main Download Website

The left files can be downloaded directly by the team, please use the link on the right for public access (free TI account required).
Save these files in the ~/oe/sources directory. The last known working combination is shown in bold:

Core Toolchain

Core Libraries

DSP Link

Once downloaded, you might have to generate the md5 checksum, so OpenEmbedded accepts the files. You can do that in the terminal. E.g for the file 'bios_setuplinux_5_33_04.bin' the command would look like this:

md5sum bios_setuplinux_5_33_04.bin > bios_setuplinux_5_33_04.bin.md5

Media Codec Engines and APIs

Needed only for building the ti-dmai recipe which is not included in the pixhawk images.

PowerVR drivers

Copy the files to the right destination

Change Permissions

FIXME

Copy the files

FIXME

Copy the files downloaded before to your OpenEmbedded directory, e.g.:

~/oe/org.openembedded.dev/recipes/
 
 
You can now build dsplink both for Gumstix Overo Water/Fire as well as for BeagleBoard with this command:
 
<code bash>
bitbake ti-dsplink-module

This will build the dsplink module as well as the dsplink applications.

For building TI codec-engine, type

bitbake ti-codec-eninge

And for the cmem module

bitbake ti-cmem-module

And if you want to have it included in the deployment files, use the pixhawk image:

bitbake pixhawk-dsp-console-image

for the console image or

bitbake pixhawk-dsp-desktop-image

for the desktop image.

u-boot Settings

The u-boot memory settings have to be adapted to reserve memory for DSPLink.

Note: The amount of memory wich hast to be reserved for Linux depends on the chosen memory mapping. Don't miss to have a look at the DSPLink Memory Map Tutorial!

<box green 80% round>Enter u-boot by hitting any key on your keyboard during the first seconds of the boot process. (This is not necessary when using the boot.scr file for Gumstix Overo as described below)</box>

See the current settings

Use the printenv command to print all environment variables. They are defined differently between BeagleBoard and Gumstix Overo, so one has to take care to changes in the right places.

printenv bootargs

BeagleBoard

The BeagleBoard needs slightly changed boot arguments for DSP use.

  • Bootargs: mem=80M
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3 mem=80M video=omapfb:vram:2M,vram:4M'
saveenv
reset

Overo Water

The boot arguments for Overo have to be adjusted to use the DSP. Adding mem=200M to the bootargs is sufficient. Please note that this is completely different from the way BeagleBoard sets the boot arguments.

Set the bootargs at each boot time by boot.scr file

<box red round 80%>Gumstix uses a boot.scr file in the root boot partition where u-boot commands can be stored. This allows to set the DSP variables without writing to the board's NAND memory. The commands below set the boot arguments permanently (however they can be overwritten any time)</box>

FIXME DOES NOT WORK YET!

Install uboot-mkimage if not yet present:

sudo apt-get install uboot-mkimage

Then create the boot.scr file from a regular text file containing the commands:

setenv bootargs console=${console} mem=126M video=${videospec},mode:${videomode} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
boot
mkimage -T script -C none -n 'PIXHAWK DSP: 126M Linux' -d pixhawk-boot-dsp.txt boot.scr
  • boot.scr – Copy this file to your boot partition (e.g. BOOT in our tutorials). The Gumstix Overo will read the file and execute the commands at startup. FIXME Has to be verified.

DSPLINK: Set the bootargs permanently by entering them in the u-boot shell

This restricts Linux to 126 MByte RAM and leaves the rest for the DSP.

setenv mmcargs 'setenv bootargs console=${console} vram=${vram} mem=126M omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait'
 
saveenv
reset

FIXME Testing

Default settings

Use this to reset to the defaults

setenv mmcargs 'setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait'
saveenv
reset

FIXME More testing:

bootcmd=if mmcinit; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run nandboot; fi; fi; else run nandboot; fi
bootdelay=5
baudrate=115200
loadaddr=0x82000000
console=ttyS2,115200n8
vram=12M
dvimode=1024x768MR-16@60
defaultdisplay=dvi
mmcargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
nandargs=setenv bootargs console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=/dev/mtdblock4 rw rootfstype=jffs2
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
bootscript=echo Running bootscript from mmc ...; autoscr ${loadaddr}
loaduimage=fatload mmc 0 ${loadaddr} uImage
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000 400000; bootm ${loadaddr}

Load the Kernel Module

Note: The parameters for loading the CMEM module depend on the chosen memory mapping as well as individual needs. Don't miss to have a look at the DSPLink Memory Map Tutorial.

The commands below can be either loaded as shell script or can be just copied into the shell.

FIXME We will provide a shell script soon which loads DSPLink automatically at system startup (Hint: add script to /etc/init.d, add symlink to /etc/rc*, something like 60-start-dsplink)

Gumstix Overo / BeagleBoard rev. C2 (256 MB RAM)

# insert CMEM driver, using one block of memory
#
# Note: phys_end = (addr + 1)
#
# block 0: 0x8C900000 - 0x8D8FFFFF (16 MB), External Memory
# pool:    80 KB, 20 x 4 KB buffers
# pool:  1280 KB, 10 x 128 KB buffers
# pool:  2048 KB, 2 x 1 MB buffers
# heap: 12976 KB, (~12.67 MB)
#
insmod cmemk.ko phys_start=0x8C900000 phys_end=0x8D900000 pools=20x4096,10x131072,2x1048576
 
 
# insert DSP/BIOS Link driver
#
insmod dsplinkk.ko
rm -f /dev/dsplink
mknod /dev/dsplink c `awk "/dsplink/ {print \\$1}" /proc/devices` 0
 
 
# insert Local Power Manager driver
#
insmod lpm_omap3530.ko
rm -f /dev/lpm0
mknod /dev/lpm0 c `awk "/lpm/ {print \\$1}" /proc/devices` 0

BeagleBoard Rev. B (128 MB RAM)

# insert CMEM driver, using one block of memory
#
# Note: phys_end = (addr + 1)
#
# block 0: 0x85000000 - 0x85FFFFFF (16 MB), External Memory
# pool:    80 KB, 20 x 4 KB buffers
# pool:  1280 KB, 10 x 128 KB buffers
# pool:  2048 KB, 2 x 1 MB buffers
# heap: 12976 KB, (~12.67 MB)
#
insmod cmemk.ko phys_start=0x85000000 phys_end=0x86000000 pools=20x4096,10x131072,2x1048576
 
 
# insert DSP/BIOS Link driver
#
insmod dsplinkk.ko
rm -f /dev/dsplink
mknod /dev/dsplink c `awk "/dsplink/ {print \\$1}" /proc/devices` 0
 
 
# insert Local Power Manager driver
#
insmod lpm_omap3530.ko
rm -f /dev/lpm0
mknod /dev/lpm0 c `awk "/lpm/ {print \\$1}" /proc/devices` 0

Check DSPLink

Load the modules on the single board computer and then test the example applications:

cd /usr/share/ti-dsplink
./loadmodules-ti-dsplink-apps.sh

Message example

./messagegpp

@USER@

Project

Related Sites

Micro Air Vehicles

2009-2011 System

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported