Uart2 receives and sends no data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Uart2 receives and sends no data

2,488 Views
muaxi8
Contributor V

lx2080a customer board.

Uart1 is my debugging printf serial port。

Uart2 is the serial port through which I communicate with CPLD。

now ,Under the kernel recognizes the uart2 which is ttyAMA1。

root@localhost:~# ls /dev/ttyAMA0 -l
crw------- 1 root tty 204, 64 Dec 26 10:22 /dev/ttyAMA0
root@localhost:~# ls /dev/ttyAMA1 -l
crw-rw---- 1 root dialout 204, 65 Dec 26 10:21 /dev/ttyAMA1

 The CPLD cannot receive the data sent by the LX2080, and the CPU cannot receive the data sent by

the CPLD。

below is a simple test case code。There is no data sent or received at present。

muaxi8_0-1640598083351.png

 

int main()
{
        char recvbuf[100];
        int ret = 0, fd = 0;
        char send[2] = {0x55};

        if(fd == 0)
            fd = open("/dev/ttyAMA1", O_RDWR );
        if(ret <0)
        {
                perror("can not open ttyAMA1 \n");
                exit(1);
        }
        ret = write(fd,send, 1);
        if(ret <0)
        {
                perror("write  ttyS1 0x55 err \n");
                exit(1);
        }

        while(1)
        {
                memset(recvbuf, 0, sizeof(recvbuf));
                ret = read(fd, recvbuf, 90);
                printf("len: %d, recvbuf %s \n", ret, recvbuf);

        }

        close(fd);
 return 1;

 

muaxi8_1-1640598877189.png

 

0 Kudos
22 Replies

2,372 Views
ufedor
NXP Employee
NXP Employee

Please provide U-Boot booting log as textual attachment to check RCW.

0 Kudos

2,370 Views
muaxi8
Contributor V

RCW and UBOOT are attached

0 Kudos

2,364 Views
ufedor
NXP Employee
NXP Employee

Please use CodeWarrior debugger to attach to the running processor and write data directly to the UART2 UARTDR. Check the UART2_SOUT by means of a digital scope.

0 Kudos

2,357 Views
muaxi8
Contributor V

 write data directly to the UART2 UARTDR, cpld can capture the date.

0 Kudos

2,351 Views
ufedor
NXP Employee
NXP Employee

Ensure that in the u-boot/configs/lx2160rdb_tfa_defconfig is present the following setting:
CONFIG_CONS_INDEX=2

and apply attached patch.

0 Kudos

2,346 Views
muaxi8
Contributor V

CONFIG_CONS_INDEX=2,that is set the debug serial port to Uart2, my debug serial port is now Uart1,

this value cannot be changed. Uart2 is the interface for me to communicate with CPLD. So I should not

change “CONFIG_CONS_INDEX=2“

0 Kudos

2,341 Views
ufedor
NXP Employee
NXP Employee

Please try "CONFIG_SERIAL_PROBE_ALL=y" instead of "CONFIG_CONS_INDEX=2"

0 Kudos

2,337 Views
muaxi8
Contributor V

there is no  CONFIG_SERIAL_PROBE_ALL in uboot

muaxi8_0-1640673280748.png

 

0 Kudos

2,332 Views
ufedor
NXP Employee
NXP Employee

Insert into the u-boot/configs/lx2160rdb_tfa_defconfig

0 Kudos

2,330 Views
muaxi8
Contributor V

Do you mean to add new variable "CONFIG_SERIAL_PROBE_ALL" ?

 

Is an index of an array and replacing it with CONFIG_SERIAL_PROBE_ALL is problematic .

 

muaxi8_0-1640674065947.png

 

0 Kudos

2,325 Views
ufedor
NXP Employee
NXP Employee

Please add new line:

CONFIG_SERIAL_PROBE_ALL=y

0 Kudos

2,322 Views
muaxi8
Contributor V

I'm sure it doesn't make any sense to define this variable, because the uboot source doesn't use this

variable

0 Kudos

2,316 Views
ufedor
NXP Employee
NXP Employee
0 Kudos

2,286 Views
muaxi8
Contributor V

After the patch is installed, uart2 still does not receive or send data

0 Kudos

2,281 Views
ufedor
NXP Employee
NXP Employee

Have you added the line:

CONFIG_SERIAL_PROBE_ALL=y

?

0 Kudos

2,278 Views
muaxi8
Contributor V

yes

muaxi8_1-1640748511696.png

 

0 Kudos

2,276 Views
ufedor
NXP Employee
NXP Employee

What is the issue state after applying the patch and the setting?

Is it still "Uart2 receives and sends no data"?

0 Kudos

2,105 Views
muaxi8
Contributor V

I wonder if there are other patches

0 Kudos

2,218 Views
muaxi8
Contributor V

I executed the UART read-write demo.

then,I checked the uart interrupts in /proc/interrupts ,but found no CPU interrupt count for UART2 :

root@localhost:~# cat /proc/interrupts |egrep -i uart
18: 6703 0 0 0 0 0 0 0 GICv3 64 Level uart-pl011
19: 0 0 0 0 0 0 0 0 GICv3 65 Level uart-pl011

0 Kudos

2,252 Views
muaxi8
Contributor V

Can you confirm that UART2 of LX2080A can be used normally ?

0 Kudos