Cypress USB chipset returns empty ISO reads

I have hardware using the Cypress SX2 chipset. Using the EZUSB Control Panel supplied by Cypress, and this hardware, I can push the ISO TRANS button and get nice looking data from the device (it is landfill generated by the Hardware Dude who sits next to me).

So the hardware is working fine.

My goal now is to read/write iso from my own code. I have written a little applet that opens the device, resets the pipe,and sends down an ISO_READ ioctl. I wrote the code after painstakingly reverse engineering what the control panel app is doing through use of a third party software based USB packet sniffer and the Windows XP kernel debugger, WINDBG. I am quite certain I am doing the same things and in the same order as the control panel: open, reset pipe, iso read. I am also taking pains to set my crucial read variables to the same as in the control panel, viz:
const unsigned PACKETSIZE = 16;
const unsigned PACKETCOUNT = 128;
const unsigned PIPENUM = 3;
const unsigned BUFFERCOUNT = 2;
const unsigned FRAMESPERBUFFER = 8;


PUSBD_ISO_PACKET_DESCRIPTOR isoDesc;

IsoControl.PacketSize = PACKETSIZE;
IsoControl.PacketCount = PACKETCOUNT;
IsoControl.PipeNum = PIPENUM;
IsoControl.BufferCount = BUFFERCOUNT;
IsoControl.FramesPerBuffer = FRAMESPERBUFFER;

Moreover, when I issue the read, I can check the buffer size variable in the irp down in the driver. It is the same in my code as in the control panel code, 0xe00.

You may recall that when this IOCTL is called, the driver returns a buffer which contains data packets end-to-end in the first part (payload), and the last part is an array of headers containing status information about each packet. The driver also returns NT status, a USB status DWORD, and the length of the returned data, in addition to setting a LastError variable to be retrieved from GetLastError().

I am getting back ERROR_SUCCESS from DeviceIoControl(), a returned data length of 0, and a buffer that is not touched in it’s leading half, but which has an array of headers at the tail end. The headers all say that zero bytes of data were returned in the packet, and an error USB_BABBLE_DETECTED is returned for each(I noticed the control panel sometimes also returns this error, but always has data). The headers also contain offset information which appears to be correct.

But, no payload! Nothing but air.

I have followed this down to IoCallDriver() where it calls the USB bus driver. As far as I can see, the parameters are all fine going in - the packets for my code and the control panel call are all being set up in the same code path; the variables are all the same. But no dice.

I assume the cypress code is passing some value down at some point that is different from what I am using - a flag, a buffer size, G-d knows - but I am not able to figure out what it is. I have scoured my code and the structures being passed into the driver but as far as I can see we are passing exactly the same bits down to the same hardware through the same driver, but we are getting different results. I have also checked the PhysicalDeviceObject and StackDeviceObject to make sure the same bus driver is getting both calls. It is.

So, obviously I am missing a flag somewhere. I don’t have the source to the cypress app, and the apps for which I have source are not working.

Does anyone know what this could be? What is the missing variable?

Thanks very much.

Eric

xxxxx@gmail.com wrote:

My goal now is to read/write iso from my own code. I have written a little applet that opens the device, resets the pipe,and sends down an ISO_READ ioctl.

Do you mean IOCTL_EZUSB_ISO_READ? Remember that those ioctls are all
custom to the Cypress drivers. Many of us have experience with them,
but they’re not standard by any means.

I wrote the code after painstakingly reverse engineering what the control panel app is doing through use of a third party software based USB packet sniffer and the Windows XP kernel debugger, WINDBG. I am quite certain I am doing the same things and in the same order as the control panel: open, reset pipe, iso read. I am also taking pains to set my crucial read variables to the same as in the control panel, viz:
const unsigned PACKETSIZE = 16;
const unsigned PACKETCOUNT = 128;
const unsigned PIPENUM = 3;
const unsigned BUFFERCOUNT = 2;
const unsigned FRAMESPERBUFFER = 8;

You might show us your descriptors. This says that your isochronous
pipe has a packet size of 16 bytes. Are you absolutely sure that’s correct?

