Hello everyone,
I have a custom IoT router board based on CM5, and I want to automatically control the RE/DE line.
I created a custom dts overlay file, and the RS485 DE/RE line is connected to PCA9535 IOMUX.
I can control all outputs and inputs from userspace using libgpiod commands, but when I define rts-gpio in the overlay, I cannot send any information from the RPI to my computer.
Can someone check and provide advice?
Should I enable any kernel modules or use the local UART RTS line to autoflow control?
BR
I have a custom IoT router board based on CM5, and I want to automatically control the RE/DE line.
I created a custom dts overlay file, and the RS485 DE/RE line is connected to PCA9535 IOMUX.
I can control all outputs and inputs from userspace using libgpiod commands, but when I define rts-gpio in the overlay, I cannot send any information from the RPI to my computer.
Can someone check and provide advice?
Should I enable any kernel modules or use the local UART RTS line to autoflow control?
Code:
/dts-v1/;/plugin/;#include "dt-bindings/gpio/gpio.h"#include "dt-bindings/leds/common.h"/ {compatible = "brcm,bcm2712";fragment@0 {target = <&i2c1>; // I2C bus 1__overlay__ {status = "okay";clock-frequency = <400000>;#address-cells = <1>;#size-cells = <0>;pca9535: pca9535@21 {compatible = "nxp,pca9535";reg = <0x21>;status = "okay";gpio-controller;#gpio-cells = <2>;gpio-line-names = "LTE_PERST","LTE_DTR","PCA_GPIO0_2","PCA_GPIO0_3","PCA_GPIO0_4","LoRa_SX1262_IO1","LoRa_SX1262_IO2","RS485_RTS","DIO_DIN2","DIO_DIN1","SYS_USER_LED1","SYS_USER_LED2","DIO_STAT2","DIO_DOUT2","DIO_STAT1","DIO_DOUT1";LTE_PERST {gpios = <&pca9535 0 GPIO_ACTIVE_HIGH>;output-high;line-name = "LTE_PERST";};LTE_DTR {gpios = <&pca9535 1 GPIO_ACTIVE_HIGH>;output-high;line-name = "LTE_DTR";};PCA_GPIO0_2 {gpios = <&pca9535 2 GPIO_ACTIVE_HIGH>;output-low;line-name = "PCA_GPIO0_2";};PCA_GPIO0_3 {gpios = <&pca9535 3 GPIO_ACTIVE_LOW>;output-high;line-name = "PCA_GPIO0_3";};PCA_GPIO0_4 {gpios = <&pca9535 4 GPIO_ACTIVE_HIGH>;output-low;line-name = "PCA_GPIO0_4";};LoRa_SX1262_IO1 {gpios = <&pca9535 5 GPIO_ACTIVE_HIGH>;output-low;line-name = "LoRa_SX1262_IO1";};LoRa_SX1262_IO2 {gpios = <&pca9535 6 GPIO_ACTIVE_HIGH>;output-low;line-name = "LoRa_SX1262_IO2";};RS485_RTS {gpios = <&pca9535 7 GPIO_ACTIVE_HIGH>;output-high;line-name = "RS485_RTS";};DIO_DIN2 {gpios = <&pca9535 8 GPIO_ACTIVE_HIGH>;input;line-name = "DIO_DIN2";};DIO_DIN1 {gpios = <&pca9535 9 GPIO_ACTIVE_HIGH>;input;line-name = "DIO_DIN2";};SYS_USER_LED1 {gpios = <&pca9535 10 GPIO_ACTIVE_LOW>;output-high;line-name = "SYS_USER_LED1";};SYS_USER_LED2 {gpios = <&pca9535 11 GPIO_ACTIVE_LOW>;output-high;line-name = "SYS_USER_LED2";};DIO_STAT2 {gpios = <&pca9535 12 GPIO_ACTIVE_LOW>;input;line-name = "DIO_STAT2";};DIO_DOUT2 {gpios = <&pca9535 13 GPIO_ACTIVE_HIGH>;output-low;line-name = "DIO_DOUT2";};DIO_STAT1 {gpios = <&pca9535 14 GPIO_ACTIVE_LOW>;input;line-name = "DIO_STAT1";};DIO_DOUT1 {gpios = <&pca9535 15 GPIO_ACTIVE_HIGH>;output-low;line-name = "DIO_DOUT1";};};ads1015@48 {compatible = "ti,ads1015";reg = <0x48>;#address-cells = <1>;#size-cells = <0>;status = "okay";channel_a: channel@4 {reg = <4>;ti,gain = <2>;ti,datarate = <4>;};channel_b: channel@5 {reg = <5>;ti,gain = <2>;ti,datarate = <4>;};channel_c: channel@6{reg = <6>;ti,gain = <2>;ti,datarate = <4>;};channel_d: channel@7 {reg = <7>;ti,gain = <2>;ti,datarate = <4>;};};};};fragment@1 {target = <&leds>;__overlay__ {compatible = "gpio-leds";user_led_1: user_led_1 {label = "user-led-1";linux,default-trigger = "heartbeat";gpios = <&pca9535 10 GPIO_ACTIVE_LOW>;};user_led_2: user_led_2 {label = "user-led-2";gpios = <&pca9535 11 GPIO_ACTIVE_LOW>;default-state = "on";};};};fragment@2 {target = <&uart1>;__overlay__ {status = "okay";label = "SYS_RS232";pinctrl-0 = <&uart1_pins>;};};fragment@3 {target = <&uart4>;__overlay__ {status = "okay";label = "SYS_RS485";pinctrl-0 = <&uart4_pins>;linux,rs485-enabled-at-boot-time;rts-gpio = <&pca9535 7 GPIO_ACTIVE_HIGH>;};};};Statistics: Posted by persoentif — Fri Jul 25, 2025 3:36 pm