-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RS485 stop working #38
Comments
does |
I tried it! And no. Beacause: I think this is OMAP serial, and |
I am on 4.9.15-bone4 and have got 8250 |
it is working on 4.9.15-bone4? what is 8250? |
Oh YES! S1 is rs485 |
This is the problem. 8250 IS NOT SUPPORT RTS GPIO. but fixme. previous was OMAP UART |
Would be nice to have rts gpio working on 8250 and dts shared, I don't know why this is not important for 8250 developers. |
Switch to the non generic omap serial driver. There was one developer working on it for the generic 8250 driver, but he seems to have disappeared. Regards, |
Here is the modification for rs485 by driver author. 8250 driver also refer to omap3-uart, so when I change the driver in the device tree, there is no effect. How can I switch the driver without rebuild the kernel? Can I do this? |
Hi @kzoltaan , did you find a way to do that? Thanks in advance |
I have an idea. I tried out and the RTS is working with user led.
--- use it for uart1 ---
I build the module:
run make, copy the ko into drivers/tty/serial and run depmod dtsi:
build your device tree and try it. I'm using rs232 this is with 8250 and looks good.
please confirm! |
I have without success tried the get RS485 with RTS to drive DE and /RE. |
my solution is working |
@kzoltaan What I finally did with prerequisites installing git clone git@github.com:RobertCNelson/bb-kernel.git
cd bb-kernel
git checkout am33x-v4.19
./build_deb.sh 2.) Kernel Configuration: Device Drivers ---> Character Devices ---> Serial Drivers ---> OMAP serial port support <Y> diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 37ea4e662f8e..4d2aa7661b95 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -496,7 +496,7 @@
};
uart2: serial@48024000 {
- compatible = "ti,am3352-uart", "ti,omap3-uart";
+ compatible = "ti,omap-uart-rs485";
ti,hwmods = "uart3";
clock-frequency = <48000000>;
reg = <0x48024000 0x2000>;
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 6420ae581a80..b1b3c528c4ba 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1907,9 +1907,7 @@ static const struct dev_pm_ops serial_omap_dev_pm_ops = {
#if defined(CONFIG_OF)
static const struct of_device_id omap_serial_of_match[] = {
- { .compatible = "ti,omap2-uart" },
- { .compatible = "ti,omap3-uart" },
- { .compatible = "ti,omap4-uart" },
+ { .compatible = "ti,omap-uart-rs485" },
{},
};
MODULE_DEVICE_TABLE(of, omap_serial_of_match); 3.) Rebuild the Kernel with (do not build it again with build_deb.sh, it overwrites your changes from 2.)
Extract from the dts overlay source file BB-OAG2-00A0.dts:
5.) After transfer of the three deploy/*.deb files to the beagle board, install it with |
@tkuschel impressive i like what you did here! we should be able to actually do the 'whole"..
in the overlay We will still have to patch the kernel compable layer:
but yeah, i like it! |
For anyone curious, OMAP 8250 (tested in 4.19 and 5.10) does support the RTS GPIO. However, it will not support arbitrary GPIOs. For example, when using UART1, your RTS GPIO must be UART1_RTSN. However, I was still unable to get this to work. As it turned out, I had to actually mux the pin in mode 7 to make it a GPIO. As I understand it, the 8250 driver doesn't support arbitrary GPIOs, while the older OMAP serial driver does. I have not tested this theory in more recent versions. I did, however, find that 4.20+ introduced an issue where FIFOs were not properly cleared for RS-485, which Robert has already added a patch for (see #65 for details). My final config is like this:
I have disabled the OMAP serial driver and enabled the 8250-based driver. This has been tested and works with an ADM3061 with UART1_RTSN routed to the RE/DE pin. It took me quite a while to realize that the pin had to be mapped as a GPIO rather than as the RTSN pin (which is a bit misleading IMO), but this setup seems to work on 4.19+ at the very least. |
I am using the BB-UART4-RS485-00A0.dtbo overlay which uses the 'MUX_MODE7' on P9_27 so I am not seeing anything that should keep it from working, however P9_27 (RE/DE line) is never going low. The 8250 driver is being used.
From here (Setting Up the BeagleBone Black's GPIO Pins
P9_27 always stays high so it is only able to send through max485 chip. Changes I made to /boot/uEnv.txt
|
This is my RS485 config on boneblack.
`&am33xx_pinmux {
uart1_pins: uart1_pins {
pinctrl-single,pins = <
0x178 (PIN_OUTPUT | MUX_MODE7) /* uart1_ctsn.uart1_ctsn /
0x17c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) / uart1_rtsn.uart1_rtsn /
0x180 (PIN_INPUT_PULLUP | MUX_MODE0) / uart1_rxd.uart1_rxd /
0x184 (PIN_OUTPUT | MUX_MODE0) / uart1_txd.uart1_txd */
>;
};
};
&ocp{
P9_19_pinmux {
status = "disabled";
};
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins>;
status = "okay";
rts-gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
rs485-rts-active-high;
rs485-rx-during-tx;
rs485-rts-delay = <1 1>;
linux,rs485-enabled-at-boot-time;
};
`
This is working on 4.2.5-armv7-x2 but not working on 4.9.0-armv7-x3. RTS pin is not working. Receive is OK. What is wrong?
The text was updated successfully, but these errors were encountered: