Version 10 (modified by ravishi, 4 years ago)

Moved original instructions to BeagleBoard_CodecEngine. These instructions are for using compiling DSPLink applications from source.

[Page in development]

DSPLink Command Line Compiling

Introduction

There are two main ways of compiling applications for TI's DSPs. One of which is Code Composer Studio, a full development studio to compile DSP applications. The drawbacks of this option is the high software licensing cost and that it is only compatible with Windows. A second option is to compile applications through command line using freely available tools from TI such as the Code Generation Tools. This has the advantage of compiling applications on a wide variety of host OS machines including Linux and Windows. Additionally the software needed is free on TI's website after registering.

This guide will walk you through setting up your host system to compile applications from command line on a Linux machine (Ubuntu). Please see TI's UserGuide? for full instructions on how compile other host systems or for more advanced settings.

Note: This guide was created after going through the steps of bitbaking and installing TI Codec Engine. If you are starting freshh without Codec Engine, some instructions may not match up.

Downloading and Installing Required Files

There are multiple files needed to begin building applications in DSPLink. Registration at the TI website is needed for all files from TI and the user license(s) must be accepted.

Download the DSP/BIOS Link. I used version 1.61.03 for linux.  http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent//link/index.html

Untar the file to your home directory. Assuming you downloaded dsplink_1_61_03.tar.gz to you Desktop, enter the following commands.

$ cd ~/
$ tar xvzf ~/Desktop/dsplink_1_61_03.tar.gz

Arm Toolchain

Download the Arm Toolchain which contains a lot of useful tools for compiling on an Arm processor. Although it included arm cross compilers, we will be using the cross compilers created by our OpenEmbedded? build. Select target platform as ARM GNU/Linux and the Host platform as IA32 GNU/Linux. Make sure not to select the source option.  http://www.codesourcery.com/sgpp/lite/arm/releases/2008q1

Untar the tar.bz2 file to your home directory.

$ cd ~/
$ tar xvjf ~/Desktop/arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Linux Kernel

A Linux Kernel is needed to compile DSPLink applications. The linking Kernel must be the same version or a compatible version with the Kernel on the BeagleBoard.

Note: The Installation Guide uses a Linux kernel that produces problems when compiling for the BeagleBoard. The problem is a build issue with the .tmp_vmlinux1 file using function omap3_beagle_map_io. Below is the error that is encountered when building the kernel. arch/arm/mach-omap2/built-in.o: In function `omap3_beagle_map_io': /home/ossie/omap3530/arm-2008q1/arch/arm/mach-omap2/board-omap3beagle.c:450: undefined reference to `omap2_set_sdram_vram' make: *** [.tmp_vmlinux1] Error 1

Fortunately, our OpenEmbedded? build created enough of a kernel to use for compiling DSPLink. This kernel is located at ~/oe/tmp/staging/. Therefore, there is nothing to download as long as the OpenEmbedded? process was followed.

DSP/BIOS, XDCTools, and C6x compiler

You will need to download and install three binary files: C6x Compiler, DSP/BIOS Link, and XDCtools.

The latest versions of the three files might work just fine but I have not tested them. The versions I used to get it working, as suggested by various forums, were:

TI frequently updates their site so searching for these files may be required. A newer version of BIOS 5.33.02 should be tested since this version has a Critical 283xx (28x floating point) bug.

Once all three are downloaded, change permissions of each .bin file to make it an executable like such:

$ cd ~/Desktop
$ chmod +x bios_setuplinux_5_33_02.bin

Run the binary file to open a graphical installer

$ ./bios_setuplinux_5_33_02.bin

Do this for all three binaries.

Install the files to a folder TI under your home directory. The installation of each binary file should be located as such:

  • BIOS 5.33.02 -> $HOME/TI/bios_5_33_02
  • XDCtools 3.10.03 -> $HOME/TI/xdctools_3_10_03
  • C6x Compiler -> $HOME/TI/cg6x_6_0_16

Local Power Manager

Download the Local Power Manager (LPM). I used LPM version 1.23.01 which can be found at  http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent//linuxutils/linuxutils_2_23/index.html . Untar the file in your TI directory and then untar ti_bios_power,omap3530.tar.

$ cd ~/TI
$ tar xvf ~/TI/local_power_manager_1_23_01/packages/ti/bios/power/ti_bios_power,omap3530.tar
$ cd omap3530/lpm

Optional - Platform Support Package

Download the OMAP35x Platform Support Package (PSP) from TI's website. Download release 02.01.01.08.  http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent//psp/omap35x/index.html

root@beagleboard:~# cd /lib/modules/2.6.29-omap1/kernel/drivers/dsp/

Configuring Makefiles

There are a number of directories DSPLink looks for when compiling. To tell DSPLink where to find these, there are three make files that need to be tailored to your environment. The three files that need to be changed are:

  • GPP side distribution file: $DSPLINK/make/Linux/omap3530_2.6.mk
  • GPP side distribution file: $DSPLINK/gpp/src/Rules.mk
  • DSP side distribution file: $DSPLINK/make/DspBios/c64xxp_5.xx_linux.mk

