PORTS Forum
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
This forum is closed to new activity.
The posts are available to browse, but posting has been disabled. BIG THANKS to all who have participated and shared your knowledge over the past 13 years.
Aug 11, 2023
Home
Help
Search
Login
Register
PORTS Forum
»
Ports and Interfaces
»
USB
»
WinUSB bugs?
« previous
next »
Print
Pages: [
1
]
Author
Topic: WinUSB bugs? (Read 18109 times)
lcpoon
Frequent Contributor
Posts: 58
WinUSB bugs?
«
on:
April 16, 2012, 04:26:05 am »
I send a command to the uC 3 times and used SysNucleus USBTrace to monitor the USB activities. The uC consistently returns "Rev: A (16th April 2012)".
Using WinUSB VB codes, I found out that the return message contains rubbish data concatenated with the desired data. The problem is that the rubbish data keeps changing. How to solve this?
Logged
lcpoon
Frequent Contributor
Posts: 58
Re: WinUSB bugs?
«
Reply #1 on:
April 16, 2012, 04:28:54 am »
The problem only occurs in Window 7. I have the program running in Windows XP and no problem at all (no rubbish data concatenated with the desired data).
Logged
lcpoon
Frequent Contributor
Posts: 58
Re: WinUSB bugs?
«
Reply #2 on:
April 16, 2012, 04:34:10 am »
See attached file for more details.
[attachment deleted by admin]
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 3033
Re: WinUSB bugs?
«
Reply #3 on:
April 16, 2012, 10:55:59 am »
A hardware protocol analyzer will show what is happening on the bus. If you don't have an analyzer, use a monitor program, watch variables, etc., or whatever debugging tools you have to find out what the device is sending.
Jan
Logged
lcpoon
Frequent Contributor
Posts: 58
Re: WinUSB bugs?
«
Reply #4 on:
April 16, 2012, 11:15:09 am »
Actually I am using USB Trace to log all the USB events as attached. The device is sending "Rev: A (16th April 2012). It is the VB program that gives incorrect output.
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 3033
Re: WinUSB bugs?
«
Reply #5 on:
April 16, 2012, 11:26:01 am »
In the call to
deleg.EndInvoke(receivedDataBuffer, bytesRead, success, ar)
bytesRead is the number of bytes read. Anything after that is whatever was in the application's buffer.
Jan
Logged
lcpoon
Frequent Contributor
Posts: 58
Re: WinUSB bugs?
«
Reply #6 on:
April 16, 2012, 08:41:16 pm »
It works. I make use of bytesRead information to get rid of unwanted data. Thanks.
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 3033
Re: WinUSB bugs?
«
Reply #7 on:
April 16, 2012, 10:48:27 pm »
Glad you got it working. I'll try to remember to fix that on the next update.
Jan
Logged
Print
Pages: [
1
]
« previous
next »
PORTS Forum
»
Ports and Interfaces
»
USB
»
WinUSB bugs?