- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am looking to create an application that constantly streams in from an FPGA via isochronous transfer via FX2LP.
I am writing the c# source code based on the asynchronous IO section of CyUSB.NET.pdf, as well as the c++ source code for the streamer application and the c# bulk loop source code.
The c++ streamer application provided by the manufacturer streams in correctly, but my application blue screens with a DRIVER_IRQL_NOT_LESS_OR_EQUAL stop code within a minute. (The failed content item is cyusb3.sys. The driver version is 1.2.3.20.)
Is there an incorrect description? How to fix it?
The following is an unsafe thread written in C#.
private unsafe void TransfersThread()
{
int i = 0;
int NumPkts = 8;
int NumQueue = 16;
int BufSz = IsocInEndPt.MaxPktSize * NumPkts;
IsocInEndPt.XferSize = BufSz;
// Setup the queue buffers
byte[][] cmdBufs = new byte[NumQueue][];
byte[][] xferBufs = new byte[NumQueue][];
byte[][] ovLaps = new byte[NumQueue][];
ISO_PKT_INFO[][] pktInfos = new ISO_PKT_INFO[NumQueue][];
for (i = 0; i < NumQueue; i++)
{
cmdBufs[i] = new byte[CyConst.SINGLE_XFER_LEN + IsocInEndPt.GetPktBlockSize(BufSz) + ((IsocInEndPt.XferMode == XMODE.BUFFERED) ? BufSz : 0)];
pktInfos[i] = new ISO_PKT_INFO[NumPkts];
xferBufs[i] = new byte[BufSz];
ovLaps[i] = new byte[CyConst.OverlapSignalAllocSize];
fixed (byte* tmp0 = ovLaps[i])
{
OVERLAPPED* ovLapStatus = (OVERLAPPED*)tmp0;
ovLapStatus->hEvent = PInvoke.CreateEvent(0, 0, 0, 0);
}
}
// Pre-load the queue with requests
int len = BufSz;
for (i = 0; i < NumQueue; i++)
IsocInEndPt.BeginDataXfer(ref cmdBufs[i], ref xferBufs[i], ref len, ref ovLaps[i]);
i = 0;
while (true)
{
fixed (byte* tmp0 = ovLaps[i])
{
OVERLAPPED* ovLapStatus = (OVERLAPPED*)tmp0;
if (!IsocInEndPt.WaitForXfer(ovLapStatus->hEvent, 500))
{
IsocInEndPt.Abort();
PInvoke.WaitForSingleObject(ovLapStatus->hEvent, 500);
}
}
if (IsocInEndPt.FinishDataXfer(ref cmdBufs[i], ref xferBufs[i], ref len, ref ovLaps[i], ref pktInfos[i]))
{
// Add code to examine each ISO_PKT_INFO here
}
// Re-submit this buffer into the queue
len = BufSz;
IsocInEndPt.BeginDataXfer(ref cmdBufs[i], ref xferBufs[i], ref len, ref ovLaps[i]);
i++;
if (i == NumQueue)
i = 0;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ebifurai,
Thank you for posting into our community.
Please refer to following app note, If you want to write a code for isochronous transfer for FX2LP.
We recommend you to look into the app note first and try to run some samples in AN4053 as a start point for streaming using isochronous transfer.
AN4053 for English
AN4053 for Japanese
You can download the sample code from this link.
1. Click "+Code Examples integrated with Application" notes
2. Search "AN4053" to get the sample code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ebifurai,
Thank you for posting into our community.
Please refer to following app note, If you want to write a code for isochronous transfer for FX2LP.
We recommend you to look into the app note first and try to run some samples in AN4053 as a start point for streaming using isochronous transfer.
AN4053 for English
AN4053 for Japanese
You can download the sample code from this link.
1. Click "+Code Examples integrated with Application" notes
2. Search "AN4053" to get the sample code.