Fail to run Host USB Keyboard on K20

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

Fail to run Host USB Keyboard on K20

664 Views
MAPC
Senior Contributor I

Hello, dears

We are working in a project with MK20 in which we have a typical PC USB keyboard for control interface. To make our firmware we refered to the guidelines to run "HID mouse host" (item 1.2) from Processor Expert USB Components Quick Start Guide included in the Freescale USB Stack documentation and we just replaced "Mouse_Task" function code with "Keyboard_Task" code, taken from K20 USB Host Keyboard example.

All the specific structs like descriptors were also modified acordinly.

Debugging the code, we have realized that if we press any keys in the begining, it runs perfectly. If we leave the system idle (without pressing any keys) for a short time, it starts failing. We can set a breakpoint to anywhere in the code that never gets there, but we can see it going through the functions, but far slower than when it was running fine in the begining.

The only way to make it running to the breakpoint again after idleness is removing the functions "usb_event_clear" and "usb_host_dev_tr_init" from "case USB_DEVICE_INUSE". The host enumerates the device and detects attach and detach events, but stops doing the data transactions.

Did somebody go through the same issue? Any help will be very welcome!

Thanks and best regards,

Marco Coelho

Applications Engineer

Siletec Eletronica

Tags (4)
0 Kudos
2 Replies

373 Views
MAPC
Senior Contributor I

Thank you very much, Marek.

I appreciated your support and service.

0 Kudos

373 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

There is released a new solution of USB components (fsl_usb_device_hid_class, fsl_usb_device_msd_class, fsl_usb_framework, fsl_usb_descriptors) that is available in KDS 2.0.0 (with installed Kinetis SDK 1.1.0 Eclipse Update).

If you want to start a development of an application based on fsl_usb_.... components, you can use the Processor Expert Kinetis SDK USB Stack Integration User Guide that is available as a part of the help.

You can open the guide by the following way in KDS 2.0.0 (you must have KSDK 1.1.0 Eclipse Update installed):

- Open Component Library window and find fsl_usb_descriptors component.

- Open the context menu of this component (click by right button of the mouse) and select Help on Component item.

- In the Help window, open the fsl_usb_descriptions page

- The fsl_usb_descriptors help page (General Info tab) contains link to the user guide "USB stack Processor Expert integration documentation" at the bottom of the page.

 

Best Regards,

Marek Neuzil

0 Kudos