2011-01-18 11:59:40     USB-serial: problem sending only 1 char

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

2011-01-18 11:59:40     USB-serial: problem sending only 1 char

Gilbert Inho (FRANCE)

Message: 97521   

 

Hello,

 

We use a BF536 with a custom board. The used uclinux distribution is 2010R1-RC5.

 

We try to use a USB-serial converter cable. We tested 2 models: FTDI FT232R and Prolific pl2303.

We use the drivers ftdi-sio.c and pl2303.c from the qconf kernel config of the distribution.

 

The problem is when we send the characters 1 by 1 through the virtual serial port /dev/ttyUSB0 (for example, when using a terminal application like microcom or tip), we received the character twice on the remote side of the serial port (eg, we send "A" and we got "A A").

If we send directly a "block" (at least 2 characters at the same time) through the /dev/ttyUSB0 virtual serial port, we received exactly what we send (eg, we send "AT" from the host side, we got "AT" on the remote side).

More over, if we send 1 char from the remote side to the BF536 board (host), it is OK too.

 

USB keys work perfectly, so we can assume that both hardware and USB bulk transfer mode are OK.

 

Last point: we have tested the 2 serial converters with a PC and they work well.

 

 

Has someone experienced the same problem ?

Can somebody give us any clue to explain this problem ?

 

Best regards,

G.

QuoteReplyEditDelete

 

 

2011-01-19 01:08:30     Re: USB-serial: problem sending only 1 char

Sonic Zhang (CHINA)

Message: 97530   

 

Which USB host do you adapt to bf536? Have you tried the on chip MUSB host on bf527?

QuoteReplyEditDelete

 

 

2011-01-19 05:02:07     Re: USB-serial: problem sending only 1 char

Gilbert Inho (FRANCE)

Message: 97548   

 

We use a Renesas R8A66597 host controller.

 

We will get a bf527 eval card and test with the other HC.

 

Do you think host controller is involved ? As long as usb keys work well and usb-serial use bulk transfer too, doesn't this validate the Renesas HC ?

QuoteReplyEditDelete

 

 

2011-01-19 22:09:07     Re: USB-serial: problem sending only 1 char

Sonic Zhang (CHINA)

Message: 97554   

 

No, just want to narrow down your problem.

 

Have you seen the same behavior on PC with the same version of kernel in 2010R1?

QuoteReplyEditDelete

 

 

2011-01-24 09:02:16     Re: USB-serial: problem sending only 1 char

Gilbert Inho (FRANCE)

Message: 97642   

 

The problem comes from the Blackfin specific function "outsw" written in assembly code. This function writes 2 bytes despite its argument "len" is set to 0.

 

This leads the function "r8a66597_write_fifo" in r8a66597.h (function which writes urb's data into HC's fifo) to write twice the data in the particular case of only 1 char sent because, then, "outsw" writes data despite its argument "len" is set to 0.

 

We haven't modified "outsw", but from now we use it after testing the argument "len" is different from 0.

QuoteReplyEditDelete

Attachments

    Outcomes