EP_read Keeps ZERO When ReadFromPipeOut Called

Hi everyone,

I am trying to use Matlab API to communicate with XEM6310. I used the PipeTest sample to configure the FPGA. It works very well when wirein and wireout data. But the problem occurs when calling ReadFromBTPipeOut from Matlab, no data comes out. And when I view the EP_read signal on scope, It keeps 0 all the time. I checked EP_ready signal on scope as well, it is asserted to high before I call the ReadFromBTPipeOut. The same problem occurs when calling WriteToBTPipeIn.

Does anyone know what problem it may be? Am I missing something when just calling the ReadFromBTPipeOut/ WriteToBTPipeIn?

The platform I used:
Matlab 2009a (32-bits), Visual Studio 2008, USB3.0.

Thank you!

I see two possible problems. Since you use the PipeTest sample, check the PipeTest.cpp file. You have to write some settings through Wire In to activate the transfer, before you can read data on Pipe Out.

If you did that, maybe you are not using the Matlab function correctly. For block reading, try something simple to start, such as a block size of 1024 and a read size of 4096. Also, if you don’t initialize the pointer (pv) correctly, it might not work.
Here is a portion of my code for block reading:
readSize = 4096;
blockSize = 1024;
buf(readSize,1) = uint8(0);
pv = libpointer(‘uint8Ptr’, buf);
[actualReadSize,~] = calllib(‘okFrontPanel’, ‘okFrontPanel_ReadFromBlockPipeOut’, obj.ptr, epaddr, blocksize, readSize, pv);