<?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 i.MX6 USB host detection in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-host-detection/m-p/875191#M132855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to "i.MX 6SoloLite Applications Processor Reference Manual, Rev. 3, 09/2017" it is possible to detect&amp;nbsp;when i.MX6 is connected to USB host. I am referring to section "52.2.4.5 USB Plugged-In Detector" and "52.2.7.2 Data pin contact detector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On my i.MX6 I have enabled "Data pin contact detector" mode in register USB_ANALOG_USB1_CHRG_DETECTn by setting:&lt;/P&gt;&lt;P&gt;EN_B = 0&lt;/P&gt;&lt;P&gt;CHK_CHRG_B = 1&lt;/P&gt;&lt;P&gt;CHK_CONTACT = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I do not observe any difference&amp;nbsp;while my board&amp;nbsp;is&amp;nbsp;plugged to power bank or USB host. USB_ANALOG_USB1_CHRG_DETECT_STAT value is the same for both cases. Moreover, when connected to PC only&amp;nbsp;PLUG_CONTACT bit is set to 1, but I would expect that&amp;nbsp;DP_STATE and&amp;nbsp;DM_STATE are also set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see log below when i.MX6 is connected either to PC or power bank:&lt;/P&gt;&lt;P&gt;root@imx6:~# ./app 0x20C81B0&amp;nbsp; &amp;lt;--&amp;nbsp;&lt;STRONG&gt;USB1_CHRG_DETECT register.&lt;/STRONG&gt;&lt;BR /&gt;:0x020c81b0 =0x000c0000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;--&amp;nbsp;&lt;STRONG&gt;EN_B = 0,&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;CHK_CHRG_B = 1,&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;CHK_CONTACT = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;root@&lt;SPAN&gt;imx6&lt;/SPAN&gt;:~# ./app 0x20C81D0&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;--&amp;nbsp;&lt;STRONG&gt;USB1_CHRG_DETECT_STAT register&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;:0x020c81d0 =0x00000001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;--&amp;nbsp;&lt;STRONG&gt;DP_STATE = 0,&amp;nbsp;DM_STATE = 0,&amp;nbsp;CHRG_DETECTED = 0,&amp;nbsp;PLUG_CONTACT = 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2019 14:23:58 GMT</pubDate>
    <dc:creator>rspolyak</dc:creator>
    <dc:date>2019-03-20T14:23:58Z</dc:date>
    <item>
      <title>i.MX6 USB host detection</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-host-detection/m-p/875191#M132855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to "i.MX 6SoloLite Applications Processor Reference Manual, Rev. 3, 09/2017" it is possible to detect&amp;nbsp;when i.MX6 is connected to USB host. I am referring to section "52.2.4.5 USB Plugged-In Detector" and "52.2.7.2 Data pin contact detector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On my i.MX6 I have enabled "Data pin contact detector" mode in register USB_ANALOG_USB1_CHRG_DETECTn by setting:&lt;/P&gt;&lt;P&gt;EN_B = 0&lt;/P&gt;&lt;P&gt;CHK_CHRG_B = 1&lt;/P&gt;&lt;P&gt;CHK_CONTACT = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I do not observe any difference&amp;nbsp;while my board&amp;nbsp;is&amp;nbsp;plugged to power bank or USB host. USB_ANALOG_USB1_CHRG_DETECT_STAT value is the same for both cases. Moreover, when connected to PC only&amp;nbsp;PLUG_CONTACT bit is set to 1, but I would expect that&amp;nbsp;DP_STATE and&amp;nbsp;DM_STATE are also set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see log below when i.MX6 is connected either to PC or power bank:&lt;/P&gt;&lt;P&gt;root@imx6:~# ./app 0x20C81B0&amp;nbsp; &amp;lt;--&amp;nbsp;&lt;STRONG&gt;USB1_CHRG_DETECT register.&lt;/STRONG&gt;&lt;BR /&gt;:0x020c81b0 =0x000c0000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;--&amp;nbsp;&lt;STRONG&gt;EN_B = 0,&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;CHK_CHRG_B = 1,&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;CHK_CONTACT = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;root@&lt;SPAN&gt;imx6&lt;/SPAN&gt;:~# ./app 0x20C81D0&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;--&amp;nbsp;&lt;STRONG&gt;USB1_CHRG_DETECT_STAT register&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;:0x020c81d0 =0x00000001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;--&amp;nbsp;&lt;STRONG&gt;DP_STATE = 0,&amp;nbsp;DM_STATE = 0,&amp;nbsp;CHRG_DETECTED = 0,&amp;nbsp;PLUG_CONTACT = 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 14:23:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-host-detection/m-p/875191#M132855</guid>
      <dc:creator>rspolyak</dc:creator>
      <dc:date>2019-03-20T14:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 USB host detection</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-host-detection/m-p/875192#M132856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ros&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for usb charger detection examples one can look at linux drivers on&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/chipidea/usbmisc_imx.c?h=imx_4.14.78_1.0.0_ga" title="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/chipidea/usbmisc_imx.c?h=imx_4.14.78_1.0.0_ga"&gt;usbmisc_imx.c\chipidea\usb\drivers - linux-imx - i.MX Linux kernel&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink11" href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/gadget/imx_usb_charger.c?h=imx_3.0.35_4.1.0_caf" title="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/gadget/imx_usb_charger.c?h=imx_3.0.35_4.1.0_caf"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/gadget/imx_usb_charger.c?h=imx_3.0.35_4.1.0_caf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Thu, 21 Mar 2019 09:13:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-USB-host-detection/m-p/875192#M132856</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2019-03-21T09:13:45Z</dc:date>
    </item>
  </channel>
</rss>

