<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: use lpcusblib in LPC1788 chip</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685925#M27637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;请问一下，最后是怎么解决的？&lt;/P&gt;&lt;P&gt;什么问题导致的死循环？&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2018 07:45:46 GMT</pubDate>
    <dc:creator>caimingchuancai</dc:creator>
    <dc:date>2018-09-21T07:45:46Z</dc:date>
    <item>
      <title>use lpcusblib in LPC1788 chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685922#M27634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use lpcusblib debugging usbhost found that the program will stop in the &lt;SPAN&gt;WaitForTransferComplete&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In enumdevice get devicedescription stop &amp;nbsp; waitTransferComlete&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static HCD_STATUS WaitForTransferComplete(uint8_t EdIdx)&lt;BR /&gt;{&lt;BR /&gt;#ifndef __TEST__ //&lt;BR /&gt; while ( HcdED(EdIdx)-&amp;gt;status == HCD_STATUS_TRANSFER_QUEUED ) {} &amp;nbsp; //while in this&lt;BR /&gt; return (HCD_STATUS) HcdED(EdIdx)-&amp;gt;status; &lt;BR /&gt;#else&lt;BR /&gt; return HCD_STATUS_OK;&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 May 2017 03:16:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685922#M27634</guid>
      <dc:creator>mini92</dc:creator>
      <dc:date>2017-05-19T03:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: use lpcusblib in LPC1788 chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685923#M27635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below thread, I hope this helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/434574"&gt;LPC1768 USB Host mode not working&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Sol &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 22:07:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685923#M27635</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2017-05-24T22:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: use lpcusblib in LPC1788 chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685924#M27636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thank you ask me ,but I did not using thread &amp;nbsp;and I'm sure my hardware is correct ，The pipe enumeration device gets the device descriptor failed，The independent enumeration device gets the device descriptor normal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pipe method&lt;/STRONG&gt;： &amp;nbsp;get device description err&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case HOST_STATE_Powered_DoReset: { // 5 ÔÚ¸´Î»Éè±¸ µÈ´ýÃ¶¾Ù&lt;BR /&gt; HCD_USB_SPEED DeviceSpeed;&lt;BR /&gt; HcdRhPortReset(corenum); //¸´Î» ¶Ë¿Ú&lt;BR /&gt; HcdGetDeviceSpeed(corenum,&amp;amp;DeviceSpeed); // »ñÈ¡ USBµÄÉè±¸ËÙ¶È full speed&lt;BR /&gt; USB_Host_SetDeviceSpeed(corenum, DeviceSpeed); //¸ü¸ÄÉè±¸ËÙ¶È±êÖ¾Î» full speed&lt;BR /&gt; HOST_TASK_NONBLOCK_WAIT(corenum, 200, HOST_STATE_Powered_ConfigPipe); //¼ÌÐøµÈ´ý200ms Ê²Ã´ÒâË¼£¿&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HOST_STATE_Powered_ConfigPipe: // 6 ÕýÔÚÅäÖÃ¹ÜµÀ&lt;BR /&gt; if (!Pipe_ConfigurePipe(corenum, PIPE_CONTROLPIPE, EP_TYPE_CONTROL, //ÅäÖÃ¹ÜµÀ: Éè±¸ ¿ØÖÆ¹ÜµÀ ¿ØÖÆ¶Ëµã0&lt;BR /&gt; PIPE_TOKEN_SETUP, ENDPOINT_CONTROLEP, // Setup 0&lt;BR /&gt; PIPE_CONTROLPIPE_DEFAULT_SIZE, PIPE_BANK_SINGLE) ) { // Ä¬ÈÏ 8byte&lt;BR /&gt; ErrorCode = HOST_ENUMERROR_PipeConfigError;&lt;BR /&gt; SubErrorCode = 0;&lt;BR /&gt; break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;USB_HostState[corenum] = HOST_STATE_Default;&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HOST_STATE_Default: { // 7 ÕýÔÚ¼ìË÷¿ØÖÆ¹ÜµÀµÄ´óÐ¡ £¬Ê¹ÓÃ¹ÜµÀµÄ¸ÅÄî Ã¶¾Ù&lt;BR /&gt; USB_Descriptor_Device_t DevDescriptor;&lt;BR /&gt; USB_ControlRequest = (USB_Request_Header_t)&lt;BR /&gt; {&lt;BR /&gt; .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE),&lt;BR /&gt; .bRequest = REQ_GetDescriptor,&lt;BR /&gt; .wValue = (DTYPE_Device &amp;lt;&amp;lt; 8),&lt;BR /&gt; .wIndex = 0,&lt;BR /&gt; .wLength = 8,&lt;BR /&gt; };&lt;BR /&gt; //¸ù¾ÝÉÏÏÂÎÄÀí½âÎª »ñÈ¡Éè±¸ÃèÊö·û&lt;BR /&gt; if ((SubErrorCode = USB_Host_SendControlRequest(corenum, &amp;amp;DevDescriptor)) != HOST_SENDCONTROL_Successful) { //sendControlRequest&lt;BR /&gt; ErrorCode = HOST_ENUMERROR_ControlError;&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; DEBUGOUT("Get devicedescription\r\n"); //&lt;BR /&gt; USB_Host_ControlPipeSize[corenum] = DevDescriptor.Endpoint0Size;&lt;/P&gt;&lt;P&gt;Pipe_ClosePipe(corenum, PIPE_CONTROLPIPE);&lt;BR /&gt; HcdRhPortReset(corenum);&lt;/P&gt;&lt;P&gt;HOST_TASK_NONBLOCK_WAIT(corenum, 200, HOST_STATE_Default_PostReset); //µÈ´ýpipe ¸´Î»&lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;stand method： &amp;nbsp;&amp;nbsp;&lt;SPAN style="font-weight: normal;"&gt;get device description&amp;nbsp;ok &amp;nbsp;enum ok &amp;nbsp;but speed vary low&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ohciResetPort();&lt;/P&gt;&lt;P&gt;//PRINT_Log("\r\nreset port complete.");&lt;BR /&gt; /*get device desc max size*/&lt;BR /&gt; rc = hostGetDesc(USB_DESCRIPTOR_TYPE_DEVICE, 0, g_hostBuf, 8, 0);&lt;/P&gt;&lt;P&gt;if (rc != USBHOST_OK)&lt;BR /&gt; {&lt;BR /&gt; PRINT_Err(rc);&lt;BR /&gt; return rc;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; /*set the deviceDesc*/&lt;BR /&gt; memcpy((uint8_t *)(&amp;amp;g_usbDevInfo-&amp;gt;devDesc), (uint8_t *)g_hostBuf, sizeof(USB_DEV_DESC));&lt;BR /&gt; &lt;BR /&gt; /*set the device address to USB_ADDR*/&lt;BR /&gt; rc = hostSetDevAddress(USB_ADDR, 0);&lt;/P&gt;&lt;P&gt;if (rc != USBHOST_OK)&lt;BR /&gt; {&lt;BR /&gt; PRINT_Err(rc); &lt;BR /&gt; return rc;&lt;BR /&gt; }&lt;BR /&gt; //USBHOST_DELAY(20); &lt;BR /&gt; rc = hostGetDesc(USB_DESCRIPTOR_TYPE_DEVICE, 0, g_hostBuf, sizeof(USB_DEV_DESC), USB_ADDR);&lt;/P&gt;&lt;P&gt;if (rc != USBHOST_OK)&lt;BR /&gt; {&lt;BR /&gt; PRINT_Err(rc);&lt;/P&gt;&lt;P&gt;return rc;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;memcpy((uint8_t *)(&amp;amp;g_usbDevInfo-&amp;gt;devDesc), (uint8_t *)g_hostBuf, sizeof(USB_DEV_DESC));&lt;BR /&gt; &lt;BR /&gt; /*get configuration desc data length*/&lt;BR /&gt; rc = hostGetDesc(USB_DESCRIPTOR_TYPE_CONFIGURATION, 0, g_hostBuf, sizeof(USB_CONF_DESC), USB_ADDR);&lt;BR /&gt; &lt;BR /&gt; if (rc != USBHOST_OK)&lt;BR /&gt; {&lt;BR /&gt; PRINT_Err(rc);&lt;/P&gt;&lt;P&gt;return rc;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/*get total description len*/&lt;BR /&gt; n = ReadLE16U((unsigned char *)&amp;amp;g_hostBuf[2]);&lt;/P&gt;&lt;P&gt;/*get all descriptions includes device,config,interface,endpoint*/&lt;BR /&gt; rc = hostGetDesc(USB_DESCRIPTOR_TYPE_CONFIGURATION, 0, g_hostBuf, n, USB_ADDR);&lt;/P&gt;&lt;P&gt;if (rc != USBHOST_OK)&lt;BR /&gt; {&lt;BR /&gt; PRINT_Err(rc);&lt;/P&gt;&lt;P&gt;return rc;&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 06:09:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685924#M27636</guid>
      <dc:creator>mini92</dc:creator>
      <dc:date>2017-05-25T06:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: use lpcusblib in LPC1788 chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685925#M27637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;请问一下，最后是怎么解决的？&lt;/P&gt;&lt;P&gt;什么问题导致的死循环？&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 07:45:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/use-lpcusblib-in-LPC1788-chip/m-p/685925#M27637</guid>
      <dc:creator>caimingchuancai</dc:creator>
      <dc:date>2018-09-21T07:45:46Z</dc:date>
    </item>
  </channel>
</rss>