Moreover, when I issue the read, I can check the buffer size variable in the irp down in the driver. It is the same in my code as in the control panel code, 0xe00.

Where does that come from? 16x128 is 0x800, not 0xe00. Is the packet
size actually 28, maybe?

You may recall that when this IOCTL is called, the driver returns a buffer which contains data packets end-to-end in the first part (payload), and the last part is an array of headers containing status information about each packet.

Sort of. Remember that the payload part is divided into packets; if one
of the transfers was short or failed, there is a gap in the payload.
The driver doesn’t pack the “good data” together for you.

I am getting back ERROR_SUCCESS from DeviceIoControl(), a returned data length of 0, and a buffer that is not touched in it’s leading half, but which has an array of headers at the tail end. The headers all say that zero bytes of data were returned in the packet, and an error USB_BABBLE_DETECTED is returned for each(I noticed the control panel sometimes also returns this error, but always has data).

USBD_STATUS_BABBLE_DETECTED means that your endpoint sent more data than
your request told it to expect. So, with your code, if your endpoint
were to send back more than 16 bytes, that’s babble.

The headers also contain offset information which appears to be correct.

That’s copied directly from the incoming URB.

So, obviously I am missing a flag somewhere. I don’t have the source to the cypress app, and the apps for which I have source are not working.

Cypress used to ship the source code for their drivers and utilities. I
certainly have it. Don’t they do that any more?


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

Answers inline.

On 10/4/07, Tim Roberts wrote:
>
> xxxxx@gmail.com wrote:
> > My goal now is to read/write iso from my own code. I have written a
> little applet that opens the device, resets the pipe,and sends down an
> ISO_READ ioctl.
>
> Do you mean IOCTL_EZUSB_ISO_READ? Remember that those ioctls are all
> custom to the Cypress drivers. Many of us have experience with them,
> but they’re not standard by any means.

Yes.

> I wrote the code after painstakingly reverse engineering what the control
> panel app is doing through use of a third party software based USB packet
> sniffer and the Windows XP kernel debugger, WINDBG. I am quite certain I am
> doing the same things and in the same order as the control panel: open,
> reset pipe, iso read. I am also taking pains to set my crucial read
> variables to the same as in the control panel, viz:
> > const unsigned PACKETSIZE = 16;
> > const unsigned PACKETCOUNT = 128;
> > const unsigned PIPENUM = 3;
> > const unsigned BUFFERCOUNT = 2;
> > const unsigned FRAMESPERBUFFER = 8;
> >
>
> You might show us your descriptors. This says that your isochronous
> pipe has a packet size of 16 bytes. Are you absolutely sure that’s
> correct?

Well, I have experimented with that size and others. The basic results do
not change. The endpoints on the device are configured for 64 byte packets
max.

> Moreover, when I issue the read, I can check the buffer size variable in
> the irp down in the driver. It is the same in my code as in the control
> panel code, 0xe00.
> >
>
> Where does that come from? 16x128 is 0x800, not 0xe00. Is the packet
> size actually 28, maybe?

Well, the buffer size takes the packet size, adds the size of the header (12
bytes), and multiplies by # of packets. So that’s where that comes from.

> You may recall that when this IOCTL is called, the driver returns a buffer
> which contains data packets end-to-end in the first part (payload), and the
> last part is an array of headers containing status information about each
> packet.
>
> Sort of. Remember that the payload part is divided into packets; if one
> of the transfers was short or failed, there is a gap in the payload.
> The driver doesn’t pack the “good data” together for you.

Right, well, it looks like they are all failing.

> I am getting back ERROR_SUCCESS from DeviceIoControl(), a returned data
> length of 0, and a buffer that is not touched in it’s leading half, but
> which has an array of headers at the tail end. The headers all say that zero
> bytes of data were returned in the packet, and an error USB_BABBLE_DETECTED
> is returned for each(I noticed the control panel sometimes also returns this
> error, but always has data).
>
> USBD_STATUS_BABBLE_DETECTED means that your endpoint sent more data than
> your request told it to expect. So, with your code, if your endpoint
> were to send back more than 16 bytes, that’s babble.
>
> > The headers also contain offset information which appears to be
> correct.
> >
>
> That’s copied directly from the incoming URB.
>
> > So, obviously I am missing a flag somewhere. I don’t have the source to
> the cypress app, and the apps for which I have source are not working.
> >
>
> Cypress used to ship the source code for their drivers and utilities. I
> certainly have it. Don’t they do that any more?

