Jump to content

Recommended Posts

Posted (edited)

Hi,

 

I am using Nanopi Neo board and I need RS485 driver to control DE pin automatically.

I have prepared DTS Overlay file:

 

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";

    fragment@0 {
        target = <&uart1>;
        __overlay__ {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&uart1_pins &uart1_de_pin>;
            rs485-rts-gpios = <&gpio6 8 0>;  /* PG8 active-low */
            linux,rs485-enabled-at-boot-time;
            rs485-rts-delay = <0 300>;
        };
    };

    fragment@1 {
        target = <&uart2>;
        __overlay__ {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&uart2_pins &uart2_de_pin>;
            rs485-rts-gpios = <&gpio0 2 0>;  /* PA2 active-low */
            linux,rs485-enabled-at-boot-time;
            rs485-rts-delay = <0 300>;
        };
    };
};
 

I produced dtbo file from dts one with the command: dtc -@ -I dts -O dtb -o rs485.dtbo rs485.dts

 

I copied this rs485.dtbo file to /boot/dtb/overlay. Also I added rs485 string to ArmbianEnv.txt and rebooted. 

But only TX works, RX doesn't. 

 

What should  I do else to make it work?

Edited by ABK

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