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.

RS-485 transceiver control by omap-serial driver

From what I can see the standard omap-serial driver that comes with the SDK kernel does still not support switching RX/TX direction of a RS-485 transceiver.

As there might be "solutions" like https://gitorious.org/am335x/linux-am33x/commits/35146e0 I would like to know if there are any plans by TI for the near future to add support for transceiver control to the standard omap-serial driver?

After all the AM335x SOCs are supposed to be used in an industrial environment where RS-485 is quite well know and used with many different custom or standard protocols. Transceiver switching support in the standard driver would release developers from reinventing the wheel and patching kernels.

with kind regards, Felix

  • Did you found a solution for your problem?

  • Hello Jerome,

    The solution would be TI fixing this.

    As there don't seam to be plans to do so I too did reinvent the wheel. I patched the driver according to my needs. It switches the RS-485 transceiver withe the RTS signal now. Everything works fine, I tested up to 400 kBps.

    regards Felix

  • Hello Felix,
                    I am also looking for RS485 support with RTS signal. Can you post your driver for reference??
    Thanking you.

    Regards ,

    Kishor

  • Hello Kishor,

    I could post the code but I won't. The reason for this is that the code is currently an ugly hack without any explanations on what is going on. It has been tested and it works, no more then that. If I would post the code I am sure I would get lots of questions which I can not answer (time) for now.

    I am very sorry, Felix

  • Hello Felix,

                     Thank you for quick reply. I will not ask any question to you. I am very needful for this code.
    Please , If you can think once again for my polite request.

                      Thanking you.

    Regards,

    Kishor

  • Hello Felix,

                       Now my driver code is also working with RS485 support.  :-)

                       Thanking you.

    Regards ,

    Kishor
                     

  • Excellent! Glad you found a solution without my ugly hack.

    I truly hope TI will integrate this function in the standard driver in the near future. This would save us all from patching the driver over and over again for each new SDK release.

    regards Felix

  • Hi Kishore,

             I am also in need of this code, can you share the code or please direct me,

    How can omap_serial driver works for RS485 communication

    Regards,

    Rajeev.

  • Hello Rajeev,

                           I would like to share my code with you, but it is not properly commented. And its just working for me, but I still want to test it with all error possibilities. Sorry, I cant give you code but if you really intrested follow the foolowing steps..

    1) You have to study device tree structure, and should understand how to configure a gpio with your driver.

    2) Set one GPIO pin as output pin in device tree.

    3) After that configure that GPIO pin as your RTS pin which should be used by omap_serial.

    4) Maintain a structure which will contain all the flags settings for RS485.

    5) Read the omap_serial.c code and understand it.

    6) Then change the start_tx and stop_tx function as per requirement to toggle the RTS pin.

                    I hope you will get idea from this steps. Have a nice coding.

    Regards,

    Kishor

  • Hi Kishore,

       I will try your code once, no problem with comments.

    Please send it to my mail id rajeev.battu@gmail.com

    Regards,

    Rajeev.

  • Hi Kishor,
    I am also facing same sort of issue. So can you please share me the patch to deepakvijay2255@live.com