If you have followed the previous steps of installing all other files without changing the directory locations, you can use the custom versions of these files I created and attached to this wiki. They can be found at the bottom of the wiki. It would be best to not replace your existing files with these files and instead, compare the two files and note the differences. If any folder locations do not match up, fix them.

Building DSPLink Files

When working with DSPLink, it is necessary to set an enviroment variable for the DSPLink directory. You can use the second command to add it to your default terminal shell.

$ export DSPLINK=$HOME/dsplink_1_61_03/dsplink
$ echo export DSPLINK=$HOME/dsplink_1_60/dsplink >>$HOME/.bashrc

Everything should now be set up to compile your sample applications. To do this, you will need to compile the GPP source API, the GPP/DSP source code, and the GPP/DSP samples. If you receive any errors, check your three makefiles for the correct directory locations.

$ cd $DSPLINK/gpp/src/api
$ make -s clean
$ make -s debug
$ make -s release
$ cd $DSPLINK/gpp/src
$ make -s clean
$ make -s debug
$ make -s release
$ cd $DSPLINK/gpp/src/samples
$ make -s clean
$ make -s debug
$ make -s release
$ cd $DSPLINK/dsp/src
$ make -s clean
$ make -s debug
$ make -s release
$ cd $DSPLINK/dsp/src/samples
$ make -s clean
$ make -s debug
$ make -s release

The GPP side executables will now be in $DSPLINK/gpp/export/BIN/Linux/OMAP3530 and the DSP side executables will be in $DSPLINK/dsp/export/BIN/DspBios/OMAP3530/OMAP3530_0. Both DEBUG and RELEASE executables are built. Also, a dsplinkk.ko module has been built which you can replace the existing module. Make a backup of the existing module. Copy these files to your target. In the code below, I have copied the DEBUG version of the dsplinkk.ko only and only the message executable.

$ mkdir ~/TI/moduleBackups
$ sudo cp <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/dsplinkk.ko ~/TI/moduleBackups
$ sudo rm <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/dsplinkk.ko
$ sudo cp $DSPLINK/gpp/export/BIN/Linux/OMAP3530/DEBUG/dsplinkk.ko <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/
$ sudo mkdir <target>/usr/share/ti-dsplink/cmd_compiled
$ sudo mkdir <target>/usr/share/ti-dsplink/cmd_compiled/DEBUG
$ sudo mkdir <target>/usr/share/ti-dsplink/cmd_compiled/RELEASE
$ sudo cp $DSPLINK/gpp/export/BIN/Linux/OMAP3530/DEBUG/messagegpp <target>/usr/share/ti-dsplink/cmd_compiled/DEBUG
$ sudo cp $DSPLINK/gpp/export/BIN/Linux/OMAP3530/RELEASE/messagegpp <target>/usr/share/ti-dsplink/cmd_compiled/RELEASE
$ sudo cp $DSPLINK/dsp/export/BIN/DspBios/OMAP3530/OMAP3530_0/DEBUG/message.out <target>/usr/share/ti-dsplink/cmd_compiled/DEBUG
$ sudo cp $DSPLINK/dsp/export/BIN/DspBios/OMAP3530/OMAP3530_0/RELEASE/message.out <target>/usr/share/ti-dsplink/cmd_compiled/RELEASE

Building LPM Modules

$ cd omap3530/lpm
$ gedit Makefile

Find the lines similar to and add the following below it.

#LINUXKERNEL_INSTALL_DIR = _your_kernel_installation_
#MVTOOL_PREFIX = _your_codegen_installation_and_name_prefix_
#DSPLINK_REPO = _your_dsplink_repository_
LINUXKERNEL_INSTALL_DIR = ${HOME}/oe/tmp/staging/beagleboard-angstrom-linux-gnueabi/kernel
MVTOOL_PREFIX = ${HOME}/oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-
DSPLINK_REPO = ${HOME}/dsplink_1_61_03/

Now perform make and it will create the lpm_omap3530.ko module needed. Remove any existing lpm module and then copy this module to the target in the proper modules location. You may want to backup the existing lpm module if it exists. In the code below, replace <target> with the location of your target files system, i.e. /media/disk-1 if SD card.

$ make
$ sudo cp <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/lpm_omap3530.ko ~/TI/moduleBackups
$ sudo rm <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/lpm_omap3530.ko
$ sudo cp lpm_omap3530.ko <target>/lib/modules/2.6.29-omap1/kernel/drivers/dsp/

You will also need the lpmON and lpmOFF executables to reset the DSP. They have already been built for use on the omap3530. There are both DEBUG and RELEASE versions so you can copy both sets if unsure.

$ cd <target>/usr/share/ti-dsplink/
$ mkdir lpm
$ cd lpm
$ mkdir DEBUG
$ mkdir RELEASE
$ cp ~/TI/local_power_manager_1_23_01/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/debug/lpmON.x470uC ./DEBUG
$ cp ~/TI/local_power_manager_1_23_01/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/debug/lpmOFF.x470uC ./DEBUG
$ cp ~/TI/local_power_manager_1_23_01/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/release/lpmON.x470uC ./RELEASE
$ cp ~/TI/local_power_manager_1_23_01/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/release/lpmOFF.x470uC ./RELEASE

Running and Executing Samples

Attachments