USB VID/PID change using example code dev_hid_generic_freertos

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

USB VID/PID change using example code dev_hid_generic_freertos

跳至解决方案
7,233 次查看
nbgatgi
Contributor IV

First, an intro before my question ... I am using the TWR-K22F120M tower board to develop a USB device.  Using the SDK for that board including the USB stack and FreeRTOS, I have successfully tested the example code for the generic HID with FreeRTOS ("dev_hid_generic_freertos").  This required downloading and modifying code from codeproject.com per the readme.pdf (attached) in the example code folder.  Here is the link:

A USB HID Component for C# - CodeProject 

Follow the readme instructions EXACTLY and it will work.  I initially compiled the C# program for "all processors" and it would compile and run, but it would not connect to the device and echo data.  NOTE - there are code modifications required and defined in the readme.  Here is what the running program looks like except that I modified the VID/PID and default send data:

TWR-K22F120M USB HID Program.png

QUESTION:  Being brand new to the USB game, I assume the VID and PID are hard-coded somewhere in the example code.  I verified that the VID is for NXP.  Since I'm a little slower than the other kids, I could not find where this is.  We have our own VID and PID block reserved, so I would like to put it in the code.  Does anyone know where VID and PID are defined in this project?

标签 (1)
1 解答
5,745 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Nick:

VID and PID are defined in USB device descriptor, please refer to file usb_device_descriptor.c

pastedImage_1.png

I hope it helps.

Regards

Daniel

在原帖中查看解决方案

1 回复
5,746 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Nick:

VID and PID are defined in USB device descriptor, please refer to file usb_device_descriptor.c

pastedImage_1.png

I hope it helps.

Regards

Daniel