USB
  Problems with RealTerm and CP210x

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Problems with RealTerm and CP210x
f.angelini
New Member
posted December 18, 2007 12:01 PM     Click Here to See the Profile for f.angelini   Click Here to Email f.angelini     Edit/Delete Message
Hello, I need some help to get RealTerm 2.0.0.43 and CP210x virtual COM port working together. I installed latest VCP drivers (5.1.0.0) and if I use HyperTerminal all things seems to be OK and I can send and receive data (but this software is too poor to my purposes, for example there's no CTS/RTS pin management). When I try to open virtual COM port related to USB device in Realterm, I get the "peripheral not working" error. I'm using Windows XP SP2.

IP: Logged

Tsuneo
Member
posted December 19, 2007 09:42 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
PortMon shows that RealTerm fails IOCTL_SERIAL_SET_QUEUE_SIZE request when it opens CP210x VCP port.

RealTerm: v2.0.0.43
CP210x VCP driver: 5.1.0.0

IOCTL_SERIAL_SET_QUEUE_SIZE - (maybe issued by SetupComm())
InSize: 65520 (0xFFF0)
OutSize: 16384 (0x4000)
return code: STATUS_UNSUCCESSFUL (0xC0000001L)

The usual coding manner to change the default IN/OUT queue size is,
1) call GetCommProperties()
Then the maximum queue size is returned in
dwMaxTxQueue and dwMaxRxQueue fields of COMMPROP structure.
These queue size are
a) Hard-coded in the device driver
OR
b) setup on the registry by the INF file

2) set the queue size by SetupComm()
The queue size is determined according to dwMaxTxQueue and dwMaxRxQueue.

RealTerm seems not to follow this convention.

Unfortunately, we cannot access to the source code of RealTerm.
Report it to the support forum for RealTerm.

[References]
RealTerm: http://realterm.sourceforge.net/
PortMon: http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
IOCTL_SERIAL_SET_QUEUE_SIZE: http://msdn2.microsoft.com/en-us/library/ms800971.aspx
SetupComm: http://msdn2.microsoft.com/en-us/library/aa911370.aspx
GetCommProperties: http://msdn2.microsoft.com/en-us/library/aa911509.aspx

Tsuneo

IP: Logged

Tsuneo
Member
posted December 19, 2007 11:27 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Aha,
SiLabs VCP driver (v5.1.0.0) doesn't support IOCTL_SERIAL_GET_PROPERTIES (GetCommProperties()) properly, for the queue size.

It returns these result in COMMPROP structure, as the default setting.
dwMaxTxQueue = 0
dwMaxRxQueue = 0
dwCurrentTxQueue = 0
dwCurrentRxQueue = 512

Then, report it to SiLabs also.

Tsuneo

IP: Logged

f.angelini
New Member
posted December 20, 2007 03:33 AM     Click Here to See the Profile for f.angelini   Click Here to Email f.angelini     Edit/Delete Message
Using the old 4.38 VCP drivers and the same 2.0.0.43 RealTerm version, all is working correctly. Moreover, I noticed another strange thing: using the 5.1 version, when I connect USB connector to my peripheral (before opening COM port), DTR and RTS pin levels goes high and low some times and become steady high only after 4-5 seconds; using the old version of drivers this strange behaviour does not happens.

IP: Logged

Tsuneo
Member
posted December 20, 2007 03:47 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Anyway, I don't have the source code of SiLabs VCP driver.
There is no way for us to fix the bugs without the source code.
The bugs are clear. Report it to SiLabs ( mcutools@silabs.com ).
Send the URL of this topic to SiLabs to make them aware of this problem.
I posted enough information for bug fix.

Tsuneo

IP: Logged

xiaofan
Member
posted December 24, 2007 06:02 AM     Click Here to See the Profile for xiaofan     Edit/Delete Message
Unfortunately, we cannot access to the source code of RealTerm.
Report it to the support forum for RealTerm.

Realterm installation does come with the Delphi 7 based source codes (you need to choose this option during the installation). But I am not so sure if this helps to identify the problem as it seems to use some external components.

IP: Logged

Tsuneo
Member
posted December 24, 2007 10:26 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Hi xiaofan,

"Realterm installation does come with the Delphi 7 based source codes (you need to choose this option during the installation)."

Ah, thanks.
I wasn't aware of it.

"But I am not so sure if this helps to identify the problem as it seems to use some external components."

Ya, RealTerm uses this component. I found it from the source code of RealTerm.

"TurboPower Async Professional"
http://sourceforge.net/projects/tpapro/

As you said, the problem lies in the implementation of the component.
The unit AdPort (AdPort.pas) should provide some interface to return dwMaxTxQueue and dwMaxRxQueue from GetCommProperties() (Win serial API). To implement this interface, AwWin32.pas should have a wrapper of GetCommProperties().


Anyway, if SiLabs new VCP driver just succeeds IOCTL_SERIAL_SET_QUEUE_SIZE, there is no problem even without any modification on the RealTerm side

I sent a bug report to SiLabs, as follows.

Bug report on CP210x VCP driver

Driver version: v5.1.0.0
These bugs are found in TXQueue and RXQueue handling.

a) IOCTL_SERIAL_SET_QUEUE_SIZE
fails in this input parameters, though v4.40 succeeds.
InSize: 65520 (0xFFF0)
OutSize: 16384 (0x4000)
return code: STATUS_UNSUCCESSFUL (0xC0000001L)

b) IOCTL_SERIAL_GET_PROPERTIES
returns these false result in COMMPROP structure, as the default setting.
dwMaxTxQueue = 0
dwMaxRxQueue = 0
dwCurrentTxQueue = 0
dwCurrentRxQueue = 512

Tsuneo

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b