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


Started by oro06, May 04, 2013, 05:44:35 PM

Previous topic - Next topic



i'm currently using FX2LP to transfer data from fpga to host via EP6IN SLAVE FIFO BULK MODE
firmware is  te_usb_api.ver.3.2 from github
for reference from fw.c :
EP6CFG=0xE2        #enable, in, bulk, 512bytes, double buffered
EP6FIFOCFG=0x48 #signal line full 1 clk earlier, autoin, 8 bit wide

i succeeded for packets size <1024 and >1024 not multiples of 1024 up to several MB
but when data size is exactly 1024 the transfer hang.

during the write of the 1024th byte, fifofull flag is raised,
then datas are transfered to the usb host (i guess at the host driver buffer level but not seen by the client application)
and a new empty fifo is then presented to the fpga.
the problem is :
- PKTEND must be asserted to the last byte sent to indicate - en of batch an release last remaing datas
- PKTEND can't be asserted when flag full is raised, logic need to wait
- PKTEND can't be asserted when fifo is empty (as zero len packets are disabled in the firmware)
the only workaround i found was to write one more byte in this scenario and then asserting PKTEND

today i've tried to tweak the firmware
EP6FIFOCFG=0x48 #signal line full 1 clk earlier, autoin, 8 bit wide
EP6FIFOCFG=0x4C #signal line full 1 clk earlier, autoin, enable zero len packets, 8 bit wide

and now it runs perfectly whatever packet length have to be transfered

is there any reason to have ZLP not enabled in the firmware ?
could mainline firmware have this feature enabled ?

Thanks & regards

Oleksandr Kiyenko

Hello oro06,
Thanks for your feedback, you did great work!
There is no reasons to disable ZLP in this firmware. I'll update repository with your patch.