AnsweredAssumed Answered

Fail to run Host USB Keyboard on K20

Question asked by Marco Aurelio P. Coelho on May 5, 2014
Latest reply on Feb 27, 2015 by Marco Aurelio P. Coelho

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

Outcomes