/dev/ttymxc3 TX buffer sending issue in Jethro

Moderators: Oren.R, Aviad.H

CarlOnDartMx6
Posts: 75
Joined: Tue Dec 15, 2015 2:28 pm

/dev/ttymxc3 TX buffer sending issue in Jethro

Postby CarlOnDartMx6 » Thu May 25, 2017 4:03 pm

I am having a problem (happens though on all boards) with the transmit side of the ttymxc3 serial port which appears to stop working on the mx6 after some time, currently I do not know what initiates the issue hence why I'm coming to you for help and to see whether you know of a problem on ttymxc3 / UART in Jethro and whether you know of a patch etc, the serial port I'm referring to is this one :-

./sys/devices/soc0/soc/2100000.aips-bus/21f0000.serial/tty/ttymxc3


When it fails to transmit then I can shutdown my software and run the following unit test which then confirms failure :-

root@var-som-mx6:/unit_tests# ./mxc_uart_xmit_test.out /dev/ttymxc3 -E -B 115200


I'm expecting :-
UART 115200, 8bit, 1stop, PARENB, HW flow disabled.out /dev/ttymxc3 -E -B 115200
test begin, press 'c' to exit
sent 10000 bytes with speed 134907.251265bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps
sent 10000 bytes with speed 101265.822785bps


But what I get is
sent 10000
sent 10000
sent 10000
sent 10000


followed by nothing...

I can also see from /proc/tty/driver/IMX-uart that the TX out counter stops going up. As in tx shown in output line below doesn't increase :-
3: uart:IMX mmio:0x021F0000 irq:297 tx:24816 rx:298640 RTS|DTR|DSR|CD


The ttymxc3 serial port is setup with the following configuration :-
.c_cflag |= (CLOCAL | CREAD);
c_cflag &= ~CRTSCTS; // disable RTSCTS
c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // raw input
c_oflag &= ~OPOST; // raw output
c_iflag &= ~IXON; // Disable XON/XOFF flow control on output
c_iflag &= ~IXOFF; // Disable XON/XOFF flow control on input.
c_iflag &= ~IXANY; // (XSI) Typing any character will restart stopped output. (The default is to allow just the START character to restart output.)
c_iflag &= ~ICRNL; // Disable translation of carriage return to newline on input (unless IGNCR is set).
c_cc[VMIN] = 1;
c_cc[VTIME] = 0;



I've checked the lines and you can see that the transmission stops appearing on the line but the other side is able to send data which the dartmx6 succesffuly receives on the RX side of the UART driver.

As the port has CTSRTS disabled I always successfully get the expected lack of interrupts on IRQ 297, the wake up to read the date is driven from a linux event but it's actually the TX side which has the issue so none of that side of the driver is at fault.

My dtsi configuration ( configured to work with pins associated with our interfacing hw) for ttymxc3 is as follows :-

&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4_1>;
status = "okay";
};

pinctrl_uart4_1: uart4grp-1 { /* RX/TX only */
fsl,pins = <
MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1 /* STM32F4_UART2_TX */
MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1 /* STM32F4_UART2_RX */
MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B 0x1b0b1
MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B 0x1b0b1
>;
};


Note that RTS and CTS are disabled in the software side of things but do exist the the fsl, pinout as shown above.

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 2 guests