Create USB HID in CYPD3120

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
lock attach
Attachments are accessible only for community members.
NaMe_2085021
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello everybody,

I am using a CYPD3120 controller and I am trying to create a USB HID interface without a billboard.

When I connect my device to the computer I get the following in the device status: "Windows has stopped this device because it has reported problems. (Code 43)".

My project is attached. You can view the source and header files in the folders \app\usb_hid_custum.c and \app\usb_hid_custum.h .

I will be very grateful if you help me.

Best regards,

Nazar

0 Likes
1 Solution

Hi Nazar,

Please refer to usb_hid_class_rqt_handler() in usb_hid.c file in the SDK project which implements the data transfer using the Get Report and Set Report requests on the control endpoint.

You could modify the hid_handle_get_report() and  hid_handle_set_report() functions to implement your own data transfer.

However, please first ensure that the device enumeration is correct on the host.

Best Regards,

Sananya

View solution in original post

0 Likes
7 Replies
lock attach
Attachments are accessible only for community members.
Sananya_14
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello Nazar,

-Could you please let me know if you are using your custom descriptor handler functions? I couldnt find any calls to those from bb_internal.c file where the USB descriptors are getting updated.

-Please try using the modified descriptors in the usb_hid_custum.c file that I have attached. If possible, to start with, please only modify the HID interface descriptors while keeping the Billboard interface descriptor unchanged.

-Are you using your custom board? If yes, please confirm that loading the default firmware on the board does not cause any enumeration issues.

Best Regards,

Sananya

Hi Sananya,

Thank you for helping me.

- Yes, I use my own descriptor handler functions, and include them in the app_init() function.

- Please confirm whether I understood you correctly. Should I change the descriptors in the usb_hid.c file?

- Yes, I use my own board. Also, downloading the default firmware to the board does not cause problems with the transfer.

Best Regards,

Nazar

0 Likes

Hi Nazar,

-Thanks for the update, the handlers seem fine.

-Yes, kindly try changing the HID descriptors in the usb_hid.c while keeping the billboard descriptors and descriptor handling functions same as default firmware.

If the enumeration completes with this change, then please add the same changes with your custom handlers and let us know if the error still exists.

Best Regards,

Sananya

0 Likes

Hi Sananya,

Thank you very much for your quick response.

Could you help me with a custom handler?

I want to send commands from device to computer and from computer to device. Could you suggest something?

Best Regards,

Nazar

0 Likes

Hi Sananya,

Could you help me?

Please confirm whether there is a function for dynamic data transfer via USB in your CYPD3120-40LQXI_dp_dongle SDK?

If so, please tell me where can I find it? If not, could you write a sample code for this?

Best Regards,

Nazar

0 Likes

Hi Nazar,

Please refer to usb_hid_class_rqt_handler() in usb_hid.c file in the SDK project which implements the data transfer using the Get Report and Set Report requests on the control endpoint.

You could modify the hid_handle_get_report() and  hid_handle_set_report() functions to implement your own data transfer.

However, please first ensure that the device enumeration is correct on the host.

Best Regards,

Sananya

0 Likes

Hi Sananya,

Understood. Thanks!

Best Regards,

Nazar

0 Likes