• 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 » Digital Signal Processors (DSP) » OMAP™ Processors » OMAP35x Processors Forum » Serial Ir (SIR) on AM3517
Share
OMAP™ Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Resources
  • OMAP-L1x DSP+ARM9™-based Processors Product Folder
  • OMAP3525/30 DSP+ARM Cortex™-A8-based SOCs Product Folder

  • Top OMAPL Wiki Links
  • OMAPL3x Schematic Review Checklist
  • OMAPL13x Boot resources

  • OMAPL Document Resources
  • OMAPL137 Technical reference manual
  • OMAPL138 Technical reference manual
  • OMAPL Boot loader App Notes
  • Forums

    Serial Ir (SIR) on AM3517

    This question is answered
    Daren Yeo
    Posted by Daren Yeo
    on Oct 26 2011 14:12 PM
    Prodigy210 points

    I have the AM3517 EVM board and need to convert the serial port to IrDA (raw serial) mode. UART3 is the only one which supports IrDA, so I will have to first move the console to one of the other UARTs.  I am having a hard time finding how to configure and use UART3 in IrDA mode via the embedded Linux.  Can anyone point me in the right direction?

    What I have found so far only references the IrDA stack (vs Serial Ir comm) or commands like these which do not seem to exist in Linux on the EVM: setserial, irattach, modprobe serial.  I have build the kernel to include IrDA and serial IrDA, so maybe I have things setup correctly, but simply do not know how to use it.

    Thank you for any advice.

    AM3517 irCOMM IrDA SIR serial Ir
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Daren Yeo
      Posted by Daren Yeo
      on Dec 01 2011 10:38 AM
      Verified Answer
      Verified by Anonymous
      Prodigy210 points

      [Self-answered]

      I am connecting the serial IR transceiver TFBS4711 to the AM3517 EVM using UART3.  This is not IrDA, but SIR-Free Format mode.

      I was successful by making the following changes:

      1) remove R254 from the bottom of the EVM. The EVM is designed to use UART3 for console or USB debug port for WiLan.  Since the ARM allows IR only on UART3, first the console must be moved off of UART3. Removal of R254 allows me to use UART3 for the external IR transceiver. See http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/416/p/142992/516956.aspx#516956

      2) add the following code to serial.c in the function omap_serial_init_port().  This sets the IR-mode bit in the ARM's UART module

       

       

      #if defined(CONFIG_IR_UART3) // i.e. SIR FF mode (Free Format)

      {

      struct plat_serial8250_port *p = dev->platform_data;

         struct plat_serial8250_port *uartp = uart->p;

       

      if (p->mapbase == OMAP_UART3_BASE)

      {

      u16 data;

      printk("Configuring UART3 for SIR-FF mode");

      data = serial_read_reg(uartp, UART_OMAP_MDR2);

      data |= (1<<3); // bit 3 is UART pulse shape

      serial_write_reg(uartp, UART_OMAP_MDR2, data);

      }

      }

      #endif

      3) add the .config entry for CONFIG_IR_UART3 and select it for configuring the kernel
      config IR_UART3
         default n
      bool "Enable IrDA on UART3"
      depends on MACH_OMAP3517NUPULSE
      default n
      help
       Say YES here to use UART3 for IrDA (or IrCOMM) purposes. Note: on the AM3517 EVM, hardware
       modifications (disabling the RS232 driver, U24) may be required to have UART3 work correctly.
      4) use J16 on the EVM to access the UART3 Rx/Tx signals
      5) plug in a USB cable from J41 to a Host (e.g. PC). This switches off the RS-232 voltage level chip.
      6) in user space code, send/receive data via ttyS2 using open/read/write calls

       

      AM3517 AM3517_EVM IR IRDA SIR TFBS4711
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RAJEEV BATTU
      Posted by RAJEEV BATTU
      on Aug 08 2012 09:53 AM
      Intellectual595 points

      Hi Daren Yeo,

      I am working on AM3517 controller, with 2.6.37 kernel.

      I am trying to configure uart3 as IrDA port. by your post i am able to get some idea how to configure and change code in serial.c

      But how can i change uart3 common serial port to IrDA port. as one should not configure uart3 in serial port and IrDA mode and also about platform data

      Any document for how to change serial ports.

      Thanks in Advance,

      Rajeev Battu.

      AM3517 2.6.37 IrDA UART3
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daren Yeo
      Posted by Daren Yeo
      on Aug 08 2012 13:54 PM
      Prodigy210 points

      My kernel is 2.6.33-RT31, but here is where I made the change. I created the CONFIG_IR_UART3 in the .config file, but you can hard code it if you need to.  Hope this helps

      void __init omap_serial_init_port(int port)
      {
      struct omap_uart_state *uart;
      struct platform_device *pdev;
      struct device *dev;

      BUG_ON(port < 0);
      BUG_ON(port >= ARRAY_SIZE(omap_uart));

      uart = &omap_uart[port];
      pdev = &uart->pdev;
      dev = &pdev->dev;

      omap_uart_enable_clocks(uart);

      omap_uart_reset(uart);
      omap_uart_idle_init(uart);

      list_add_tail(&uart->node, &uart_list);

      if (WARN_ON(platform_device_register(pdev)))
      return;

      if ((cpu_is_omap34xx() && uart->padconf) ||
      (uart->wk_en && uart->wk_mask)) {
      device_init_wakeup(dev, true);
      DEV_CREATE_FILE(dev, &dev_attr_sleep_timeout);
      }

      #if defined(CONFIG_IR_UART3) // i.e. SIR FF mode (Free Format)
      {
      struct plat_serial8250_port *p = dev->platform_data;
      struct plat_serial8250_port *uartp = uart->p;

      if (p->mapbase == OMAP_UART3_BASE)
      {
      u16 data;
      printk("Configuring UART3 for SIR-FF mode");
      data = serial_read_reg(uartp, UART_OMAP_MDR2);
      data |= (1<<3); // bit 3 is UART pulse shape
      serial_write_reg(uartp, UART_OMAP_MDR2, data);
      }
      }
      #endif

      /* omap44xx: Never read empty UART fifo
      * omap3xxx: Never read empty UART fifo on UARTs
      * with IP rev >=0x52
      */
      if (cpu_is_omap44xx())
      uart->p->serial_in = serial_in_override;
      else if ((serial_read_reg(uart->p, UART_OMAP_MVER) & 0xFF)
      >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
      uart->p->serial_in = serial_in_override;
      }

      AM3517 IR SIR UART3
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RAJEEV BATTU
      Posted by RAJEEV BATTU
      on Aug 09 2012 04:54 AM
      Intellectual595 points

      Hi Daren Yeo,

      Thank you for your reply. it really help me to understand about IrDA but i am unable to figure it out how to disable

      RS232 driver for com3.

      debug message on com0 

      [    0.489837] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
      [    0.492065] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a ANALOGICS OMAP UART0
      [    1.158966] console [ttyO0] enabled
      [    1.163146] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a ANALOGICS OMAP UART1
      [    1.171936] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a ANALOGICS OMAP UART2
      [    1.180908] at24 1-0050: 256 byte 24c02 EEPROM (writable)

      i had done what you have asked to, i had hard-codded CONFIG_IR_UART3

      When i am digging the kernel 2.6.37 i came across a function called omap_irda_config() from irda.h

      i am working around this one also.

      Thanks in advance,

      Rajeev Battu

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Daren Yeo
      Posted by Daren Yeo
      on Aug 09 2012 08:24 AM
      Prodigy210 points

      Rajeev Battu

      Be careful to understand the difference between raw IR (SIR in FF mode) and IRDA.  I needed raw IR for my device.  IRDA includes higher protocol-level support (i.e. ir stack) for communications with IRDA devices (PDAs, etc.). I do not know the answer to your exact question regarding disabling of the Com3 driver.  My 2.6.33 kernel version may be an important difference.

      AM3517 IR IRDA COM3
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RAJEEV BATTU
      Posted by RAJEEV BATTU
      on Aug 10 2012 01:08 AM
      Intellectual595 points

      Daren Yeo,

      Yes you are correct, there are lot of changes when compared between two kernel versions.

      Modifications for UART structure, omap_hwmod has come up and it quit hard to know where is the platform data for uart,

      i am trying to understand your code and implement accordingly in 2.6.37 kernel. what exactly are you doing is trying to configure

      uart3 in IR SIR mode. Normally UARt3 is configured as serial port and then changed to IR port. correct me if i am wrong.

      Thanks,

      Raheev Battu

      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