Hm, well, if they ship the source for the EZUSB Control Panel I would love
to see it. I have source for some other stuff but not that.

Thanks for your help.

Eric


> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>

Eric Fowler wrote:

> I wrote the code after painstakingly reverse engineering what
the control panel app is doing through use of a third party
software based USB packet sniffer and the Windows XP kernel
debugger, WINDBG. I am quite certain I am doing the same things
and in the same order as the control panel: open, reset pipe, iso
read. I am also taking pains to set my crucial read variables to
the same as in the control panel, viz:
> const unsigned PACKETSIZE = 16;
> const unsigned PACKETCOUNT = 128;
> const unsigned PIPENUM = 3;
> const unsigned BUFFERCOUNT = 2;
> const unsigned FRAMESPERBUFFER = 8;
>

You might show us your descriptors. This says that your isochronous
pipe has a packet size of 16 bytes. Are you absolutely sure
that’s correct?

Well, I have experimented with that size and others. The basic results
do not change. The endpoints on the device are configured for 64 byte
packets max.

In that case, you are REQUIRED to send URBs with 64-byte packets.
Nothing less. You can send more, but the extra space in each packet
will simply be skipped.

It’s somewhat unusual to have an isochronous pipe with 64-byte packets.
For that size, you’d expect an interrupt pipe instead. What kind of
device is this?


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

Inline.

On 10/5/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> >
> > Well, I have experimented with that size and others. The basic results
> > do not change. The endpoints on the device are configured for 64 byte
> > packets max.
>
> In that case, you are REQUIRED to send URBs with 64-byte packets.
> Nothing less. You can send more, but the extra space in each packet
> will simply be skipped.
>
> It’s somewhat unusual to have an isochronous pipe with 64-byte packets.
> For that size, you’d expect an interrupt pipe instead. What kind of
> device is this?
>
But the Control Panel software gets good reads at all sizes (whine). I
assume they just toss out the extra duff. But I will try 64.

It’s a gutted out cell phone with wires up the wazoo, pulling in audio (and
other) data and sending it over USB to some test bench hardware. The other
data is travelling in bulk packets and making it OK.

The Hardware Dude chose 64 bytes. I will ask him why.

Thanks again.

Eric

On 10/5/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
>
> It’s somewhat unusual to have an isochronous pipe with 64-byte packets.
> For that size, you’d expect an interrupt pipe instead. What kind of
> device is this?

Just talked to Mr. Hardware. Basically he just pulled a number out of the
air for prototyping purposes.

Setting the packet size to 16 and 512 in the software did not change the
results: no errors, no data.

No brains, no headaches.

Eric

xxxxx@gmail.com wrote:

const unsigned PACKETSIZE = 16;
const unsigned PACKETCOUNT = 128;
const unsigned PIPENUM = 3;
const unsigned BUFFERCOUNT = 2;
const unsigned FRAMESPERBUFFER = 8;

PUSBD_ISO_PACKET_DESCRIPTOR isoDesc;

IsoControl.PacketSize = PACKETSIZE;
IsoControl.PacketCount = PACKETCOUNT;
IsoControl.PipeNum = PIPENUM;
IsoControl.BufferCount = BUFFERCOUNT;
IsoControl.FramesPerBuffer = FRAMESPERBUFFER;

There’s one other thing I haven’t checked – the pipe number. Remember
that in all of the Ezusb IOCTLS, the pipe number is the ordinal of that
pipe within the descriptors. It is NOT the endpoint address. So, you
are asking to talk to the 4th endpoint in the interface (ordinal 3,
starting from 0). Is that correct? Do you really have 4 endpoints?

(Actually, I’m guessing this is probably OK, because the FX2/SX2 chips
don’t have an endpoint address 3.)

Have you selected the proper alternate setting for your interface?
Remember that the default alternate setting (0) isn’t allowed any
isochronous bandwidth.


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

On 10/5/07, Tim Roberts wrote:
>
> xxxxx@gmail.com wrote:
> > const unsigned PACKETSIZE = 16;
> > const unsigned PACKETCOUNT = 128;
> > const unsigned PIPENUM = 3;
> > const unsigned BUFFERCOUNT = 2;
> > const unsigned FRAMESPERBUFFER = 8;
> > …
> > PUSBD_ISO_PACKET_DESCRIPTOR isoDesc;
> >
> > IsoControl.PacketSize = PACKETSIZE;
> > IsoControl.PacketCount = PACKETCOUNT;
> > IsoControl.PipeNum = PIPENUM;
> > IsoControl.BufferCount = BUFFERCOUNT;
> > IsoControl.FramesPerBuffer = FRAMESPERBUFFER;
> >
>
> There’s one other thing I haven’t checked – the pipe number. Remember
> that in all of the Ezusb IOCTLS, the pipe number is the ordinal of that
> pipe within the descriptors. It is NOT the endpoint address. So, you
> are asking to talk to the 4th endpoint in the interface (ordinal 3,
> starting from 0). Is that correct? Do you really have 4 endpoints?
>
> (Actually, I’m guessing this is probably OK, because the FX2/SX2 chips
> don’t have an endpoint address 3.)

Both the Control Panel and my code are sending in pipe #3.
Here is some info from Ctrl Panel, the endpoint is what I expect it to be
… :

EZ-USB Control Panel - built 11:31:58 Sep 17 2002
Get PipeInfo
Interface Size 96
Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40
<---------------------------LOOK!

Config Descriptor:
bLength: 0x9
bDescriptorType: 2
wTotalLength: 70 (0x46)
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: 0xa0
MaxPower: 50

Interface Descriptor:
--------------------------------
bLength: 0x9
bDescriptorType: 4
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 4
bInterfaceClass: 255 (0xff)
bInterfaceSubClass: 0 (0x0)
bInterfaceProtocol: 0 (0x0)
iInterface: 0

Endpoint Descriptor 0
--------------------------------
bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x2
bmAttributes: 0x2
wMaxPacketSize: 512
bInterval: 0

Endpoint Descriptor 1
--------------------------------
bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x4
bmAttributes: 0x1
wMaxPacketSize: 64
bInterval: 0

Endpoint Descriptor 2
--------------------------------
bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x86
bmAttributes: 0x2
wMaxPacketSize: 512
bInterval: 0

Endpoint Descriptor 3 <-----------------------------------------LOOK!!!
--------------------------------
bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x88
bmAttributes: 0x1
wMaxPacketSize: 64
bInterval: 0

Interface Descriptor:
--------------------------------
bLength: 0x9
bDescriptorType: 2
bInterfaceNumber: 70
bAlternateSetting: 0
bNumEndpoints: 1
bInterfaceClass: 1 (0x1)
bInterfaceSubClass: 0 (0x0)
bInterfaceProtocol: 160 (0xa0)
iInterface: 50

Endpoint Descriptor 0
--------------------------------
bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x2
bmAttributes: 0x2
wMaxPacketSize: 64
bInterval: 0

Interface Descriptor:
--------------------------------
bLength: 0x7
bDescriptorType: 5
bInterfaceNumber: 2
bAlternateSetting: 2
bNumEndpoints: 0
bInterfaceClass: 2 (0x2)
bInterfaceSubClass: 0 (0x0)
bInterfaceProtocol: 7 (0x7)
iInterface: 0

Interface Descriptor:
--------------------------------
bLength: 0x7
bDescriptorType: 0
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 0
bInterfaceClass: 0 (0x0)
bInterfaceSubClass: 0 (0x0)
bInterfaceProtocol: 255 (0xff)
iInterface: 255


Have you selected the proper alternate setting for your interface?
> Remember that the default alternate setting (0) isn’t allowed any
> isochronous bandwidth.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>

Eric Fowler wrote:

EZ-USB Control Panel - built 11:31:58 Sep 17 2002
Get PipeInfo
Interface Size 96
Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40
<---------------------------LOOK!

