Other Parts Discussed in Thread: AM4372
Tool/software: Linux
Hi sir:
There is a problem really confusing me very much,about the rs485 serial communication.
I had a configuration ,as shown as follow, in the device tree.
436 uart4_pins: uart4_pins {
437 pinctrl-single,pins = <
438 AM4372_IOPAD(0x968, PIN_INPUT | INPUT_EN | PIN_INPUT_PULLUP | DS0_PULL_UP_DOWN_EN | MUX_MODE1) /* uart0_ctsn.uart4_rxd */
439 AM4372_IOPAD(0x96c, PIN_OUTPUT | PULL_DISABLE | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE1) /* uart0_rtsn.uart4_txd */
440 AM4372_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE7) /* gpio0-9 */
441 >;
442 };
710 &uart4 {
711 status = "okay";
712 pinctrl-names = "default";
713 pinctrl-0 = <&uart4_pins>;
714 rts-gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
715 rs485-rts-active-high;
716 rs485-rts-delay = <0 0>;
717 linux,rs485-enabled-at-boot-time;
718 };
But when I operating the "/dev/ttyS4" using only the system call function:open , write and close, I comfirmed that the Tx cable had the signals, but the rts cable didn't have voltage changed as its value 0.
I didn't do any configuration for the serial communication in my c programe,not using ioctl or termios function.Because I had configured it in the device tree, the omap_serial driver will do the configuration
in rs485_probe function in probe function.
When i using system call function write(), I think it will call the uart_write() function in the serial_core, then after the message need to send has been copy to the THR , the __uart_start() ,in serial_core, will be called, and then the function serial_omap_start_tx() will be called to active the rts gpio high, using the gpio_set_value().
But the result is that the rts gpio's value is not high as the Tx sending message and even so there is no logs for the functions in a bad situation.
So what might be the root cause of it?
It will be very pleasure for you answer.
Best wish!