Understanding the Data Structure for the USB transfer

Hello,

the last day I am banging my head against the problem how the data is
structured for the USB transfer between the FX2 and the PC. Datasheet,
FX2 reference and the web didn’t givve me the right clue.
What I understand:

  • the FPGA pumps interleaved samples into the FX2 fifo via GPIF. E.g.
    http://www.nd.edu/~jnl/sdr/docs/tutorials/4.html talks about a sequence
    I0 Q0 I1 Q1 I2 Q2 I3 Q3 I0 Q0 I1 Q1, etc.
  • these samples are somehow grouped into 512 byte blocks and sent over
    USB
  • the PC receives these blocks and must somehow know where a data group
    starts

I can only think that always 512 byte blocks are transferred. With a
full number of data groups fitting into the block, the block would
always
start with I0. But what happens if the PC gets out of sync, by not
reading a
full block with some strange event? Then the next 512 byte blocks read
would
always start somewhere in the datagroup. Any way to resync? Are short
packets and the PKTEND signal used?

Thanks for any hints


Uwe Bonnes [email protected]

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

On Nov 7, 2007 9:40 AM, Uwe Bonnes
[email protected] wrote:

  • the PC receives these blocks and must somehow know where a data group
    starts

I can only think that always 512 byte blocks are transferred. With a
full number of data groups fitting into the block, the block would always
start with I0. But what happens if the PC gets out of sync, by not reading a
full block with some strange event? Then the next 512 byte blocks read would
always start somewhere in the datagroup. Any way to resync? Are short
packets and the PKTEND signal used?

I was under the impression that the 512 byte blocks are atomic and
cannot be broken up - even on a bad packet reception over USB.

A while ago I put together a small page about the FX2 on the wiki with
links to the source code and what I saw it do.

http://gnuradio.org/trac/wiki/FX2

Hope that helps.

Brian

On Wed, Nov 07, 2007 at 03:40:44PM +0100, Uwe Bonnes wrote:

  • the PC receives these blocks and must somehow know where a data group


Uwe Bonnes [email protected]

We never transfer a short block. They are always 512 bytes long.
There’s no problem keeping track of the proper alignment.

Eric