cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

New Contributor

In my application, the external data source(FPGA) continously write to the USB slave FIFO and in the PC driver, I call the XferData() repeat and repeat without an end. Like writing of the normal fifo , when the full flag becomes active the FPGA will stop writing and the data will be saved in the internal FIFO. But the problem is when the full flag keeps too long, the FPGA FIFO will be full. And then the writing flow in the FPGA will be timeout which leads an error.

In this application, I use the  Endpoint 6 IN and it works in Bulk mode.

My question is : what should I do if I want the USB full flag to be inactive all the time or keep it in limited and very short time?

0 Likes
Reply
1 Solution
Moderator
Moderator

Hello,

Please use the streamer application directly to read data continuously from the endpoint, you can capture the data in the streamer application by checking the  and let me know "show transferred data" box for verification. In the scenario the application will continuously read the data from the endpoint and you can commit the data to the endpoint buffers as soon as the endpoints are empty. This will increase the throughput and the full flag need not remain asserted for long time,as you are committing the FIFO data to the endpoint buffers and reading the same from the host side.

Also please make sure that you are committing the FIFO data soon enough in the firmware.

Best Regards,

Yatheesh

View solution in original post

0 Likes
Reply
7 Replies
Moderator
Moderator

Hello,

The EP6FIFOFLGS.0 (status of EP6 FF) can be monitored and once this bit is asserted, you can call the INPKTEND = 86, where the EP6 FIFO will be flushed out and the full flag is de-asserted. Here you will loose the data previously stored in the FIFO .

Regards,

Yatheesh

0 Likes
Reply
New Contributor

Thanks for relplying. As you say, setting the SKIP bit in the INPKTEND register will flush the fifo and the data will be lost. but the data here is important. Is there any other way that just shorts the time full flag keeps active?

0 Likes
Reply
Moderator
Moderator

Hello,

You can commit the data in the FIFO manually as soon as the Full Flag is asserted or use the AUTO mode where the EZ-USB will automatically commit the FIFO data as soon as it the FIFO buffer if filled. Since the flags indicate the status of the FIFO buffers you cannot control them when the firmware is running.

You can try using the streamer application to stream IN the data continuously.

Please let me know if using the streamer application still causes the issue.

Thanks,

Yatheesh

0 Likes
Reply
New Contributor

Here are my settings according to the streamer application:

PC driver part:

CCyIsocEndPoint *IsoIn = USBDevice->IsocInEndPt;

    LONG bufSize1 = IsoIn->MaxPktSize * 8;

    IsoIn->SetXferSize(bufSize1);

    CCyIsoPktInfo *isoPktInfos;

    int pkts;

    isoPktInfos = IsoIn->CreatePktInfos(bufSize1, pkts);

    ret = IsoIn->XferData(data_buf, bufSize1, isoPktInfos);

USB firmware:

  .db   DSCR_ENDPNT_LEN  ;; Descriptor length
  .db   DSCR_ENDPNT     ;; Descriptor type
  .db   0x86           ;; Endpoint number, and direction
  .db   ET_ISO        ;; Endpoint type
  .db   0x00           ;; Maximun packet size (LSB)
  .db   0x02           ;; Max packect size (MSB)
  .db   0x01          ;; Polling interval

EP6CFG = 0xD0;            // in 512 bytes, 4x, Isoc

......

EP6FIFOCFG = 0x49; 

With all the settings above, I still get the same error: flagc keeps active too long...(>2ms sometimes which is even more than the bulk mode)

0 Likes
Reply
Moderator
Moderator

Hello,

Please use the streamer application directly to read data continuously from the endpoint, you can capture the data in the streamer application by checking the  and let me know "show transferred data" box for verification. In the scenario the application will continuously read the data from the endpoint and you can commit the data to the endpoint buffers as soon as the endpoints are empty. This will increase the throughput and the full flag need not remain asserted for long time,as you are committing the FIFO data to the endpoint buffers and reading the same from the host side.

Also please make sure that you are committing the FIFO data soon enough in the firmware.

Best Regards,

Yatheesh

View solution in original post

0 Likes
Reply
New Contributor

In the streamer application, both in and out endpoints work in Isoc mode. and I set my application as so. My question is when I want to read continuously from the IN endpoint(USB is slave FIFO), is the full flag usefull? In other words, I can just make the slwr and faddr active when needed, and ignore the full flag?

0 Likes
Reply
Moderator
Moderator

Hello,

The full flags are needed to indicate the master that the slave FIFO is full and any more writes from the master to the FX2LP will result in data loss.

If the master is configured such that it will write a minimal amount of data to the FIFO and the FIFO buffer is committed from time to time, then Full flag will not be needed. You can leave it floating.

Best Regards,

Yatheesh

0 Likes
Reply