How to read USB device register?

Hi,

is there a way to read USB device register? for example, is there a “existing” function to read USB device’s internal register, let me say, address 0x00 in EZ-USB FX2?

I guess there is no “existing” function for this requirement. To do this, I need to send USB device a user defined packet. The USB device (for example, EZ-USB FX2) understands this packet and reads register from address 0x00, then device sends back the data to driver so that driver gets register value. The packet between driver and device is pre-defined by designers. Without these pre-defined information you can’t configure these registers. Is my understanding right? Thanks very much.

You need to define a “vendor-specific” request for that purpose.
EZ-USB dev board already comes with examples of vendor-specific requests.

There is a KMDF sample for FX2 board:
WinDDK/6000/src/kmdf/osrusbfx2/sys/final/
In ioctl.c you will find several vendor-specific requests.
For example, you can examine the implementation of
IOCTL_OSRUSBFX2_READ_SWITCHES

Cheers,
Alexey

xxxxx@hotmail.com wrote:

Hi,

is there a way to read USB device register? for example, is there a “existing” function to read USB device’s internal register, let me say, address 0x00 in EZ-USB FX2?

I guess there is no “existing” function for this requirement. To do this, I need to send USB device a user defined packet. The USB device (for example, EZ-USB FX2) understands this packet and reads register from address 0x00, then device sends back the data to driver so that driver gets register value. The packet between driver and device is pre-defined by designers. Without these pre-defined information you can’t configure these registers. Is my understanding right? Thanks very much.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Alexey Polonsky wrote:

You need to define a “vendor-specific” request for that purpose.
EZ-USB dev board already comes with examples of vendor-specific requests.

There is a KMDF sample for FX2 board:
WinDDK/6000/src/kmdf/osrusbfx2/sys/final/
In ioctl.c you will find several vendor-specific requests.
For example, you can examine the implementation of
IOCTL_OSRUSBFX2_READ_SWITCHES

Right. Also remember that you have to modify the firmware to process
the command and return the results. The FX2 can handle memory read and
write requests automatically, but not register reads and writes.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>between driver and device is pre-defined by designers. Without these
pre-defined

information you can’t configure these registers. Is my understanding right?

Yes


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Hi all,

thanks for your help very much.