How to build an ARM/DSP Hello World program on the DaVinci EVM

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

This tutorial addresses those who have only got the DaVinci DM6446 EVM without any expensive JTAG device and want to build a very easy DSP program that can be invoked within Montavista linux on the arm side. I wrote this tutorial because I had to search, post in newsgroups and edit Makefiles for a whole week only to make the DSP send the ARM a simple "Hello, World!" message.

Once you have established a working toolchain to the ARM and the DSP, writing more interesting programs (ie fourier transform) should be very easy.

Contents

What you need

Overview

TI basically wants you to understand the DSP as a blackbox. Or, if you are a codec engineer, use the Codec Engine framework to design codecs. In the former case, you only develop on the ARM, in the latter, you buy an expensive JTAG debugger and work directly on the DSP. Both ways do not allow you to write a simple program that uses both ARM and DSP (within a restricted period of time). But you need both in order to take advantage of the main strength of the DaVinci: the interaction between ARM and DSP. Besides both toolchains, you also need means for sending messages between both processors (rather than simply writing into common memory). Dsplink is a library (and kernel module for montavista) that offers you exactly these functions.

Building the Dsplink on arm-linux

After you have installed all programs from the CDs, the Dsplink is located somewhere in ~/dvevm_1_20/dsplink_1_30/packages/dsplink and can be compiled as described on page A-17 in the "Getting Started" guide.

IMHO, it is easier to have the arm toolchain directly on the arm target. Later, you have to develop the DSP binaries in windows and thus don't need to switch between windows and linux host all the time. For this, you need make the kernel headers available to the EVM, i.e. copying /opt/mv_pro_4.0/montavista/pro/devkit from the linux host to the target /opt. Of course, you also copy ~/dvevm_1_20/dsplink_1_30/packages/dsplink to the EVM (i.e. into /opt). After that, you edit the Makefile dvevm_1_20/dsplink_1_30_08_02/packages/dsplink/make/Linux/davinci_mvlpro4.0.mk (on the arm-linux target)

BASE_BUILDOS	:= /opt/devkit/lsp/ti-davinci
BASE_CGTOOLS    := /usr/bin
OSINC_PLATFORM  := /usr/lib/gcc/armv5tl-montavista-linuxeabi/3.4.3/include
OSINC_TARGET    := /usr/include
BASE_OSLIB      := /usr/lib

recompile a utility needed for the build

  cd /opt/devkit/lsp/ti-davinci/scripts/mod
  gcc -o modpost file2alias.c modpost.c sumversion.c

set the environment variable

  export DSPLINK=/opt/dvevm_1_20/dsplink_1_30/packages/dsplink

and run the configuration script (see Dsplink User Guide)

  cd $DSPLINK/etc/host/scripts/Linux
  ./dsplinkcfg

Important: Select Windows as Dsp/Bios OS and remember the other selections.

Now you can run the build

  sh -f buildmodule.sh

or, alternatively, build the samples

  cd $DSPLINK/gpp/src/samples
  make -s release

Building the Dsp binaries

At first, copy the dsplink folder from your linux to your windows host, i.e. C:\dvevm_1_20\dsplink_1_30_08_02\packages\dsplink.

From now on, we work on the windows host. You need to install

Copy C:\Mingw\mingw32-make.exe to gmake.exe so your Mingw can understand the gmake command.

Create the folder C:\ti-tools\bios,

Run the cmd shell (Start->Run->cmd)

  set DSPMAKE_Makefile=Makefile
  set DSPLINK=C:\dvevm_1_20\dsplink_1_30_08_02\packages\dsplink
  set PATH=C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Mingw\bin

and the configuration script

  cd %DSPLINK%\etc\host\scripts\msdos
  dsplinkcfg.bat

and select exactly the same as in the linux configuration script.

Now you should be able to compile C files for the DSP using the Dsplink library

  cd %DSPLINK%\dsp\src\samples
  gmake -s release

or even rebuild the DSP side of the Dsplink library

  dspmake Davinci Release libs all


Run a sample

In order to run the sample application readwrite, you need

The example writes 1kB to a DSP memory address, the DSP multiplies each Byte with the test case number, the arm reads and checks the result. If anything goes wrong, it will print a message.

  ./readwritegpp readwrite.out 0x8FFF0000 1024 2
E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article How to build an ARM/DSP Hello World program on the DaVinci EVM here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox