AnsweredAssumed Answered

LPC1768 usbDeviceError

Question asked by Ali Asadzadeh on Feb 1, 2017
Latest reply on Feb 15, 2017 by Hui_Ma


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)



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


Here are some pictures of my RTX and USB configuration boxes