- Are you referring to UART2_TX connected to pin B16 and UART2_RX connected to pin B15?
Yes, On my carrier board, these pins are the ones available for UART communication
- Are you having trouble receiving on UART2_RX inside the Jetson TX2 kernel?
Yes, when you say inside Jetson TX2 kernel, I am testing the UART using a C++ code. The C++ uart code prints out the same hex pattern each time I get data. On the sender side, I try sending a data packet of size 6 bytes. The received packet always shows the same hex pattern irrespective of the different data packets that I send. The same C++ code works perfectly fine when I change the port to /dev/ttyTHS2 (UART1)
- Are you having trouble transmitting on UART2_TX from the Jetson TX2 kernel to an external device?
Yes, on the external device, I used minicom to parse the data. I dont get the data what I send.
- Here are the pinmux settings you need to verify from the kernel after you boot fully:
I executed the commands and below were the print outs
gpufsw@tx2:~$ sudo devmem2 0x0243d020 w
/dev/mem opened.
Memory mapped at address 0x7f843cb000.
Value at address 0x243D020 (0x7f843cb020): 0x400
gpufsw@tx2:~$ sudo devmem2 0x0243d028 w
/dev/mem opened.
Memory mapped at address 0x7faddf8000.
Value at address 0x243D028 (0x7faddf8028): 0x458
gpufsw@tx2:~$ dmesg | grep ttyTHS1
[ 1.125425] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 37, base_baud = 0) is a TEGRA_UART
I do not know how to check the pin mux settings
DRV_TYPE, SCHMT, GPIO_SF_SEL, PBIAS_BUF,INPUT,TRISTATE, PUPD, PM
- What baudrate are you using?
115200
- Are you using hardware flow control?
No, I am not using the hardware flow control
here is my port settings code
int serial::set_interface_attribs(int fd, int speed)
{
struct termios tty;
if (tcgetattr(fd, &tty) < 0) {
printf("Error from tcgetattr: %s\n", strerror(errno));
return -1;
}
cfsetospeed(&tty, (speed_t)speed);
cfsetispeed(&tty, (speed_t)speed);
tty.c_cflag |= (CLOCAL | CREAD); /* ignore modem controls */
tty.c_cflag &= ~CSIZE;
tty.c_cflag |= CS8; /* 8-bit characters */
tty.c_cflag &= ~PARENB; /* no parity bit */
tty.c_cflag &= ~CSTOPB; /* only need 1 stop bit */
tty.c_cflag &= ~CRTSCTS; /* no hardware flowcontrol */
/* setup for non-canonical mode */
tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
tty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
tty.c_oflag &= ~OPOST;
/* fetch bytes as they become available */
tty.c_cc[VMIN] = 1;
tty.c_cc[VTIME] = 1;
if (tcsetattr(fd, TCSANOW, &tty) != 0) {
printf("Error from tcsetattr: %s\n", strerror(errno));
return -1;
}
return 0;
}
- Have you tried testing /dev/ttyS1?
No, is it an alternate name for /dev/ttyS1?
dmesg | grep ttyS1 did not return anything
- Perform
dmesg | grep ttyTHS1
and make sure you get address 0x3110000 for UARTB
yes it is the address 0x3110000