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 System-on-Chip at 430 MHz.
Documentation
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
- Main download website – The files below have been downloaded from this site
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
- codec_engine_2_23_01.tar.gz, TI Codec Engine 2.23.01 download (free TI account required)
- codec_engine_2_24_01.tar, TI Codec Engine 2.24.01 download (free TI account required)
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.
- ( dmai_setuplinux_1_20_00_06.bin, TI Direct Media Access Interface (free TI account required) )
PowerVR drivers
- omap35x_graphics_sdk_setuplinux_3_00_00_09.bin, TI OMAP35x Graphics SDK (free TI account and software form required)
Copy the files to the right destination
Change Permissions
Copy the files
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!
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
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.
BOOTin our tutorials). The Gumstix Overo will read the file and execute the commands at startup.
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
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
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.
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