titusece
Posts: 69
Joined: Sat Sep 10, 2016 3:24 pm
Location: India

RS485 support in raspberry pi

Mon Feb 25, 2019 5:56 pm

Hello,
I have raspberry pi3 compute module board and want to interface RS485 via GPIO14 & GPIO15.
We developed add-on board using IC485 transceiver, connected TXD and RXD to DI & RO pins, and also we connected RE and DE pins to two different GPIOs.
Can you please tell us how we can perform the RS485 tx & rx in full duplex mode ? any driver change ?

I have used the same RS485 circuit in our another ARM board and used the following dts code, it worked.

Code: Select all

    rts-gpio =  <&gpio0 22 0>; //RE pin
    rs485-rts-delay = <0 0>;
    enable-active-high;
    rs485-rts-active-high;
    linux,rs485-enabled-at-boot-time; 
2) Can we use the following patch ?
https://www.spinics.net/lists/arm-kernel/msg597518.html

Can you please suggest on this?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13009
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: RS485 support in raspberry pi

Wed Feb 27, 2019 4:40 pm

That patch hasn't been merged, and didn't seem to gain any review comments at all either.
You can apply it add build your own kernel. but I'll agree with the author's comment that sleeping in an interrupt context is not good practice.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.


Return to “Troubleshooting”