makestuff / libfpgalink

LIB:Library for interacting with an FPGA over USB
https://github.com/makestuff/libfpgalink/wiki/FPGALink
GNU Lesser General Public License v3.0
82 stars 25 forks source link

VHDL: STATE_WRITE decrements wcount even though FX2 FIFO is full #12

Closed makestuff closed 13 years ago

makestuff commented 13 years ago

During fxReadRegister, the VHDL FSM's STATE_WRITE writes bytes into the FX2's EP8IN FIFO, and decrements wcount (the remaining byte count) for each byte read. Unfortunately it doesn't take the FX2's FIFO full flag into account. In fact that pin on the FX2 is not even mapped to the FPGA. So not enough data is returned, and usb_bulk_read() times out.

makestuff commented 13 years ago

https://github.com/makestuff/libfpgalink/commit/6ad09aa4130be46ea0c7fddc36de878877cc988a https://github.com/makestuff/libfpgalink/commit/e8ebd31e54d70d22545495d800d10dadce360d46 https://github.com/makestuff/libfpgalink/commit/d827f4b8d50f80a3864ed65bc9c94c5cb89b3a12