AnsweredAssumed Answered

MQX 4.2.0 USB Keyboard Device exapmle: Can not find where USB h/w module is initialised

Question asked by Omkar Karmalkar on Feb 28, 2017
Latest reply on Mar 2, 2017 by Daniel Chen

Hello everyone,


I used keyboard device example from MQX 4.2.0 USB v2 stack and ported it into the MQX 4.0.0 application successfully without any errors and warnings. When I connect my device to computer it is not getting detected.

On further investigation, I found out that there is no USB hardware initialization in keyboard.c I looked at mouse.c in USB device examples in MQX 4.2.0 USB examples it was not there either. So it does not look like it has happened by mistake. When I looked at mouse.c inside MQX 4.0.0 USB examples, I found there is driver install routine (_usb_device_driver_install()) that is called. This call is removed from the MQX 4.2.0 USB examples due to some reason.


While porting the USB v2 stack, I have removed old USB stack from the build so I don't think there is any issue with the old stack.


When I looked into the USB_Stack_Porting_User_Guide.pdf it says I need to call bsp_usb_dev_soc_init(); in the example. I tried to add it in the App_init() after all the structures are initialized, but I ran into errors. I had to change the static usb_status bsp_usb_dev_soc_init() to make it global. then I ran into the following error:


Error[Li005]: no definition for "_usb_khci_dev_callback_table" [referenced from usb_mk64_device.o(bsp.a)]


Also, I have built the new usb v2 stack (as BSP) successfully according to the USB_Stack_Porting_User_Guide.pdf 

I am using IAR workbench.

Could you please help me with this issue? My final objective is to get the device detected as USB keyboard on computer.