Yes, it is correct. Endpoint #8 is ordinal 3, and 3 is what you need to
use. What I was pointing out is that some people think (reasonably
enough) that they should use 8 for the pipe number, but Windows doesn’t
work that way.

Config Descriptor:
bLength: 0x9
bDescriptorType: 2
wTotalLength: 70 (0x46)
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: 0xa0
MaxPower: 50

Isn’t your descriptor 46 (decimal) bytes long, not 46 (hex)? Note how
usbview is running off the end and analyzing bogus extra descriptors.
As I see it, you have 9+9+7+7+7+7+7, which is 46 decimal bytes.

*********************************
Interface Descriptor:

bLength: 0x9
bDescriptorType: 4
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 4
bInterfaceClass: 255 (0xff)
bInterfaceSubClass: 0 (0x0)
bInterfaceProtocol: 0 (0x0)
iInterface: 0
*********************************

*********************************
Endpoint Descriptor 3
<-----------------------------------------LOOK!!!

bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x88
bmAttributes: 0x1
wMaxPacketSize: 64
bInterval: 0
*********************************

This is illegal. Alternate setting 0 for your interface has isochronous
endpoints that reserve bandwidth. That’s not allowed. You need to have
an alternate setting 0 with no endpoints, and an alternate setting 1
with bandwidth.


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

On 10/5/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> > EZ-USB Control Panel - built 11:31:58 Sep 17 2002
> > Get PipeInfo
> > Interface Size 96
> > Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
> > Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
> > Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
> > Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40
> > <---------------------------LOOK!
>
> Yes, it is correct. Endpoint #8 is ordinal 3, and 3 is what you need to
> use. What I was pointing out is that some people think (reasonably
> enough) that they should use 8 for the pipe number, but Windows doesn’t
> work that way.
>
>
> > Config Descriptor:
> > bLength: 0x9
> > bDescriptorType: 2
> > wTotalLength: 70 (0x46)
> > bNumInterfaces: 1
> > bConfigurationValue: 1
> > iConfiguration: 0
> > bmAttributes: 0xa0
> > MaxPower: 50
>
> Isn’t your descriptor 46 (decimal) bytes long, not 46 (hex)? Note how
> usbview is running off the end and analyzing bogus extra descriptors.
> As I see it, you have 9+9+7+7+7+7+7, which is 46 decimal bytes.

Yep. Good catch.

>
> > Interface Descriptor:
> > --------------------------------
> > bLength: 0x9
> > bDescriptorType: 4
> > bInterfaceNumber: 0
> > bAlternateSetting: 0
> > bNumEndpoints: 4
> > bInterfaceClass: 255 (0xff)
> > bInterfaceSubClass: 0 (0x0)
> > bInterfaceProtocol: 0 (0x0)
> > iInterface: 0
> >

> > …
> >
> > Endpoint Descriptor 3
> > <-----------------------------------------LOOK!!!
> > --------------------------------
> > bLength: 0x7
> > bDescriptorType: 5
> > bEndpointAddress: 0x88
> > bmAttributes: 0x1
> > wMaxPacketSize: 64
> > bInterval: 0
> >

>
> This is illegal. Alternate setting 0 for your interface has isochronous
> endpoints that reserve bandwidth. That’s not allowed. You need to have
> an alternate setting 0 with no endpoints, and an alternate setting 1
> with bandwidth.

A little puzzled by this - basically bAlternateSetting == (say) 3 means I
have
3 more endpoints?

And bAlternateSettings = 0 means no more endpoints … I think …

Thanks.

Eric Fowler wrote:

A little puzzled by this - basically bAlternateSetting == (say) 3
means I have
3 more endpoints?

And bAlternateSettings = 0 means no more endpoints … I think …

No. A given interface can have any number of alternate settings. It’s
just a way to change the attributes of the endpoints within that
interface. So, for example, alternate setting 0 could have all your
endpoints be bulk. Alternate setting 1 could have two of them be
isochronous, with packet size 64. Alternate setting 2 could have them
be isochronous, with packet size 512. Only 1 alternate setting for each
interface is active at any given time.

