Wednesday, May 19, 2010

Beginners OMAP-L138 ARM Tutorial

Dear All Y'all

todays exercise: writing your very first program for the new, dual-core (one ARM9 core and one C6000 series DSP core), TI applications processor, the OMAP-L138. This simple tutorial is for the ARM core, and here are the boundary conditions:
  • Windows 7, 64-bit
  • Code Composer Studio 4.1.1 (with the free limited license)
  • Low-cost XDS100v2 USB Emulator 


First, create a new CCS project
 

...with no additional project settings (no reference projects). Use the following project setting


Now you will be looking at the CCS (eclipse) development environment main window. By right-clicking on the name of the project in the 'C/C++ Projects' tab, you can make and add a new C source file

Heres the main window.
The typed program is:
 ------------------------------------------------
#include "stdio.h"

void main( void )
{
    printf( "\tThe rain in Spain falls mainly on the plain.\r\n");
}


--------------------------------------------------
Right-click on the project, and 'Open Target Configuration' - make a new one!

Under the 'Basis' settings, set the connection as the 'Texas Instruments XDS100v2 USB Emulator', and the device as the OMAPL138.
Now, some of the 'advanced' settings will have to be set (click the tab on the bottom, or click on the 'Target Configuration' link). Firstly, you'll assign the OMAPL138_arm.gel file from logicPD as the initialization script for the ARM core (download this from LogicPD's website. Follow this link, click on the 'Kit Contents' tab, and then on 'OMAP-L138 SOM-M1 GEL, CCS Setup, & BSL Files' - registration required!). And then, the Arm9 Core must be set to Arm926 (important!).
Then, click on the top level in the list of all connections, and change the JTAG TCLK frequency to be adaptive with a limit of 1MHz. This step is necessary to use the XDS100v2 with the Arm9 core (which, as documented in the TI E2E forum and the embedded processors wiki, is a bit sketchy). Here is a link to info on the XDS100 from TI's wiki.

Next, you'll need to add a new linker command file to specify where the program will go in memory. Right-click on the project name, select New > File, and then use 'linker.cmd' as the file name.
The linker command file should contain this text. The shared RAM is used for this whole program. For more info on the memory map of the OMAP-L138, check the data sheet, or the .gel file.
----------------------------------------------------------------
-lrts32e.lib
-stack          0x00001000 // Stack Size
-heap           0x00001000 // Heap Size

MEMORY
{
  SHARED     org=0x80000000 len=0x00020000 // Shared RAM
}

SECTIONS
{
  .text :
  {
  } > SHARED
  .const :
  {
  } > SHARED
  .bss :
  {
  } > SHARED
  .stack :
  {
  } > SHARED
  .data :
  {
  } > SHARED
  .cinit :
  {
  } > SHARED
  .sysmem :
  {
  } > SHARED
  .cio :
  {

  } > SHARED
}


------------------------------------------------------

So, now select
Project >> Build Active Project.
then
Target >> Debug Active Target.
...and when the program is loaded, run the program with the little green run arrow, or by pressing F8. If everything worked, you'll see your message printed on the console!
Good luck, amigos!

3 comments:

  1. You saved my day!
    I have been looking all around on TI's wiki for an example like this.
    Now I just need to find out how to debug both the DSP and the ARM at the same time!

    Thanks, and happy holidays.
    Claus Knudsen

    ReplyDelete
  2. Thank u thank u thank u........
    hi plz post how to load the LED blinking code into the hawkboard.
    plz plz plz help me

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete