Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Virtual Serial port pronblem: (12 Items)
   
Virtual Serial port pronblem  
Hi,

I'm trying to use a USB-UART chipset for which I have invoked the devc-serusb driver. I'm able to get two nodes /dev/
serusb1 & /dev/serusb2. The chipset vendor is FTDI. 

I have connected /dev/serusb1 & /dev/ser1 through this chipset and cable. I write a sample data into /dev/serusb1 and 
read it from /dev/ser1 but I don't get any data. When I checked with cat /dev/serusb1, I could find the data in it still
. 

My question is what could be the reason behind the written data not getting transmitted out of /dev/serusb1, although 
the APIs return success? 

I have treated the virtual serial port the same way as the conventional serial port. Is there anything specific that 
needs to be taken care for virtual serial ports?

Thanks,
Lakshminarayanan.R

PS: 
1) I tried the same chipset in windows with the driver provided by the vendor it works!
2) And in QNX host, when I connect /dev/ser1 to /dev/ser2 through cables, if some data is written in /dev/ser1 it is 
available in /dev/ser2. If I do a cat in /dev/ser1 - no data is there and cat /dev/ser2 gives the output data!
Re: Virtual Serial port pronblem  
Not sure what is wrong , but you could check this things:

/root# uname -a
QNX EA869dfc 6.4.0 2008/10/21-11:10:39EDT x86pc x86

