2010-05-18 22:33:43     Why does the UART0 automatically sends the data received

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-05-18 22:33:43     Why does the UART0 automatically sends the data received

zhang zhihua (CHINA)

Message: 89517   

 

大家好!

 

    我的开发板是BF518F-EZBRD,我现在想把调试串口UART0用来作为通讯串口,即在boot之后把它封掉,环境变量设置为:

 

root=/dev/mtdblock0 rw rootfstype=jffs2 clkin_hz=25000000 earlyprintk=serial,uart0,57600

 

然后我编写了应用对UART0进行测试,发现当我从PC机使用串口调试工具向uart0发送数据时它把收到的数据又自动发送给了PC机,操作如下:

 

fd = open("/dev/ttyBF0",O_RDWR | O_NONBLOCK);

 

然后执行:

 

ret = write(fd,buff,strlen(buff));//能正确向PC机发送buff里面的数据

 

但是当从PC机再向ttyBF0发送数据时它自动又把数据发给了PC机,调用read();函数也读不到任何的数据!

TranslateQuoteReplyEditDelete

 

 

2010-05-19 00:37:02     Re: Why does the UART0 automatically sends the data received

Mike Frysinger (UNITED STATES)

Message: 89522   

 

i really dont understand what you're trying to do.  most likely you're doing termios incorrectly.  please read the documentation:

  docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:serial_programming

QuoteReplyEditDelete

 

 

2010-05-19 01:36:29     Re: Why does the UART0 automatically sends the data received

zhang zhihua (CHINA)

Message: 89523   

 

Hi,Mike,

 

    The UART0 is a debug serial port,but now I want to use it to communicate with other devices like the uart1.So frist I must forbid it print the debugging information,so I set the environment variables as:

 

"root=/dev/mtdblock0 rw rootfstype=jffs2 clkin_hz=25000000",

 

delete the "earlyprintk = "and the "consloe =",then I use a  serial port debugging tool to send data to the uart0,but I found the uart0 send the data back  to the serial port debugging tool  automatically.

TranslateQuoteReplyEditDelete

 

 

2010-05-20 23:36:32     Re: Why does the UART0 automatically sends the data received

Sonic Zhang (CHINA)

Message: 89609   

 

You may try to disable the user console in init as well.

Attachments

    Outcomes