How to enlarge one transfer package size of pBulkEpIn->BeginDataXfer (2GByte)

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

cross mob
liwe_284431
Level 1
Level 1

Hi everyone,

   

I faced a problem as blow:

   

if  record_size = 1024*512*2048 (1GByte) and img_buffer_record = (UCHAR *)calloc(record_size, 1);

   

pContext = pBulkEpIn->BeginDataXfer(img_buffer_record, record_size, &oRdOvLap)

   

this transfer works well.

   

 

   

if  change the record_size to 1024*512*4096 (2GByte), the BeginDataXfer will crash, which means the max single transfer size of BeginDataXfer is 1GByte.

   

But in my project , I hope the single transfer size is as large as possible.

   

So is there any solution to enlarge the package size?

   

 

   

thank you all.!!!

0 Likes
3 Replies
Anonymous
Not applicable

This may be because of the RAM limitation in your PC

0 Likes

Thank you for your reply, but my computer is X64 windows 10.

   

And, this is my code:

   

            LONG big_array_long = 1024 * 512 * 4096;
            big_array = (UCHAR *)malloc(big_array_long);

   


            pContext = pBulkEpIn->BeginDataXfer(big_array, big_array_long, &oRdOvLap); // nBufSize*24

   


            if (!pBulkEpIn->WaitForXfer(&oRdOvLap, big_array_long * 1000)) { pBulkEpIn->Abort(); WaitForSingleObject(oRdOvLap.hEvent, INFINITE); break; }

   


            if (pBulkEpIn->FinishDataXfer(big_array, big_array_long, &oRdOvLap, pContext)) {}

   

 

   

Size of "big_array_long " is 2GByte, and the "big_array" creates a 2GB memory by "malloc" command.

   

 

   

However, When "BeginDataXfer" command is carried on then windows turns to a blue screen with "WDF_VIOLATION" error.

   

But if the big_array_long is 1GB, the code works well.

   

 

   

Could you give me a cue for this? I hope to transfer >1GB data in one BeginDataXfer

0 Likes
liwe_284431
Level 1
Level 1

By the way, my firmware of CYUSB3014 is slavefifo

0 Likes