Hi I have made a simple program for LPC4337 Device, this is my code for initiating the HID mouse that I have connected to my board. The problem is that I got this error usbDeviceError
and my USB function initialize Ok
int main(void) { osKernelInitialize (); // initialize RTOS kernel osKernelStart (); // start kernel with job2 execution usbStatus usbst; usbst=USBH_Initialize(0); // USB Host 0 Initialize while(1) { usbst=USBH_HID_GetDeviceStatus (0U); // Get HID device status } }
You can use extended HID functionality, check functions USBH_HID_ParseReportDescriptor and USBH_HID_Read and USBH_HID_Write here: www.keil.com/.../group__usbh__hid_functions__api.html or you can use custom class functionality explained and documented here: www.keil.com/.../group__usbh__custom_functions.html
Thanks for your time, I do not know how to extract that info or use as custom implementation. if you direct me to where I could find the info It would help me a lot.
Thanks
I suspect the mouse you want to connect does not support boot protocol and has special HID descriptor that is not standard simple mouse in that case it will not be mounted by USB Host as it does not support complex HID descriptor, you would have to write your own handling of that mouse with using of custom class implementation on the USB Host.
Do you have Configuration Descriptor of that mouse?
It's from A4tech, also I have connected my Keyboard to it and It does throw the same error it's Neco brand.
Which USB mouse are you connecting?
I have tested the keil sample program, But I still got the same error
I have made a simple program for my LPC1768 using keil V5.22 the LPC should act like a USB host to a mice that I have attached to it. the problem is that I will always got the usbDeviceError from the USBH_HID_GetDeviceStatus function.
Here is my USB thread code
void USB_Thread (void const *arg) { static usbStatus myst; static usbHID_MouseState mymouse; myst=USBH_Initialize (0); /* Initialize USB Host 0 */ while (1) { osDelay(10); myst=USBH_HID_GetDeviceStatus(0); } }
and this is my main function
osThreadDef(USB_Thread, osPriorityNormal, 1, 2048); osThreadId tsk_USB; int main (void) { osKernelInitialize (); // initialize CMSIS-RTOS osKernelStart (); // start thread execution tsk_USB = osThreadCreate(osThread(USB_Thread), NULL); //it's used for USB mouse while(1) { } }
Here are some pictures of my RTX and USB configuration boxes
http://uploads.im/Um93L.jpg http://uploads.im/rv1co.jpg http://uploads.im/dHwgi.jpg http://uploads.im/5fKWi.jpg
Why don't you start with C:\Keil\ARM\PACK\Keil\LPC4300_DFP\2.7.0\Boards\Keil\MCB4300\Middleware\USB\Host\Keyboard example
View all questions in Keil forum