I think you can know the end of the buffer using two actions:
LD_DATA_COUNT and COUNT_DATA.
You can load the count as your buffer size and you can look for DATA_CNT_HIT.
My issue is not finding the end of a buffer, I can do this happily with WM or Count as you suggest, the problem is that not all of the data transferred over the GPIF is transferred over USB (I am transferring packet at a time over GPIF). The only explanation I can come up with at the moment is that the DMA buffer is not ready to receive data and so the data transferred over the GPIF is not read into a buffer, the only way this can happen from my state machine is if the DMA _RDY and DMA _WM flags are incorrect directly after a buffer is commited to USB. So, are there any conditions under which the RDY or WM flags are incorrect or invalid?
By any chance are your USB transfers high-bandwidth isochronous?
Hi Steve, my'n are all bulk transfers and actually on some more work today the problem doesn't seem to be as bad, it just seems that the WM flag is not ready directly after starting my GPIF waveform which seems to be solved by inserting a dummy state that repeats 30 times?! I'd still like to understand all of the conditions that these flags might not be valid as I can see this problem rearing its head in the future.