You are here

CYUSB slower than ezusb | Cypress Semiconductor

CYUSB slower than ezusb

Summary: 2 Replies, Latest post by PRJI on 21 Mar 2013 10:39 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
lcolombini's picture
2 posts

I have a device with ezusb fx2 and I controlled the device using ezusb driver version 1.30 I moved to cyUSB driver version but the communication with device is slower.

With old driver, with a fix hardware configuration, I am able to reach 30Mb/s of data trasfer, simply upgrading the driver to the cyUSB I only reach 15Mb/s.

I don't use the cypress library, I use directly the driver, below a detail of the code I use in both cases, obviously I cannot believe the new driver is slower than the old, so what I am doing wrong?

Thanks in advance for your support.




#define MAX_BLT_SIZE    (60*1024)

        BOOLEAN bResult;
        ULONG nBytes, totBytes = 0, lun;
        int np, i, resto;
#ifdef NEWDRIVER // cyUSB.sys
	SINGLE_TRANSFER singleTransfer;
        bulkControl.pipeNum = 2;
        np = length / MAX_BLT_SIZE;
        resto = length - np * MAX_BLT_SIZE;
        if( resto > 0 ) np++;
        for( i = 0; i < np; i++ ) {
                if( i == np - 1 ) lun = resto;
                else lun = MAX_BLT_SIZE;
#ifndef NEWDRIVER // exUSB.sys V. 1.3
                bResult = DeviceIoControl(handle,
                      sizeof( BULK_TRANSFER_CONTROL ),
                      buffer + i*MAX_BLT_SIZE,
#else // cyUSB.sys version 3.4.7

	memset( &singleTransfer, 0, sizeof( singleTransfer));
	singleTransfer.ucEndpointAddress= 0x86;
 	bResult= DeviceIoControl (handle,
		&singleTransfer, sizeof( singleTransfer),
		buffer + i*MAX_BLT_SIZE, lun,
		&nBytes, NULL);
        if( bResult == 0 ) break;
        totBytes += nBytes;
        if( nBytes < lun ) break;
        if( bResult )
                return totBytes;
        else {
                DWORD ErrorCode = GetLastError();
                return -(LONG)ErrorCode;
lcolombini's picture
2 posts

Hi all,

I found the solution, it was the transfer size of the endpoint, I increased the size (using IOCTL_ADAPT_SET_TRANSFER_SIZE) and now I am able to read faster as with the old driver. Probably the cyUSB.sys by default has a smaller trasfer size than the old ezusb.sys.



prji's picture
Cypress Employee
473 posts


Thanks for sharing the fix 


Log in to post new comments.