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,