omap serial driver rs485 loopback

52 views
Skip to first unread message

Pablo Rodriguez

unread,
Aug 27, 2018, 11:53:06 AM8/27/18
to BeagleBoard

Hi,
I'm using omap serial driver to do some rs485 writing and reading. The rts gpio is toggling correctly and the RE pin is grounded, so rx is always enabled.
Have done test with other rs485 board and it can write and read.

The issue is that the uart is not receiving what it has wrote, so can't check if a bus collision occurs when writing.
 I have been using the same setup with the 8250 serial driver but with manual rts toogling and the loopback was ok.

Is this the expected behavior of the omap serial driver?
Is possible to configure to enable loopback?

using kernel
4.14.63-bone16

Thanks,
Pablo

Pablo Rodriguez

unread,
Aug 27, 2018, 12:01:52 PM8/27/18
to beagl...@googlegroups.com
looking in the source of the driver found this.

if ((up->rs485.flags & SER_RS485_ENABLED) &&
!(up->rs485.flags & SER_RS485_RX_DURING_TX))
serial_omap_stop_rx(port);

suppose that i need to set this flag.
SER_RS485_RX_DURING_TX

This is done in the .dts file or in runtime?

Thanks,
Pablo



--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f8029fbc-fd9f-4f20-9666-c53f63309a70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pablo Rodriguez

unread,
Aug 27, 2018, 12:48:06 PM8/27/18
to BeagleBoard
Adding rs485-rx-during-tx to the .dts do the trick.


 fragment@2 {
                target = <&uart2>;
                __overlay__ {
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <&pb_uart2_rs485_pins>;
                        rs485-rts-delay = <0 0>;

                        rts-gpio = <&gpio2 25 1>; /*  GPIO_ACTIVE_HIGH>; */
                        rs485-rts-active-high;
                        rs485-rx-during-tx;        
                        linux,rs485-enabled-at-boot-time;
                };
        };

Thanks
Reply all
Reply to author
Forward
0 new messages