<?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>topic Re: USB host HID demo times out on FRDM-KL25Z with reproduced USB host in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255941#M7560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, code tag corrupts. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Apr 2013 03:50:41 GMT</pubDate>
    <dc:creator>allankliu</dc:creator>
    <dc:date>2013-04-08T03:50:41Z</dc:date>
    <item>
      <title>USB host HID demo times out on FRDM-KL25Z with reproduced USB host</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255940#M7559</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;I am trying to design a USB OTG board with KL24/25. I want to reuse FRDM-KL25Z for firmware development before making my own board. It is surprised to find out TWR-KL25Z has OTG port with 64KB ROM, while FRDM-KL25Z HAS NOT OTG port with 128KB ROM. So I have to reproduce an additional USB OTG port with FRDM. Check out the following images:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="FRDM_KL25Z.PNG"&gt;&lt;IMG alt="FRDM_KL25Z.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/119230i27C3148069F605DA/image-size/large?v=v2&amp;amp;px=999" title="FRDM_KL25Z.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Fig 1: USB device for FRDM-KL25Z&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="TWR-KL25Z.PNG"&gt;&lt;IMG alt="TWR-KL25Z.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/119231i3992CF265D936418/image-size/large?v=v2&amp;amp;px=999" title="TWR-KL25Z.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Fig 2: USB OTG for TWR-KL25Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="SANY0266-s.JPG"&gt;&lt;IMG alt="SANY0266-s.JPG" src="https://community.nxp.com/t5/image/serverpage/image-id/119232i4DB876761E9FCCC4/image-size/large?v=v2&amp;amp;px=999" title="SANY0266-s.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Fig 3: My add-on OTG port for FRDM-KL25Z, with a DELL mouse attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Description of re-produced OTG port&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Basically, I made a mini USB cable connecting D-/D+/GND from USB KL25Z port to a USB standard A socket, and a separate wire connecting P5V_SDA to VBUS of USB std A socket. I know VBUS power supply should be controlled by a dedicated USB pwr switch with enable pin to GPIO of KL25Z. But I think it is enough for simple hardware. Once plug in SDA USB, the VBUS from PC should supply to VBUS of reproduced USB port.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding pull-up/pull-down, it should be implemented by USB internal PU/PD resistors controlled by firmware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is usb-host demo, with small modification on preprocessor in EWARM for FRDM. The terminal reports as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;External Pin Reset
KL2580pin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100pin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Low Power Line with Cortex M0+
SRAM Size:&amp;nbsp; 16 KB
Silicon rev 15
Flash size:&amp;nbsp; 128 KB program flash, 4 KB protection region&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Main OK

Timer Init OK
USB HOST Init OK

USB HID Mouse
Waiting for USB Mouse to be attached...
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USB host can not detect mouse at all. So I traced the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
&lt;P&gt;hidmouse.c::main() Mouse_Task(main_buffer,&amp;amp;main_hid_com); // hid_device.DEV_STATE is always USB_DEVICE_IDLE _usb_khci_task(); // times out and keep reset bus khci.c::_usb_khci_task() switch (msg.type){&amp;nbsp;&amp;nbsp;&amp;nbsp; case TR_MSG_SETUP:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _usb_khci_atom_tr(...) // always timeout&lt;/P&gt;
&lt;P&gt;...... }&lt;/P&gt;
&lt;P&gt;...... if ((khci_event.VALUE &amp;amp; KHCI_EVENT_MASK)){&lt;/P&gt;
&lt;P&gt;......&amp;nbsp;&amp;nbsp;&amp;nbsp; /* bus reset */&amp;nbsp;&amp;nbsp;&amp;nbsp; USB0_CTL |= USB_CTL_RESET_MASK; // mouse laser is turned off&amp;nbsp;&amp;nbsp;&amp;nbsp; time_delay(10);&amp;nbsp;&amp;nbsp;&amp;nbsp; USB0_CTL &amp;amp;= ~USB_CTL_RESET_MASK; // mouse laser is turned on&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is: when mouse is plugged-in, USB host can detect and find out its speed (LS). However the following transaction always timeout. And it keeps reset the bus, I can find it from laser LED toggling. I am pretty sure VBUS/D-/D+/GND is connected correctly between USB mini B and USB std A. I assume the code should have been verified on TWR board.&lt;STRONG&gt;Can anyone tell me why its transaction times out? Any suggestions are highly appreciated. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the desired device should be populated into a table, but its PID/VID are all zero. &lt;STRONG&gt;Should I touched the const table with my DELL mouse? (HID\VID_0461&amp;amp;PID_4D15\7&amp;amp;A65A7C4&amp;amp;0&amp;amp;0000 for my mouse)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255940#M7559</guid>
      <dc:creator>allankliu</dc:creator>
      <dc:date>2020-11-02T13:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: USB host HID demo times out on FRDM-KL25Z with reproduced USB host</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255941#M7560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, code tag corrupts. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 03:50:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255941#M7560</guid>
      <dc:creator>allankliu</dc:creator>
      <dc:date>2013-04-08T03:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: USB host HID demo times out on FRDM-KL25Z with reproduced USB host</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255942#M7561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked the OTG port today. When reset, D+/D- is almost ground, VBUS=4.5V. When code runs, D- is about 1.6V, D+ is ground. So I think maybe it is related to hardware or pull up/pull down configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 00:46:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255942#M7561</guid>
      <dc:creator>allankliu</dc:creator>
      <dc:date>2013-04-09T00:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: USB host HID demo times out on FRDM-KL25Z with reproduced USB host</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255943#M7562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally it works for both hardware and software, check another thread of my discussion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/323235"&gt;Add-on OTG port hardware/register setup.&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 12:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-host-HID-demo-times-out-on-FRDM-KL25Z-with-reproduced-USB/m-p/255943#M7562</guid>
      <dc:creator>allankliu</dc:creator>
      <dc:date>2013-04-12T12:11:41Z</dc:date>
    </item>
  </channel>
</rss>

