Using AN84868 FPGA configuration utility, I can not send 32MBytes upper data.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KIMI_4749046
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Hello,

   

I use the FPGA_Configuration utitliy program.(c# program).

AN84868_Project_files

pastedImage_0.png

Normally, the program has no problems.

But transfering larger file (more than 32MB) over USB3. I can not sent the data.

Please give me the reason. or please help me.

<Form1.cs>

private void button2_Click_1(object sender, EventArgs e)
        {
            int len = 0;
            byte[] buf = new byte[16];
           

            buf[0] = (Byte)(file_bytes & 0x000000FF);
            buf[1] = (Byte)((file_bytes & 0x0000FF00) >> 8);
            buf[2] = (Byte)((file_bytes & 0x00FF0000) >> 16);
            buf[3] = (Byte)((file_bytes & 0xFF000000) >> 24);
            if (myDevice != null)
            {
                rtConsole.AppendText ("Writing data to FPGA........\n");
                StatLabel1.Text = "NEXT STEP: Wait ... ";
                CtrlEndPt = myDevice.ControlEndPt;
                CtrlEndPt.Target = CyConst.TGT_DEVICE;
                CtrlEndPt.ReqType = CyConst.REQ_VENDOR;
                CtrlEndPt.Direction = CyConst.DIR_TO_DEVICE;
                CtrlEndPt.ReqCode = 0xB2;
                CtrlEndPt.Value = 0;
                CtrlEndPt.Index = 1;
                len = 16;
                CtrlEndPt.XferData(ref buf, ref len);//send vendor command to start configuration
                // myDevice.BulkOutEndPt.TimeOut = 100000;
                myDevice.BulkOutEndPt.XferSize = 4096;//set transfer size as 4096

                success = myDevice.BulkOutEndPt.XferData(ref file_buffer, ref file_bytes); //check if transfer successful

upper red code start to happen problem.

Thanks .

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

The maximum URB size that can be created for a bulk transfer for a superspeed Device is 32MB i.e. the XferData length can be a maximum of 32MB only. Please refer to this doc from Microsoft: USB Bandwidth Allocation - Windows drivers | Microsoft Docs

If the the length parameter of the XferData for superspeed device is more than 32MB the API will fail.

If your Bitstream size is exceeding 32MB, then you need to split the Bistream  into smaller chunks, of size less than or equal to 32MB on the host side and then send the chunks one after the other through continuous XferData calls.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

The maximum URB size that can be created for a bulk transfer for a superspeed Device is 32MB i.e. the XferData length can be a maximum of 32MB only. Please refer to this doc from Microsoft: USB Bandwidth Allocation - Windows drivers | Microsoft Docs

If the the length parameter of the XferData for superspeed device is more than 32MB the API will fail.

If your Bitstream size is exceeding 32MB, then you need to split the Bistream  into smaller chunks, of size less than or equal to 32MB on the host side and then send the chunks one after the other through continuous XferData calls.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna