Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Problems with CyUSB IOCTL Interface

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Problems with CyUSB IOCTL Interface
Moderator:
RSKV

Post Reply
Follow this topic



Problems with CyUSB IOCTL Interface

s.koops posted on 24 Oct 2011 1:26 AM PST
Member
4 Forum Posts

Hi,

Im trying to change the drivers for our USB Devices (CY7C68013A) from EzUSB.sys to CyUSB.sys. I'm using Delphi 5, so I use the IOCTL Interface. Is there some more information about the IOCTL Interface than in CyUSB.pdf ?

Is it still possbile to use the IOCTL Ezusb Commands ?

How can I get a device Descriptor ?

I tried IOCTL_GET_DEVICE_DESCRIPTOR, but i always receive Error 87 (The parameter is incorrect.)  (with GetLastError() )

I also tried IOCTL_Ezusb_GET_DEVICE_DESCRIPTOR, with the same result.

Several simple IOCTL_ADAPT commands do work, so the handle seems to be correct and the driver installed properly.

Can someone give me a hint please ?

regards




Re: Problems with CyUSB IOCTL Interface

aasi posted on 24 Oct 2011 01:55 AM PST
Cypress Employee
1090 Forum Posts

Please post the part of code you're using to invoke get descriptor I would like to take a look at it to see which parameter is wrong.

Regards,

Anand



Re: Problems with CyUSB IOCTL Interface

s.koops posted on 24 Oct 2011 02:41 AM PST
Member
4 Forum Posts

Hi,

I try to get the device descriptor with the following code :

procedure GetDeviceDescriptor(handle:THandle; var devDescr:DEVICE_DESCRIPTOR);

var

dwBytes : DWORD;

ds : DEVICE_DESCRIPTOR;

begin

if not DeviceIoControl(handle, IOCTL_GET_DEVICE_DESCRIPTOR,


@ds, sizeof(DEVICE_DESCRIPTOR),

@ds, sizeof(DEVICE_DESCRIPTOR),

dwBytes, nil) then

raise ECyUSBException.Create('Error #14 : ' + inttostr(GetLastError()));

devDescr := ds;

end;

 

IOCTL_GET_DEVICE_DESCRIPTOR is defined as followed (from usbscan.h):

IOCTL_GET_DEVICE_DESCRIPTOR   := CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 6, METHOD_BUFFERED,FILE_ANY_ACCESS);

FILE_DEVICE_USB_SCAN =$8000;
IOCTL_INDEX = $0800;

declariation of  the type DEVICE_DESCRIPTOR (from usbscan.h)

type

_DEVICE_DESCRIPTOR = packed record
    usVendorId: USHORT;
    usProductId: USHORT;
    usBcdDevice: USHORT;
    usLanguageId: USHORT;
  end {_DEVICE_DESCRIPTOR};
  DEVICE_DESCRIPTOR = _DEVICE_DESCRIPTOR;
  PDEVICE_DESCRIPTOR = ^_DEVICE_DESCRIPTOR;






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20