diff --git a/samples/subsys/modbus/rtu_client/README.rst b/samples/subsys/modbus/rtu_client/README.rst index 129616dfc3d..1159cfa771f 100644 --- a/samples/subsys/modbus/rtu_client/README.rst +++ b/samples/subsys/modbus/rtu_client/README.rst @@ -19,12 +19,15 @@ RTU client example is running on an evaluation board and communicates with another board that has been prepared according to the description `modbus-rtu-server-sample`. -In addition to the evaluation board, an USB to RS-485 bus adapter and -a RS-485 shield are required. Shield converts the UART TX, RX signals to -RS-485 and does not need a specific overlay, an Arduino header compatible -shield like `joy-it RS-485 shield for Arduino`_ can be used. +In addition to the evaluation board a RS-485 shield may be used. +The shield converts UART TX, RX signals to RS-485. +An Arduino header compatible shield like `joy-it RS-485 shield for Arduino`_ +can be used. This example uses DE signal, which is controlled by pin D9 +on the JOY-IT shield. For other shields, ``de-gpios`` property must be adapted +or removed in the application overlay file +:zephyr_file:`samples/subsys/modbus/rtu_client/app.overlay` -The A+, B- lines of the RS-485 shield should be connected together. +The A+, B- lines of the RS-485 shields should be connected together. Alternatively UART RX,TX signals of two boards can be connected crosswise. diff --git a/samples/subsys/modbus/rtu_client/app.overlay b/samples/subsys/modbus/rtu_client/app.overlay index 840434e4917..124708a18c3 100644 --- a/samples/subsys/modbus/rtu_client/app.overlay +++ b/samples/subsys/modbus/rtu_client/app.overlay @@ -11,5 +11,6 @@ compatible = "zephyr,modbus-serial"; label = "MODBUS"; status = "okay"; + de-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ }; }; diff --git a/samples/subsys/modbus/rtu_server/README.rst b/samples/subsys/modbus/rtu_server/README.rst index b7eb5b16e04..9367c8bdd40 100644 --- a/samples/subsys/modbus/rtu_server/README.rst +++ b/samples/subsys/modbus/rtu_server/README.rst @@ -19,9 +19,12 @@ Additionally the board should have three LEDs. RTU server example is running on an evaluation board. Client is running on a PC or laptop. In addition to the evaluation board, an USB to RS-485 bus adapter and -a RS-485 shield are required. Shield converts the UART TX, RX signals to -RS-485 and does not need a specific overlay, an Arduino header compatible -shield like `joy-it RS-485 shield for Arduino`_ can be used. +a RS-485 shield are required. The shield converts UART TX, RX signals to RS-485. +An Arduino header compatible shield like `joy-it RS-485 shield for Arduino`_ +can be used. This example uses DE signal, which is controlled by pin D9 +on the JOY-IT shield. For other shields, ``de-gpios`` property must be adapted +or removed in the application overlay file +:zephyr_file:`samples/subsys/modbus/rtu_server/app.overlay` The USB to RS-485 adapter connects to the USB port of a computer. The two A+, B- lines should be connected to the RS-485 shield. diff --git a/samples/subsys/modbus/rtu_server/app.overlay b/samples/subsys/modbus/rtu_server/app.overlay index 840434e4917..124708a18c3 100644 --- a/samples/subsys/modbus/rtu_server/app.overlay +++ b/samples/subsys/modbus/rtu_server/app.overlay @@ -11,5 +11,6 @@ compatible = "zephyr,modbus-serial"; label = "MODBUS"; status = "okay"; + de-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ }; }; diff --git a/tests/subsys/modbus_rtu/boards/frdm_k64f.overlay b/tests/subsys/modbus_rtu/boards/frdm_k64f.overlay index 9974d570874..581336fe344 100644 --- a/tests/subsys/modbus_rtu/boards/frdm_k64f.overlay +++ b/tests/subsys/modbus_rtu/boards/frdm_k64f.overlay @@ -11,6 +11,8 @@ compatible = "zephyr,modbus-serial"; label = "MODBUS"; status = "okay"; + de-gpios = <&gpiob 22 GPIO_ACTIVE_LOW>; /* red LED */ + re-gpios = <&gpioe 26 GPIO_ACTIVE_LOW>; /* green LED */ }; };