Composite USB device (keyboard + mouse) doesn't enumerate

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Composite USB device (keyboard + mouse) doesn't enumerate

跳至解决方案
3,455 次查看
laszlomonda
Contributor IV

Hi guys,

 

I'm in the process of implementing a composite USB device featuring a keyboard and a mouse interface. Unfortunately, enumeration fails. I've just uploaded the code to GitHub.

 

I know that making this work is far from trivial, and I'd be happy to pay to an expert.

 

Thank you very much in advance!

- Laci

标签 (1)
0 项奖励
回复
1 解答
3,061 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Laci,

The latest KSDK 2.0 has provided such kind of demo , you may use it as a starting point for your application. Please kindly refer to  Welcome to Kinetis Expert | Kinetis Expert to get the download, and you will find that demo in the folder of, for example, C:\Freescale\SDK_2.0_FRDM-K64F\boards\frdmk64f\usb_examples\usb_device_composite_hid_mouse_hid_keyboard.

Hope that helps,


Have a great day,
Kan

NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
3,061 次查看
ruslansirota
Contributor I

Hi,

Try to use this device descriptor:

uint8_t g_device_descriptor[DEVICE_DESCRIPTOR_SIZE] =

{

    DEVICE_DESCRIPTOR_SIZE,               /* "Device Descriptor Size        */

    USB_DEVICE_DESCRIPTOR,                /* "Device" Type of descriptor    */

    0x00,0x02,                                           /*  BCD USB version               */

    0xEF,                                              //DEVICE_DESC_DEVICE_CLASS,

  /*  Device Subclass is indicated in the interface descriptors  */

  0x02,                                              //DEVICE_DESC_DEVICE_SUBCLASS,

  /*  Device Protocol  */

  0x01,                                              //DEVICE_DESC_DEVICE_PROTOCOL,

    CONTROL_MAX_PACKET_SIZE,              /*  Max Packet size               */

    0xa2,0x15,                            /*  Vendor ID   */

    0x00, 0x02,                           /*  Product ID  */

    0x00, 0x02,                           /*  BCD Device version */

    0x01,                                 /*  Manufacturer string index     */

    0x02,                                 /*  Product string index          */

    0x00,                                 /*  Serial number string index    */

    0x01                                  /*  Number of configurations      */

};

It's mean that device defined to use interface descriptors for enumeration.

More information you can find: www.usb.org/developers/docs/whitepapers/iadclasscode_r10.pdf

And also you can find the Composite Device User's Guide.pdf in KSDK doc/usb folder.

Regards,

Ruslan

0 项奖励
回复
3,061 次查看
laszlomonda
Contributor IV

Hi Ruslan,

I've tried your suggestion and it didn't work. I think the current device descriptor should be fine as it's the one used by the dev_hid_audio_bm_frdmk22f example which also implements a composite device.

Figuring this out would likely involve analyzing the USB communication between the host and device and correcting the code accordingly.

- Laci

0 项奖励
回复
3,062 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Laci,

The latest KSDK 2.0 has provided such kind of demo , you may use it as a starting point for your application. Please kindly refer to  Welcome to Kinetis Expert | Kinetis Expert to get the download, and you will find that demo in the folder of, for example, C:\Freescale\SDK_2.0_FRDM-K64F\boards\frdmk64f\usb_examples\usb_device_composite_hid_mouse_hid_keyboard.

Hope that helps,


Have a great day,
Kan

NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
3,061 次查看
laszlomonda
Contributor IV

Hi Kan,

Thank you so much for the idea! I've just downloaded KSDK 2.0 and the mentioned demo works perfectly. The timing of the KSDK 2.0 release couldn't have been better!

I plan to add a raw HID interface to the mouse and keyboard interfaces, but as for now this is working perfectly.

All hail the KSDK developers!

- Laci

0 项奖励
回复