DSP Quick Start

If you're primarily interested in getting started in writing code for the DSP and would like to put off getting the ARM build environment and DSPLINK setup then this guide should help. This guide does not cover the "normal" case of writing DSP code that will interact with the ARM running linux, using the DSPLINK framwork.

Quick Start using JTAG emulator to load Application (No linux required)

If you are are solely interested in prototyping DSP code without IPC communication to the ARM or the ARM running linux, you can use a JTAG emulator such as the Spectrum Digital USB510 to download DSP code from Code Composer Studio. The idea is to allow the ARM to power up and boot up into u-Boot and stop. You can force u-Boot to not autoboot (if you get the 3 second countdown timer) by clearing the bootcmd variable with

U-Boot > setenv bootcmd "" 
U-Boot > saveenv

The factory programmed User Boot Loader and u-Boot are executed by the ARM and setup the memory and basic device interfaces. At this point the DSP is powered up and sitting in an IDLE spin loop, the external memory and EMIFA busses are configured, and the ARM is in a spin loop monitoring (polling) the UART console device. The ARM does not use any peripheral IRQ's in u-Boot. The DSP can be loaded (via JTAG) and run freely provided:

  1. It does not use the console port for terminal I/O
  2. It avoids the DDRAM region that the ARM is using to run u-Boot (0xc1000000-0xc1200000)
  3. You don't run any commands that would attempt to use peripherals or memory on u-Boot (the ARM) that your DSP software is using (i.e., don't run u-Boot commands while prototyping your DSP code).

At the moment, the main ARM and DSP CPU clocks are configured to run at 300 MHz out of cold boot. Increasing the CPU speed requires interfacing with the onboard PMIC to up the core voltage. This is normally done by a driver in the ARM linux code, so you'll need to scale your performance numbers up to assess 456 MHz operation as u-Boot does not have any provisions to increase the core voltage and/or main clock divisors.

We recommend that you use memory above address 0xC2000000 for DSP prototyping.

NOTE : another option to this procedure is to shutdown the ARM and tailor the DSP gel file to setup the RAM, PLLs, etc. from code composer manually. However, Critical Link does not provide a gel file that supports this mode of operation.

Quick Start using u-Boot to load a DSP application up and launch DSP (no linux required)

A recent patch to Critical Link's Das U-Boot Port for the MityDSP-L138F family of SOMs supports using the ARM u-Boot application to load and launch a DSP legacy common-object-file-format executable as generated by Code Composer Studio. This will effectively allow you do use a MityDSP-L138 module as if it were a MityDSP-6748 module; you can develop a full application using only the DSP core and use the DSP core to control/manage all of your peripherals. This may be desirable for folks that do not want to leverage linux or other OS's available for the ARM at this time, but may want to in the future.

This utility requires the coff image to be present in memory out of place, so that the loader can place the embedded sections in the correct locations. The utility command is "bootdsp [loadaddr]". When run, it will assume a coff a.out file is stored in memory at loadaddr. If a valid image is found, the coff file will be parsed and the necessary sections (text, data, etc) will be extracted and placed into memory. Once the sections are populated, the ARM will generate a reset vector in the base of shared memory (0x80000000) that issues a branch instruction to the entry point indicated by the coff image and enable/reset the DSP (which will start operation).

Note the u-Boot image that includes this feature is not yet included in any Board Support Package, so you'll need to build the image and flash it in (make sure to reset after you do!) until the image makes it into the production pipeline images at our manufacturer's location. A copy of a recent build of u-Boot that includes this feature is included on this page for convenience, but you should check for newer versions or consider building it yourself as we may not update this file with future u-Boot releases / improvements.

A typical load sequence from an NFS server at u-Boot would look like like the code below. Additional storage / retrieval options for SPI FLASH, NAND, SATA, MMC, serial load, and Network TFTP area also possible.

U-Boot > nfs c0700000 10.0.0.87:/path/to/dsp_program.out
U-Boot > bootdsp c0700000

DSP Implementation Notes for No-ARM operation

If you choose to use the DSP load-and-go technique from u-Boot, there are a couple of guidelines that you should consider for your DSP-only application:

  1. You do not need to do any low level memory initialization. The mDDR along with a fair amount of pin-mux setup for EMIFA, UART1, I2C, etc. is already configured by u-Boot.
  2. There are memory areas that should be avoided during load time. The u-Boot application, stack and heap, is running in DDR2 in the memory region 0xC10000000 through 0xC12000000. You will need to avoid loading code or the initial a.out file into this area of memory. Also, the bottom 128 bytes of memory of internal SRAM (0x80000000) are used for a temporary reset vector by the ARM, so you will need to avoid using this area for code in your .out file. Once the DSP is running, this memory may be reclaimed by shutting down or resetting the ARM core and setting up new reset vectors for the DSP.
  3. If you need to use the console UART, you should shut down the ARM code. See the Local Power and State controller section of the TI OMAP-L138 Technical Resource Manual for details.

Todo : add a DSP Hello World application here.

Quick Start using ARM/linux to load Application via DSPLINK

Required files

  • dsplinkk.ko
    • Can be found in the latest MDK release (MDK/images/modules/) or you can rebuild DSPLink. See details at DSP Link Configuration.
  • HelloWorld
    • The compiled ARM executable for the Hello World example. This code can be used to load the DSP. This code will also setup a debug DSPLink message queue that you can use to write debug messages to the console.
  • A compiled DSP .out file
    • See the second section of DSP_Hello_World for details on setting up a project to work with the supplied ARM executable.

Usage

  • See the last section of DSP_Hello_World for details on starting the application.
    • The ARM executable will load the supplied DSP .out file and will exit once 'q' has been entered on the terminal.
    • A debug queue is setup and will print debug messages to the terminal. See dsp_main.cpp in DSP_Hello_World for more details.
    • Debugging with the emulator can most easily be accomplished by adding an infinite loop in your DSP code:
      bool lbWaitForMe = true;
      while(lbWaitForMe);
      
      • Once you have broken in with the emulator and loaded the symbols for your code you can change the value of this boolean to exit the infinite loop and step through the desired portion of your code.

HelloWorld - HelloWorld ARM code to load DSP and wait for exit command (235 KB) Gregory Gluszek, 08/23/2011 02:17 pm

u-boot-ubl.bin - u-Boot flashable image containing bootdsp command (includes header required for UBL loading). (255 KB) Michael Williamson, 12/14/2011 11:31 am

u-boot.bin - u-Boot image containing bootdsp command (does not include UBL header, use for SPIwriter utility) (255 KB) Michael Williamson, 12/14/2011 11:31 am

Add picture from clipboard (Maximum size: 500 MB)