2

I am trying to interface GSM module with my AM1808 processor. I am using gcc compiler as well as UBUNTU 10.04 Lucid.

I have configured the TXD and RXD pins of UART0 but i can not access the RTS and CTS pins properly.

Actually i need to check the RTS and CTS line for proper communication.
So I need to access this pins from the User Application.

How can I do this?

Anthon
  • 78,313
  • 42
  • 165
  • 222
Parthiv Shah
  • 171
  • 5

1 Answers1

2

Things I would check in approximate order:

  1. Ensure you're enabling the RTS/CTS functionality in your app. See tty_ioctl(4) for info on how to do this. There is an example at the end of the linked man page checking the DTR pin. Try cross compiling your code and running it on a PC where know CTS/RTS works (ie USB to serial converter)
  2. Check the output of stty as it can reveal if the control setting "crtscts" is enabled which enables handshaking:

    stty -F /dev/ttyO1
    
  3. Start digging through your kernel and bootloader to verify that the multiplexer for the pins you expect to use are configured for use by the UART peripheral as opposed to other peripherals (ie gpio, video, etc). Consult the TI Technical Reference Manual (TRM) or datasheet depending on where they put the mux info for your chip. The easiest way to verify this is to use a program like "devmem2" to read the multiplexer registers after you find the address from the TRM/DS. To fix this you need to determine whether your kernel or bootloader is responsible for the mux configuration. Sometimes it's both (sigh).

  4. Consider hardware issues, review the schematic. Are the pins actually hooked up?
  5. Continue digging through the kernel code to make sure the platform data is setup correctly. This will be under your kernel tree somewhere (I'd guess "arch/arm/mach-davinci/devices-da8xx.c"). There will be a number of structures that describe each UART. Make sure these are valid for the UART you are using. Additionally, for bonus points, sometimes people HACK in fixes in the wrong place, so those fixes could be buried almost anywhere else in the kernel tree... so look for those as a last resort. This is where it gets fun.

I'm not familiar with this exact chip, so I'm guessing at some of the kernel support files. Also not sure what kernel version you are using or where it came from (TI vs upstream).

2bluesc
  • 430
  • 3
  • 8
  • Thank you.I have properly configured the RTS as well as CTS pins in kernel. My Question is How I can access the RTS pin from User Application ? Is there any way to access it like using Addressing of GPIO or like that ???? – Parthiv Shah May 15 '13 at 20:48
  • The tty_ioctl(4) man page originally linked describes how to do this using TIOCMSET and TIOCMGET ioctl and the bits are TIOCM_CTS and TIOCM_RTS. – 2bluesc May 17 '13 at 06:52