In Windows, alternate setting 0 (which is the default) must not reserve
up isochronous bandwidth. After the driver is running, you have to do a
SELECT_INTERFACE to choose an alternate setting where the endpoints DO
reserve bandwidth. That can fail if there isn’t enough left, which is
why the default isn’t allowed to reserve any.


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

On 10/5/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> >
> No. A given interface can have any number of alternate settings. It’s
> just a way to change the attributes of the endpoints within that
> interface.
>
> In Windows, alternate setting 0 (which is the default) must not reserve
> up isochronous bandwidth. After the driver is running, you have to do a
> SELECT_INTERFACE …

OK, been there, done that. I now have one interface, two settings, first one
(0) has 0 endpoints other than the default, second has two bulk, two iso.

I am getting the same results from the iso reads -
- Data in buffer not touched
- Offset is correct
- Zero length
- USBD_STATUS_XACT_ERROR returned for USB status.

I noticed another thread describing this problem bouncing around a couple
years back, here is the url:
(http://www.osronline.com/showThread.cfm?link=74222)

If the original writers are still around, maybe they recall the solution?

Also, I would like to point out that I got the source to the Cypress EZUSB
Control Panel app (they ship it with their dev kits, just have to know where
to look for it), and discovered they are also having trouble reading ISO
from the device, including their own defaults. They ‘solve’ the
problem by populating
the buffer with dummy data, reporting success, and displaying the fake
data!!!?!!! Since their dummy data was little-endian 16 bit words,
incremented by 1, starting at zero, which is exactly what our board firmware
was sending out as test pattern, I spent about three days believing their
software was able to do what mine could not.

EVIL!!! Caveat programmer!

Anyway, any insights into this problem are appreciated. We are shopping for
a USB packet sniffer in the meantime.

Eric

By the way - I forgot to post this earlier, it may help:

Get PipeInfo
Interface Size 96
Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40
Config Descriptor:
bLength: 0x9
bDescriptorType: 2
wTotalLength: 55 (0x37)
bNumInterfaces: 1
bConfigurationValue: 0
iConfiguration: 4
bmAttributes: 0xc0
MaxPower: 50
*********************************
Interface Descriptor:

bLength: 0x9
bDescriptorType: 4
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 0
bInterfaceClass: 255 (0xff)
bInterfaceSubClass: 255 (0xff)
bInterfaceProtocol: 255 (0xff)
iInterface: 4
*********************************
Interface Descriptor:

bLength: 0x9
bDescriptorType: 4
bInterfaceNumber: 0
bAlternateSetting: 1
bNumEndpoints: 4
bInterfaceClass: 255 (0xff)
bInterfaceSubClass: 255 (0xff)
bInterfaceProtocol: 255 (0xff)
iInterface: 5
*********************************
Endpoint Descriptor 0

bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x2
bmAttributes: 0x2
wMaxPacketSize: 512
bInterval: 0
*********************************
Endpoint Descriptor 1

bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x4
bmAttributes: 0x1
wMaxPacketSize: 64
bInterval: 0
*********************************
Endpoint Descriptor 2

bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x86
bmAttributes: 0x2
wMaxPacketSize: 512
bInterval: 0
*********************************
Endpoint Descriptor 3

bLength: 0x7
bDescriptorType: 5
bEndpointAddress: 0x88
bmAttributes: 0x1
wMaxPacketSize: 64
bInterval: 0
*********************************

Eric Fowler wrote:

By the way - I forgot to post this earlier, it may help:

Get PipeInfo
Interface Size 96
Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40

I’ve forgotten some of the basics now. When you set up the ISO URB, are
you setting up the IsoPacket structure so that all of the packets are 64
bytes?

The FX2 can certainly do isochronous. We have one here that does
high-bandwidth, 3072 bytes per microframe.


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

On 10/11/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> > By the way - I forgot to post this earlier, it may help:
> >
> > Get PipeInfo
> > Interface Size 96
> > Pipe: 0 Type: BLK Endpoint: 2 OUT MaxPktSize: 0x200
> > Pipe: 1 Type: ISO Endpoint: 4 OUT MaxPktSize: 0x40
> > Pipe: 2 Type: BLK Endpoint: 6 IN MaxPktSize: 0x200
> > Pipe: 3 Type: ISO Endpoint: 8 IN MaxPktSize: 0x40
>
> I’ve forgotten some of the basics now. When you set up the ISO URB, are
> you setting up the IsoPacket structure so that all of the packets are 64
> bytes?

I have been experimenting. The current settings are:

const unsigned PACKETSIZE = 64;
const unsigned PACKETCOUNT = 128;
const unsigned PIPENUM = 3;
const unsigned BUFFERCOUNT = 2;
const unsigned FRAMESPERBUFFER = 8;

The FX2 can certainly do isochronous. We have one here that does
> high-bandwidth, 3072 bytes per microframe.
>
> I am using an SX2 mastered by an FPGA. No FX2. But that’s not going to
matter, no?

Eric

Eric Fowler wrote:

I have been experimenting. The current settings are:

const unsigned PACKETSIZE = 64;
const unsigned PACKETCOUNT = 128;
const unsigned PIPENUM = 3;
const unsigned BUFFERCOUNT = 2;
const unsigned FRAMESPERBUFFER = 8;

That looks fine.

I am using an SX2 mastered by an FPGA. No FX2. But that’s not going to
matter, no?

No, it just means you have to write the registers externally, because
you don’t have the 8051.

Are you continuously shoving data into the endpoint 8 FIFO? Can you see
that the FIFO is not empty?


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

On 10/11/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> > I have been experimenting. The current settings are:
> >
> > const unsigned PACKETSIZE = 64;
> > const unsigned PACKETCOUNT = 128;
> > const unsigned PIPENUM = 3;
> > const unsigned BUFFERCOUNT = 2;
> > const unsigned FRAMESPERBUFFER = 8;
>
> That looks fine.
>
> > I am using an SX2 mastered by an FPGA. No FX2. But that’s not going to
> > matter, no?
>
> No, it just means you have to write the registers externally, because
> you don’t have the 8051.
>
> Are you continuously shoving data into the endpoint 8 FIFO? Can you see
> that the FIFO is not empty?

The hardware guy swears he is sending out iso packets continually. I
couldn’t tell you which endpoint but will ask. He has said he has very
little visibility on that FIFO in his current environment.

I will let you know.

Thanks.

Eric

On 10/11/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> > I have been experimenting. The current settings are:
> >
> > const unsigned PACKETSIZE = 64;
> > const unsigned PACKETCOUNT = 128;
> > const unsigned PIPENUM = 3;
> > const unsigned BUFFERCOUNT = 2;
> > const unsigned FRAMESPERBUFFER = 8;
>
> That looks fine.
>
> > I am using an SX2 mastered by an FPGA. No FX2. But that’s not going to
> > matter, no?
>
> No, it just means you have to write the registers externally, because
> you don’t have the 8051.
>
> Are you continuously shoving data into the endpoint 8 FIFO? Can you see
> that the FIFO is not empty?

We now have visibility into that FIFO. It is in fact completely full. We are
writing into it in a constant stream, discarding data if the FIFO is too
full.

Eric

Eric Fowler wrote:

We now have visibility into that FIFO. It is in fact completely full.
We are writing into it in a constant stream, discarding data if the
FIFO is too full.

Are you using “manual IN” mode or “auto IN” mode? If it is manual IN,
is your hardware asserting PKTEND? If it is auto IN, do you have the
auto IN size (EP8AUTOINLENH/L) set to 64?

There are a lot of registers in the FX2/SX2 related to the FIFOs.


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

On 10/12/07, Tim Roberts wrote:
>
> Eric Fowler wrote:
> >
> >
> > We now have visibility into that FIFO. It is in fact completely full.
> > We are writing into it in a constant stream, discarding data if the
> > FIFO is too full.
>
> Are you using “manual IN” mode or “auto IN” mode? If it is manual IN,
> is your hardware asserting PKTEND? If it is auto IN, do you have the
> auto IN size (EP8AUTOINLENH/L) set to 64?
>
> There are a lot of registers in the FX2/SX2 related to the FIFOs.
>

Good questions. I will put them to Mr. Hardware.

Thanks again.

Eric