On Thursday, 18. April 2002 01:21, you wrote: > On Wed, Apr 17, 2002 at 08:53:49AM +0200, Wolfgang Fritz wrote: [cut] > > I haven't had the best luck using cp, cat, and echo to test out the > usb-serial drivers in the past. Small C programs or Perl scripts using > the serial port work just fine. Since this is what really matters, I > haven't spent any time looking into this issue. > OK. I've replaced the stty/cp commands by a small C program. That works for me.
> > 2. On an open(), the baudrate is reset to 9600. This is intentional (I > > looked at pl2303.c), but different from standard serial ports and makes > > settings via command line tools like stty useless. For me that's a bug. > > I'll try to patch the pl2302.c not to do this reset (or to remember the > > last settings and reset to these), but I cannot do that in the office. > > > > I tried to change the baudrate inside minicom, that works (/dev/ttyUSB0 > > stays open) > > Yes, you are correct, I don't know why the driver is doing that > (holdover from the original author :) Patches gladly accepted to fix > this problem. > I've never done that before, but I'll try it at home next weekend (I can not install a kernel tree on this laptop due to disk space problems) > > I have to check the "lost first received byte" problem, but that takes a > > little longer. If I can resolve or work around this problem, I can change > > my download procedure to replace the stty and cp commands by a small > > program which keeps the device open between setting the baudrate and > > transferring the s-record file. > > Can you use minicom to send your data, or some other terminal program (I > think kermit is highly scriptable)? This might solve all of your > problems with using cp and cat. > I can reproduce this bug with minicom: 1. Loop TXD and RXD on the converter RS232 port. 2. Start minicom on /dev/ttyUSB0 3. Press some keys Result: the first incoming byte after opening the device is always lost. I can see it on the line, but it does not reach the driver (see log). I installed the W2000 driver I got with the converter on this laptop and did the same test under W2000 using hyperterm (the only terminal program available W2000 on this laptop). I could not reproduce the problem in this configuration, so it may be an initialization issue. I'm not an USB expert (in fact, I'm ignorant in this area), but if you want me to do more tests, feel free to ask. BTW: after changing my download process to work around these problems, I can use it without problems with the converter and standard serial ports, so I'm happy for now. Wolfgang [log attached] > thanks, > > greg k-h
# # send "1234" with minicom # Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - port 0, 1 bytes # # send first character '1' # Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - length = 1, data = 31 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write_bulk_callback - port 0 # # send second character '2' # Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - port 0, 1 bytes Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - length = 1, data = 32 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write_bulk_callback - port 0 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - port 0 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - length = 1, data = 32 # # received '2'. First character is lost # Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - port 0, 1 bytes Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write - length = 1, data = 33 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_write_bulk_callback - port 0 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - port 0 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - length = 1, data = 33 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:45 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_write - port 0, 1 bytes Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_write - length = 1, data = 34 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) cmd = 0x5415 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_ioctl (0) TIOCMGET Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: get_modem_info - result = 6 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_write_bulk_callback - port 0 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - port 0 Apr 18 08:41:46 de-h-lap3-nb kernel: pl2303.c: pl2303_read_bulk_callback - length = 1, data = 34
