Compite device still thinks its a keyboard

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

cross mob
rasec_2385561
Level 4
Level 4
First like received

I have this sneaking suspicion that the Windows world still thinks the composite device that I have created

is a keyboard. It started out as a keyboard but I thought I had removed the keyboard definition. On the Windows

side I get access denied when I try to do a readfile and if I try to add GENERIC_READ to the createfile I get

an invalid handle because of the addition. What all should I be changing on the PSOC side to make sure

Windows doesn't see my PSOC 5 prototype kit as a keyboard ?

0 Likes
8 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

Is it happening when you are connecting the PSoC's USB port (not the USB port for programming) to PC only?

Thanks,

Hima

0 Likes

Both USB ports are connected to my hub.

Randy

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

We would like to know which particular USB connection is being detected as Keyboard. can you remove one and find that out? If it is USB port not the programming port can you try erasing the PSoC Flash from PSoC programmer and test again.

Also in device manager right click on this Keyboard device and uninstall.

Thanks,

Hima

0 Likes

I unplug the programming port. I reran my Windows application and it still gets the access denied return value

from (on Windows 7):

    HIDfile = CreateFile(devicePath, GENERIC_WRITE|GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);

                // Setting the GENERIC_WRITE|GENERIC_READ to NULL allows the function to

                // run but the later readFile function then returns the access denied 

                // value in a similiar manner.

        if(HIDfile  == INVALID_HANDLE_VALUE)

        {

           DWORD err = GetLastError();

Then I reinserted the kit for programming. Programmed successfully. Removed programming

connection. Then I reran the application which had the same error returned (access denied: 5).

Device Manager had the CY8CKIT-059 PSOC 5LP listed under the keyboard section !! I uninstalled

it. Then I reran the Windows application. The above mentioned CreateFile opened successfully !! The

readFile() returned a 6 via GetLastError() which is ERROR_INVALID_HANDLE. The device manager

does show the VID and PID combination under HID devices but not under keyboards.

Any ideas ?

Randy

0 Likes
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Is the VID/PID changed?  I've noticed when playing with USB devices, if windows already has a driver assigned to that VID/PID it will stick to that driver regardless of if the USB device type has changed on the other end.

The way I found to get around it was to uninstall the device via the device manager (which dis-associates that VID/PID from the driver it loaded) then reconnect and it should try to find the proper driver again.

0 Likes

The VID/PID do not appear to be changing.

Now I have one entry for the VID PID device under Universal Serial Bus controllers

and two entries under Human Interface Devices in the Windows Device Manager.

Randy

0 Likes

Hello,

Do you have any other kit to test the same so that we can confirm if it is hardware issue.

Thanks,

Hima

0 Likes

Not really.

Randy

0 Likes