Having trouble with Keyboard Demo application with fsl_usb_device_hid_class on FRDM-K22F

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having trouble with Keyboard Demo application with fsl_usb_device_hid_class on FRDM-K22F

Jump to solution
752 Views
ken_sloat
Contributor II

Hello,

 

I am using a FRDM-K22F board and attempting to get the HID keyboard demo that is an option when you add the processor expert fsl_usb_device_hid_class component in KDS. After programming the board, and plugging the USB port (the one that connects directly to the K22) into my computer, I get the following on my Linux machine:

 

[30253.038480] usb 2-3.1: new full-speed USB device number 107 using ehci-pci

[30253.126568] usb 2-3.1: device descriptor read/64, error 18

[30253.318734] usb 2-3.1: device descriptor read/64, error 18

[30253.510859] usb 2-3.1: new full-speed USB device number 108 using ehci-pci

[30253.598992] usb 2-3.1: device descriptor read/64, error 18

[30253.791124] usb 2-3.1: device descriptor read/64, error 18

[30253.983162] usb 2-3.1: new full-speed USB device number 109 using ehci-pci

[30254.003903] usb 2-3.1: device descriptor read/8, error -61

[30254.124121] usb 2-3.1: device descriptor read/8, error -61

[30254.315496] usb 2-3.1: new full-speed USB device number 110 using ehci-pci

[30254.336286] usb 2-3.1: device descriptor read/8, error -61

[30254.456352] usb 2-3.1: device descriptor read/8, error -61

[30254.559816] usb 2-3-port1: unable to enumerate USB device

 

This happens regardless of whether I leave the debug USB port connected or not. I know that this can work, because if I import the FreeRTOS USB HID Keyboard project from the SDK folder, build it and program it, my computer sees a keyboard device and the board starts sending keystrokes to my computer.

 

Just not understanding why I am getting this problem. If I run the application in debug mode and set a breakpoint in the hid1_application_callback function, it will break there when I plug/unplug the USB cable, but it's always the same "event_type", "USB_DEV_EVENT_BUS_RESET."

69851_69851.pngpastedImage_0.png

 

Here our some shots of my configurations in processor expert for reference:

69852_69852.pngpastedImage_0.png

 

69853_69853.pngpastedImage_1.png

 

69855_69855.pngpastedImage_3.png

 

69856_69856.pngpastedImage_4.png

69857_69857.pngpastedImage_5.png

69858_69858.pngpastedImage_6.png

69859_69859.pngpastedImage_7.png

Labels (1)
0 Kudos
1 Solution
487 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Kenneth Sloat,

I think your issue might be related with two causes.

1. You didn't set the correct VID and PID for this HID demo.

2. The PEx component put USB descriptor in the internal flash, while USB module does not have access for this space out of reset. Please kindly refer to How to implement a USB Device MSD demo based on KSDK PEx components and KDS 3.0 for details.

Hope that helps,


Have a great day,
Kan

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

View solution in original post

2 Replies
488 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Kenneth Sloat,

I think your issue might be related with two causes.

1. You didn't set the correct VID and PID for this HID demo.

2. The PEx component put USB descriptor in the internal flash, while USB module does not have access for this space out of reset. Please kindly refer to How to implement a USB Device MSD demo based on KSDK PEx components and KDS 3.0 for details.

Hope that helps,


Have a great day,
Kan

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

487 Views
ken_sloat
Contributor II

Thank you Kan, this article helped me fix most of the issues! After following your tutorial suggestion to set the no option for setting descriptors as const my device was now recognized, but still had errors. I was able to get the demo working by additionally unchecking another option for marking the descriptors as const under the hid class component:

pastedImage_0.png