/root# usb
USB 0 (EHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 1 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 2 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 3 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

Device Address             : 1
Vendor                     : 0x067b (Prolific Technology Inc.)
Product                    : 0x2303 (USB-Serial Controller)
Class                      : 0x00 (Independent per interface)

USB 4 (UHCI) v1.10, v1.01 DDK, v1.01 HCD


/root# pidin -pdevc-serusb arg
     pid Arguments
149442622 devc-serusb -d vid=0x067b,did=0x2303,busno=0x03,devno=0x01

/root# pidin -pdevc-ser8250 arg
     pid Arguments
   94222 devc-ser8250 -u1 3f8,4 -u2 2f8,3


/root#use devc-serusb
...
...

/root# ls /dev/ser*
/dev/ser1        /dev/ser2        /dev/serusb1

/root# stty -a </dev/ser1
Name:  /dev/ser1
Type:  serial
Opens: 1
+hupcl +cread -clocal -isig -icanon -iexten -echo -echoe -echok -echoke -echonl -echoctl -noflsh -ignbrk -brkint -ignpar
 -parmrk -istrip
-inlcr -igncr -icrnl +imaxbel -opost +onlcr
-isflow -osflow +ihflow +ohflow
 intr=^C  quit=^\ erase=^?  kill=^U   eof=^D   eol=^-  eol2=^- swtch=^-
start=^Q  stop=^S  susp=^Z dsusp=^- reprint=^- discard=^- werase=^- lnext=^V
  min=01  time=00   fwd=^- login=^-   pr1=^[   pr2=5B   pr3=^-   pr4=^-
  sf1=^-   sf2=^-   sf3=^-   sf4=^-  left=44 right=43    up=41  down=42
  ins=40   del=50   rub=^-   can=^-  home=48   end=59
par=none bits=8 stopb=1 baud=57600 rows=0,0

/root# stty -a </dev/serusb1
Name:  /dev/serusb1
Type:  serial
Opens: 1
+hupcl +cread -clocal -isig -icanon -iexten -echo -echoe -echok -echoke -echonl -echoctl -noflsh -ignbrk -brkint -ignpar
 -parmrk -istrip
-inlcr -igncr -icrnl +imaxbel -opost +onlcr
-isflow -osflow +ihflow +ohflow
 intr=^C  quit=^\ erase=^?  kill=^U   eof=^D   eol=^-  eol2=^- swtch=^-
start=^Q  stop=^S  susp=^Z dsusp=^- reprint=^- discard=^- werase=^- lnext=^V
  min=01  time=00   fwd=^- login=^-   pr1=^[   pr2=5B   pr3=^-   pr4=^-
  sf1=^-   sf2=^-   sf3=^-   sf4=^-  left=44 right=43    up=41  down=42
  ins=40   del=50   rub=^-   can=^-  home=48   end=59
par=none bits=8 stopb=1 baud=57600 rows=0,0

reading/writing data from/to /dev/ser1-/dev/usbser1 works for me.

Hope this helps.
Jeevan


> Hi,
> 
> I'm trying to use a USB-UART chipset for which I have invoked the devc-serusb 
> driver. I'm able to get two nodes /dev/serusb1 & /dev/serusb2. The chipset 
> vendor is FTDI. 
> 
> I have connected /dev/serusb1 & /dev/ser1 through this chipset and cable. I 
> write a sample data into /dev/serusb1 and read it from /dev/ser1 but I don't 
> get any data. When I checked with cat /dev/serusb1, I could find the data in 
> it still. 
> 
> My question is what could be the reason behind the written data not getting 
> transmitted out of /dev/serusb1, although the APIs return success? 
> 
> I have treated the virtual serial port the same way as the conventional serial
>  port. Is there anything specific that needs to be taken care for virtual 
> serial ports?
> 
> Thanks,
> Lakshminarayanan.R
> 
> PS: 
> 1) I tried the same chipset in windows with the driver provided by the vendor 
> it works!
> 2) And in QNX host, when I connect /dev/ser1 to /dev/ser2 through cables, if 
> some data is written in /dev/ser1 it is available in /dev/ser2. If I do a cat 
> in /dev/ser1 - no data is there and cat /dev/ser2 gives the output data!


Re: Virtual Serial port problem  
Please find my console statements. 

uname: 
QNX QNX_Target 6.4.0 2008/10/21-11:10:24EDT x86pc x86

usb:
USB 0 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 1 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 2 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

Device Address             : 1
Vendor                     : 0x0403 (FTDI)
Product                    : 0x6010 (USB <-> Serial Cable)
Class                      : 0x00 (Independent per interface)

USB 3 (UHCI) v1.10, v1.01 DDK, v1.01 HCD

USB 4 (EHCI) v1.10, v1.01 DDK, v1.01 HCD

pidin -pdevc-serusb arg:
     pid Arguments
  626726 devc-serusb -d vid=0x0403,did=0x6010,busno=0x02,devno=0x01,module=ftdi

pidin -pdevc-ser8250:
     pid Arguments
  106513 devc-ser8250 -u1 3f8,4 -u2 2f8,3

ls /dev/ser*:
/dev/ser1
/dev/ser2
/dev/serusb1
/dev/serusb2

stty -a </dev/ser1:
Name:  /dev/ser1
Type:  serial
Opens: 1
+hupcl +cread -clocal -isig -icanon -iexten -echo -echoe -echok -echoke -echonl
-echoctl -noflsh -ignbrk -brkint -ignpar -parmrk -istrip -inlcr -igncr -icrnl
+imaxbel -opost +onlcr
-isflow -osflow +ihflow +ohflow
 intr=^C  quit=^\ erase=^?  kill=^U   eof=^D   eol=^-  eol2=^- swtch=^- 
start=^Q  stop=^S  susp=^Z dsusp=^- reprint=^- discard=^- werase=^- lnext=^V 
  min=01  time=00   fwd=^- login=^-   pr1=^[   pr2=5B   pr3=^-   pr4=^- 
  sf1=^-   sf2=^-   sf3=^-   sf4=^-  left=44 right=43    up=41  down=42 
  ins=40   del=50   rub=^-   can=^-  home=48   end=59 
par=none bits=8 stopb=1 baud=57600 rows=0,0

stty -a </dev/serusb1:
Name:  /dev/serusb1
Type:  serial
Opens: 1
+hupcl +cread -clocal -isig -icanon -iexten -echo -echoe -echok -echoke -echonl
-echoctl -noflsh -ignbrk -brkint -ignpar -parmrk -istrip -inlcr -igncr -icrnl
+imaxbel -opost +onlcr
-isflow -osflow +ihflow +ohflow
 intr=^C  quit=^\ erase=^?  kill=^U   eof=^D   eol=^-  eol2=^- swtch=^- 
start=^Q  stop=^S  susp=^Z dsusp=^- reprint=^- discard=^- werase=^- lnext=^V 
  min=01  time=00   fwd=^- login=^-   pr1=^[   pr2=5B   pr3=^-   pr4=^- 
  sf1=^-   sf2=^-   sf3=^-   sf4=^-  left=44 right=43    up=41  down=42 
  ins=40   del=50   rub=^-   can=^-  home=48   end=59 
par=none bits=8 stopb=1 baud=57600 rows=0,0

If I load "devc-serusb" without specifying module=ftdi, virtual serial port is not created in the system. 

If I query devc-serusb for supported hardware modules, I can see ftdi in it! My suspect is whether this driver can 
support all ftdi chipsets???

Should the virtual serial port be treated any different than regular serial ports??

Re: Virtual Serial port problem  
Update! 

I learn from this file /etc/system/enum/devices/usb/char that it supports FTDI chipset with device ID 6001. But the FTDI
 chipset I'm using is with device ID 6010. So I guess that model isn't supported yet.

Is it possible to add a device entry with device ID of this model in that configuration file so that it can be verified 
if the existing driver works?
RE: Virtual Serial port problem  
Hi:
	"use devc-serusb" tells you the options that are supported by
the devc-serusb driver.  I believe that two of the options are "vid" and
"did" which let you specify the vendor ID and device ID to use (you'll
probably have to specify both.  You may also have to specify the busno /
devno options).

	R. 

-----Original Message-----
From: Lakshminarayanan R [mailto:community-noreply@qnx.com] 
Sent: Wednesday, April 22, 2009 7:26 AM
To: momentics-community
Subject: Re: Virtual Serial port problem

Update! 

I learn from this file /etc/system/enum/devices/usb/char that it
supports FTDI chipset with device ID 6001. But the FTDI chipset I'm
using is with device ID 6010. So I guess that model isn't supported yet.

Is it possible to add a device entry with device ID of this model in
that configuration file so that it can be verified if the existing
driver works?

_______________________________________________
QNX Momentics Community Support
http://community.qnx.com/sf/go/post27706
Re: RE: Virtual Serial port problem  
Robert, kindly refer to the earlier posts in this thread. I have listed down the options which I have tried and it 
includes vid, did, busno, devno.
RE: RE: Virtual Serial port problem  
Missed that.  That's the problem with no history in the individual forum
posts :->>

In any case, I'm now confused.  Did the driver work with the options you
passed and you're now asking how to modify the enumerator configuration
files so that the driver can be started with those options
automatically?  I wouldn't expect the driver to support all FTDI chip
variants automatically.

 R.

-----Original Message-----
From: Lakshminarayanan R [mailto:community-noreply@qnx.com] 
Sent: Wednesday, April 22, 2009 8:35 AM
To: momentics-community
Subject: Re: RE: Virtual Serial port problem

Robert, kindly refer to the earlier posts in this thread. I have listed
down the options which I have tried and it includes vid, did, busno,
devno.

_______________________________________________
QNX Momentics Community Support
http://community.qnx.com/sf/go/post27713
Re: RE: RE: Virtual Serial port problem  
The driver got loaded and I could see the /dev/serusb nodes after loading. And I don't see any errors in slog. But, when
 I write some data into that port it remains there itself.

cat sample > /dev/serusb1
cat /dev/serusb1 shows the contents of the sample file. This should be available on the other end of the connection.

Although the driver gets loaded and nodes are available, the communication is not succeeding. So, basically it is not 
working. For this, I thought if I could change this configuration and allow it to mount automatically and see how it 
works.

The driver which I'm using is FT2232D - USB to Dual UART - and the driver which is claimed to be supported by QNX is 
FT8U232AM - USB to single UART.

Any idea if this existing driver will work for FT2232D chipset??
Re: RE: RE: Virtual Serial port problem  
once you load the driver , how can I communicate with it in a C program. can I use the ftdilib or what else? hope 
anybody can help me!! thanks
Re: RE: RE: Virtual Serial port problem  
Once you load the driver check for /dev/serusb* entries. If you find one, you have rightly installed the driver and you 
can communicate with it like the way you communicate with any other serial port. 

Instead of /dev/ser* just use the appropriate /dev/serusb*.

Hope it helps!
Re: RE: RE: Virtual Serial port problem  
i used to handle serial port with termios.h, my problem is that i need the serial.h lib to set the baudrate to a custom 
one (512Kbaud) for this reason i need too call ioctl() with constant TIOSSSERIAL and a struct serial. i see that serial.
h doesn't exists. otherwise i wanted to use the ftdi lib to communicate with my ftdi chip. has anybody experience with 
such a problem??
Re: RE: RE: Virtual Serial port problem  
If not tried earlier, try using tcgetattr and tcsetattr to change the baud rate.

Hope it helps!