Uart2 receives and sends no data

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Uart2 receives and sends no data

2,564 次查看
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 项奖励
22 回复数

2,448 次查看
ufedor
NXP Employee
NXP Employee

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

0 项奖励

2,446 次查看
muaxi8
Contributor V

RCW and UBOOT are attached

0 项奖励

2,440 次查看
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 项奖励

2,433 次查看
muaxi8
Contributor V

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

0 项奖励

2,427 次查看
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 项奖励

2,422 次查看
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 项奖励

2,417 次查看
ufedor
NXP Employee
NXP Employee

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

0 项奖励

2,413 次查看
muaxi8
Contributor V

there is no  CONFIG_SERIAL_PROBE_ALL in uboot

muaxi8_0-1640673280748.png

 

0 项奖励

2,408 次查看
ufedor
NXP Employee
NXP Employee

Insert into the u-boot/configs/lx2160rdb_tfa_defconfig

0 项奖励

2,406 次查看
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 项奖励

2,401 次查看
ufedor
NXP Employee
NXP Employee

Please add new line:

CONFIG_SERIAL_PROBE_ALL=y

0 项奖励

2,398 次查看
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 项奖励

2,392 次查看
ufedor
NXP Employee
NXP Employee
0 项奖励

2,362 次查看
muaxi8
Contributor V

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

0 项奖励

2,357 次查看
ufedor
NXP Employee
NXP Employee

Have you added the line:

CONFIG_SERIAL_PROBE_ALL=y

?

0 项奖励

2,354 次查看
muaxi8
Contributor V

yes

muaxi8_1-1640748511696.png

 

0 项奖励

2,352 次查看
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 项奖励

2,181 次查看
muaxi8
Contributor V

I wonder if there are other patches

0 项奖励

2,294 次查看
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 项奖励

2,328 次查看
muaxi8
Contributor V

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

0 项奖励