This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP-L138 LED Control

Other Parts Discussed in Thread: OMAP-L138, OMAP-L137, CCSTUDIO

I've been working for several weeks now with an OMAP-L138 EVM kit and am trying desperately to get a code-set to do something I can measure, specifically turn on/off one of the user LEDs.  So far, I've been spectacularly unsuccessful at this.  I've taken several avenues, none yet have yielded results:

1.  I have a basic chardev kernel driver that takes command buffers from a user-level application.  I'd like to light the LED every time I process a driver command to see what the turn-around time is between USER and KERNEL space.  I've pulled in some code from the GPIO example code provided with the EVM starter kit:  .../OMAP_L138_arm_1_00_00_06/DaVinci-PSP-SDK-03.20.00.06/src/examples/examples-03.20.00.06/gpio, and my kernel driver can read the state of S7-P8, but can't find the "memory map" to find the corresponding bit position of the USER_LED.

 

2.  I have followed the directions for building the SDK and have successfully run the "loop" example 10,000 times. 

http://tiexpressdsp.com/index.php/Building_The_OMAP-L137_SDK

It took about 17 seconds to run (hand-measured with stopwatch), saying it takes about 1.7ms to turn a DSP-Link message around from the ARM to the DSP and back.  Not sure if that is good or bad.  I'd like to be able to steal some of the source from the PC-side LED-DIP example:

C:\CCStudio_v3.3\boards\evmomapl138_v1\tests\experimenter\led_dip

so that I can turn the LED On or Off in the DSP loop code whenever it processes a message to get a better picture of the min/avg/max timing of the loop, but the header files and LED access methods (I2C/GPIO) don't seem to be present on the Linux-based DSP code.

3.  The only mechanism I have been able to use to toggle the LED is the CCStudio LED-DIP example (above) running directly from CCS.  This does very little except give me a "control" data point of the absolute fastest LED control available in an isolated system.

Long story short: I'm stuck.  I'd like to be able to access the User LEDs directly from the following three places:

Linux-Based User-App

Linux-Based Kernel Driver

DSP-Link-spawned DSP code (i.e., from the DSP code that is downloaded by the ARM Linux loop code)

Further, does a high-level programmer's memory map for the EVM I/O exist for each platform?  Either that, or a high-level guide to the header files to start investigating to find the answers?

  • More information on #1 above.  It turns out I can't modify the GPIO code that reads S7-P8 to access the LED, because S7-P8 really is accessed from a GPIO pin directly on the OMAP.  S2 is the switch that is read from the I2C port along with the LED write capability.  So to get route #1 above to control the LED, I need to start looking for I2C driver code examples.  Any thoughts on that from the ARM/Linux perspective?

  • Never mind about #1 above, I got it.  I found web example ioctl interface for my user-level app and hacked it to gain control of the S2 Switch and LEDs.  I have some clean-up to do on the code, but I think I can share the source file if anybody is interested.

  • Hello,

    The DSPLink message sample has some in-built profiling which you can use for your measurements.

    Do you have the DSP code to turn the LED on and off? If so, you can integrate it in the DSP code, remove the DSPLink API's from the loop on both ARM/DSP and do your measurement.

    Deepali

  • hello dswag89

         I m interested in your code. Can you share it with me. My id is arindam2ghosh@gmail.com

    Thanks & regards

    Arindam Ghosh

  • Hi dswag89!

    can you too share the code to me. I am also trying to profile my application but without any succuess. Your help would mean a lot to me.

    My e-mail is ktmpole@gmail.com

     

    Thanks

    PPoudel

  • Hi dswag89!

    I'm also interested in your code. Can you please share the code to me too?

    My e-mail is ailson.rosetti@gmail.com

    Thank you,

    Ailson Rosetti

  • dswag89 said:
    I have some clean-up to do on the code, but I think I can share the source file if anybody is interested.

    Since there have been a few people requesting the code, if this is something you can share publicly, you can attach it to a post in a zip file, or to your E2E community profile, that way you don't have to email people the code directly. If you have trouble attaching the code to the community site just let me know and I can help.

  • Sorry folks, I haven't been totally ignoring you.  I've been weathered in, here in the Mid-Atlantic Region of the US!  I've attached i2c_app.tar.gz.  It should be pretty easy to implement.  Compile on your Linux host, copy to the root of the NFS-mounted file system, and run.  It has been too long since I looked at this code (just grabbed the gzipped-tar and attached) to remember what it really does or how it terminates, but it is a simple app to build around.  Hope it helps.

    i2c_app.tar.gz
  • Just realized, I put a copy of this in my profile as well.  Sorry I didn't realize that last week when the requests started coming in for copies!

  • Wow, your I2C sample worked like a charm. I am so glad I found it, you just saved me a boatload of time.

    Check12