• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » How to program in Linux to control LEDs?
Share
Linux
  • Forum
Options
  • Subscribe via RSS

Forums

How to program in Linux to control LEDs?

This question is answered
David Allen
Posted by David Allen
on Apr 08 2012 08:19 AM
Intellectual685 points

I'm working on OMAP L137. Now the evm is able to boot from nandflash and work properly. The DSPLINK samples also work properly.

How to get started with programming from gpp side, for instance, toggle LEDs?(Is there wiki on it?)

Linux OMAP Linux Drivers OMAP L-137 OMAP Linux gpp
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Norman Wong
    Posted by Norman Wong
    on Apr 08 2012 11:06 AM
    Guru14920 points

    Ti has some basics that is not specific to the OMAP-L137 on their wiki:

    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide

    There are lot of examples on this forum and the internet. For userspace, search for "/sys/class/gpio". The hard part is recompiling the Linux kernel to configure the pinmux for your LED. The TI wik has the same info as the setup packages and more. Maybe start here:

    http://processors.wiki.ti.com/index.php/Getting_Started_Guide_for_OMAP-L137

    The module where pinmux config is done for the OMAP-L137 EVM is usually

    arch/arm/mach-davinci/board-da830-evm.c

    Take care to avoid using a pin that is already being used by some other peripheral.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Allen
    Posted by David Allen
    on Apr 09 2012 02:40 AM
    Intellectual685 points

    Thanks for your response Norman.

    I'v read Getting_Started_Guide_for_OMAP-L137 already but it refered litte little about gpp programming.

    If I connect a CPLD with EMIFA, should I need writing driver for it? Can I read or write the CPLD  simply use "ioremap" and "iowrite(ioread)"?

    For instance:

            void __iomem *reg_virt = ioremap(physical_addr, num);

            iowrite32(command, regvirt);

            iounmap(reg_virt);

    Linux OMAP Linux Drivers OMAPL137
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Norman Wong
    Posted by Norman Wong
    on Apr 09 2012 10:39 AM
    Verified Answer
    Verified by David Allen
    Guru14920 points

    You should probably start as new thread for each question. I have feeling that you will get more answers that way. I believe the support guys loathe the "support user X forever" kind of threads.

    I've accessed a CPLD from the BIOS/DSP side. Never done it from the Linux/ARM side. Principles should be the same. Pinmux the EMIFA pins and set the appropriate EMIF CEnCFG config register. There is a some precedence on the Linux side with the NOR EMIFA driver. See EMIFA NOR code in

    arch/arm/mach-davinci/aemif.c
    arch/arm/mach-davinci/board-da850-evm.c
    drivers/mtd/maps/davinci-nor.c

    You are on the right track with the io API and the mapping of physical to virtual space. The davinci-nor.c uses the ioremap() to map a block of registers rather than one location. They will use raw_readl, etc. to access a location offset into the block.

    Note that EMIFA pins overlap badly with other peripherals. For me. the SD Card had to share the bus with the CPLD.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use