News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0300 USB to FX bulk write fifo overflow

Started by marode, February 09, 2011, 07:17:01 PM

Previous topic - Next topic

marode

Hi there,
how can i know if the FX2 fifo is full from the computer side and how many bytes were sent?
I want to send data to the FPGA with TE0300_SetData(...).
If the FX2 fifos are full the function returns with an error, but how do I find out, how many bytes were written?
I have to be able to resend the missing bytes.

If I use ioctl functions directly, something like:
DeviceIoControl(mvDeviceHandle,IOCTL_BULK_WRITE,&btc,8,sendbuffer,*bufferLen,&bytesSent,NULL)
the bytesSent do not reflect the bytes sent. GetLastError() returns 995 which means "ERROR_OPERATION_ABORTED".

Is there any solution to this problem, or a workaround?
Thanks for any hints a lot.

Ales Gorkic

Dear Marode,

There is a function in FX2 firmware: GET_FIFO_STATUS. Take a look at the API example how to use it: void GetFX2FifoStatus(unsigned int handle).
I am not sure which register is the right one: CS or BCH - please take a look in Cypress FX2_LP datasheet.
The FPGA example uses DMA which will not stall the data path. There you could check the number of transferred bytes through the command interface.
I know that this is the problem. I had the same one when receiving the data. When the timeout occurred some data was lost. I have solved the problem by preventing timeouts - sending single word on 100ms.

Hope this helps.

Ales

marode

Hi Ales,
thanks for your suggestions.
Getting the fifo status after the error occurred is not really good, because the fifo could be emptied from the FPGA in the meantime.
Querying the fifo status before each write would slow down the transmission. But I think in my application I can live with that.

Thanks again,
Marode

Ales Gorkic

Dear Marode,

To my opinion the best solution is to make a SDRAM with DMA and then ask Microblaze through command interface what is the number of bytes in the RAM. This way you can get maximal speed and pretty large transfers.

Best regards,

Ales

Hengist

The release of the third generation Trenz Electronic USB FX2 Suite made this post obsolete. Please access current documentation and resources here: TE USB FX2 Suite.