Hi,
i am using the GPIO 8,9,11 pins of RPI-CM5 to use for the RS485 configuration,
I was used the below overlay, to configure the pinconf and rs485 conf for linux,
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2712";
fragment@0 {
target = <&rp1_gpio>;
__overlay__ {
uart3_rs485_pins: uart3_rs485_pins {
pin_txd {
pins = "gpio8";
function = "uart3";
bias-disable;
drive-strength = <4>;
slew-rate = <0>;
};
pin_rxd {
pins = "gpio9";
function = "uart3";
bias-pull-up;
drive-strength = <4>;
slew-rate = <0>;
};
pin_rts {
pins = "gpio11";
function = "uart3";
bias-disable;
drive-strength = <4>;
slew-rate = <0>;
};
};
};
};
fragment@1 {
target = <&rp1_uart3>;
frag1: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart3_rs485_pins>;
/* RS-485 mode configuration */
linux,rs485-enabled-at-boot-time;
rs485-rts-active-low;
rs485-rts-delay = <1 1>; /* 1ms before, 1ms after */
/* Optional: Enable RX during TX for monitoring */
/* rs485-rx-during-tx; */
};
};
};
i was added overlay to /boot/firmware/config.txt as
dtoverlay-rs485_config
after performed reboot and observed the below,
rpi@raspberrypi:~$ sudo pinctrl get 8,9,11
8: a2 pn | hi // GPIO8 = TXD3
9: a2 pu | hi // GPIO9 = RXD3
11: a2 pn | lo // GPIO11 = RTS3
rpi@raspberrypi:~$
perform the configuration below
1.stty -F /dev/ttyAMA3 115200 raw -echo
2.stty -F /dev/ttyAMA3 speed
rpi@raspberrypi:~$ stty -F /dev/ttyAMA3 speed
115200
3.rpi@raspberrypi:~$ echo "hello" > /dev/ttyAMA3 - after this didn't get any response on the other terminal where i am looking for the response
getting below response for this command
rpi@raspberrypi:~$ stty -F /dev/ttyAMA3 -a
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany
-imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho
-extproc
rpi@raspberrypi:~$
rpi@raspberrypi:~$ ls /sys/class/tty/ttyAMA3
close_delay custom_divisor flags io_type port type xmit_fifo_size
closing_wait dev iomem_base irq power uartclk
console device
does "rs485" list in above path
Not sure why it is not working, can you please let me know where i am doing wrong
Thanks
Shivaji Y
i am using the GPIO 8,9,11 pins of RPI-CM5 to use for the RS485 configuration,
I was used the below overlay, to configure the pinconf and rs485 conf for linux,
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2712";
fragment@0 {
target = <&rp1_gpio>;
__overlay__ {
uart3_rs485_pins: uart3_rs485_pins {
pin_txd {
pins = "gpio8";
function = "uart3";
bias-disable;
drive-strength = <4>;
slew-rate = <0>;
};
pin_rxd {
pins = "gpio9";
function = "uart3";
bias-pull-up;
drive-strength = <4>;
slew-rate = <0>;
};
pin_rts {
pins = "gpio11";
function = "uart3";
bias-disable;
drive-strength = <4>;
slew-rate = <0>;
};
};
};
};
fragment@1 {
target = <&rp1_uart3>;
frag1: __overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&uart3_rs485_pins>;
/* RS-485 mode configuration */
linux,rs485-enabled-at-boot-time;
rs485-rts-active-low;
rs485-rts-delay = <1 1>; /* 1ms before, 1ms after */
/* Optional: Enable RX during TX for monitoring */
/* rs485-rx-during-tx; */
};
};
};
i was added overlay to /boot/firmware/config.txt as
dtoverlay-rs485_config
after performed reboot and observed the below,
rpi@raspberrypi:~$ sudo pinctrl get 8,9,11
8: a2 pn | hi // GPIO8 = TXD3
9: a2 pu | hi // GPIO9 = RXD3
11: a2 pn | lo // GPIO11 = RTS3
rpi@raspberrypi:~$
perform the configuration below
1.stty -F /dev/ttyAMA3 115200 raw -echo
2.stty -F /dev/ttyAMA3 speed
rpi@raspberrypi:~$ stty -F /dev/ttyAMA3 speed
115200
3.rpi@raspberrypi:~$ echo "hello" > /dev/ttyAMA3 - after this didn't get any response on the other terminal where i am looking for the response
getting below response for this command
rpi@raspberrypi:~$ stty -F /dev/ttyAMA3 -a
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany
-imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho
-extproc
rpi@raspberrypi:~$
rpi@raspberrypi:~$ ls /sys/class/tty/ttyAMA3
close_delay custom_divisor flags io_type port type xmit_fifo_size
closing_wait dev iomem_base irq power uartclk
console device
does "rs485" list in above path
Not sure why it is not working, can you please let me know where i am doing wrong
Thanks
Shivaji Y
Statistics: Posted by shivajiyannaboina — Mon Dec 08, 2025 7:49 am