Jump to content

Recommended Posts

Posted

Hello. Im trying to configurate and adapt OrangePI Zero 2W board to a custom extension board with multiple RS485 drivers.

For now, im trying to configurate a single secondary UART (UART2) to initialize with muxed Rx\Tx pins and in RS485 (with software driven RTS pin).

My current DT overlay is:

Spoiler

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun50i-h616", "allwinner,sun50i-h618";

    fragment@0 {
        target = <&uart2>;

        __overlay__ {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&uart2_rs485_pins>;
            rts-gpios = <&pio 7 4 0>; // PH4 in ACTIVE HIGH
            linux,rs485-enabled-at-boot-time;
            rs485-rts-active-high;
            rs485-rts-delay = <55000 55000>; // Delay are set huge to visiually check RTS with scope, with 1/50 it still do not work.
        };
    };

    fragment@1 {
        target = <&pio>;
        __overlay__ {
            uart2_rs485_pins: uart2_rs485_pins {
                pins = "PH5", "PI6";
                function = "uart2";
            };
        };
    };
};

 

And it is partially works. Works as UART. Able to send and receive data with muxed Rx\Tx.
For RTS... its complicated. Seems RTS(PH4 GPIO) are initialized and acquired by UART2 software, and stay low during initial idling.

After im trying to send any data (echo 123 >> /dev/ttyS2), RTS goes HIGH and stuck in this state before reboot.


Im have tried to send big blob at 9600 and check the RTS with statserial.
But as i see, RTS is 1 (active???) from inital to complete and after, and never changes. 
 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines