This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: RS-485 communication

Part Number: AM5728
Other Parts Discussed in Thread: BEAGLEBOARD-X15

Tool/software: Linux

I have follow these links 

1.my  am57xx-beagle-x15-revc.dts is like:

	myuart10_pins_default: myuart10_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3558, PIN_OUTPUT | MUX_MODE14)  /*gpio3_29*/
			DRA7XX_CORE_IOPAD(0x3688, PIN_INPUT | MUX_MODE3)	/*uart10_rxd*/
			DRA7XX_CORE_IOPAD(0x368C, PIN_OUTPUT | MUX_MODE3)	/*uart10_txd*/
		>;
	};

&uart10 {
	pinctrl-names = "default";
	pinctrl-0 = <&myuart10_pins_default>;
	
	rts-gpio=<&gpio3 29 GPIO_ACTIVE_HIGH>;

    rs485-rts-active-high;
    rs485-rts-delay = <1 1>;

	/*Enable RS-485*/
	linux,rs485-enabled-at-boot-time;

	status = "okay";
};

2.I have selected omap_driver

  • change "CONFIG_SERIAL_8250_OMAP = y " to " CONFIG_SERIAL_8250_OMAP = n"
  • change "CONFIG_SERIAL_OMAP = n " to " CONFIG_SERIAL_OMAP = y"

And I successfully use it to  send out data.

20180709_101643.jpg

But,I am unable to read from uart10 ,I simply connect uart10' txd with uart10' rxd.

error output of read function is:

read :: Resource temporarily unavailable
[19 9:14:19]Timeout in USBRead(): Data requested is 8 bytes, but you get only -1 bytes!

 Help, I have no idea now, let me know if you need know my code.

  • Hello ,me again.
    I open up uart8,uart9 in dtbs and found they work just fine.
    but uart10 still can't receive data.
    I am using beagleboard-x15,will this be a hareware bug? Ps:I have two bb-x15,their uart10 both not working for reception.

  • Hi Philos,

    Do you use AM57x PSDK v4.03 (link below)?
    software-dl.ti.com/.../index_FDS.html

    Note that UART pinmux should be done in u-boot-spl, not in kernel, see below e2e thread:
    e2e.ti.com/.../661048

    Check if UART10 is enabled in PRCM, check register CM_WKUPAON_UART10_CLKCTRL. Then you can check UART10 pinmux registers (i.e. CTRL_CORE_PAD_GPIO6_14) in user space with devmem2 tool, and verify you still have the correct and expected values. Then you can check UART10 module registers and compare the values with UART9.

    See also below e2e threads:

    e2e.ti.com/.../580226
    e2e.ti.com/.../692735
    e2e.ti.com/.../588951

    Regards,
    Pavel

  • Hi Pavel:

    Thinks for your reply,sorry to disturb you on weekend.

    • Right now I am using ubuntu-16.04.3-minimal-armhf-2017-10-10 on my bb-x15.I try to follow your advice ,install devmem2,and access uart10_clkctrl  ,uart9_clkctrl,uart8_cklctrl,value are 0x02.
    • the value of pinmux register is also correct ,rightnow I use pinmux register vin2a_d2 for uart10
    ubuntu@arm:~$ sudo devmem2 0x4ae07880 h
    [sudo] password for ubuntu: 
    /dev/mem opened.
    Memory mapped at address 0xb6fc2000.
    Value at address 0x4AE07880 (0xb6fc2880): 0x2
    ubuntu@arm:~$ 
    ubuntu@arm:~$ sudo devmem2 0x4a0098e0 h
    /dev/mem opened.
    Memory mapped at address 0xb6f21000.
    Value at address 0x4A0098E0 (0xb6f218e0): 0x2
    ubuntu@arm:~$ sudo devmem2 0x4a0098e8 h
    /dev/mem opened.
    Memory mapped at address 0xb6f2e000.
    Value at address 0x4A0098E8 (0xb6f2e8e8): 0x2

    • And here is the information of interrupts running on my system.

  • Philos,

    Sorry for late reply, I was out of office.

    If you can switch to TI PSDK (Arago Linux), we can be in better help. Ubuntu Linux is supported by BeagleBoard community, not by TI.

    You can check UART10 module registers and compare the values with UART9.

    Regards,
    Pavel