<?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 Current Consumption Remains after De-Init in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758764#M215860</link>
    <description>&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;The application is working fine, no problem at all. Our project is running with limited power budget, so every juice counts. Really appreciate if you can help me to point out the possible reasons to why the usb power remains even after de-init.&lt;/P&gt;&lt;P&gt;I did not observe any change in power consumption before usb is initialize. Since usb is not running by default, I can clearly see the jump in current when usb is connected and initialized.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 04:50:57 GMT</pubDate>
    <dc:creator>Rudy25</dc:creator>
    <dc:date>2023-11-17T04:50:57Z</dc:date>
    <item>
      <title>USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758098#M215809</link>
      <description>&lt;DIV&gt;Hi all, good day!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;We have a custom board that based on EVK1062 demo board. Our source code is based on SDK version 2.13.2.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I measured the current consumption at 3.3V rail when USB is initialized, up and running versus&lt;/DIV&gt;&lt;DIV&gt;when USB is not initialized and not running at all.&lt;/DIV&gt;&lt;DIV&gt;I can see about 8mA increase when USB is up and running which is pretty much normal since USB peripheral/clock is initialized.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;During normal operation, we basically don't need USB. We only need it if we wanted to do firmware update&amp;nbsp;or perform diagnostic check. So, by default USB is not initialize and will only initialize it when&lt;/DIV&gt;&lt;DIV&gt;it is connected. And then, when USB is disconnected, we de-initialize it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The de-initialization, I've done it in a way that reversing the initialization steps.&lt;/DIV&gt;&lt;DIV&gt;I was surprise because after de-init the USB, the current that I was reading was still the same as when the USB is up and running.&lt;/DIV&gt;&lt;DIV&gt;Why is that? Can you please have a look below code snapshot? And please tell me if I forgot something or did something wrong.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you very much.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Code snapshot for USB init:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; USB_DeviceClockInit();&lt;/DIV&gt;&lt;DIV&gt;#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) &amp;amp;&amp;amp; (FSL_FEATURE_SOC_SYSMPU_COUNT &amp;gt; 0U))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; SYSMPU_Enable(SYSMPU, 0);&lt;/DIV&gt;&lt;DIV&gt;#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; s_cdcVcom.speed = USB_SPEED_FULL;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; s_cdcVcom.attach = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; s_cdcVcom.deviceHandle = NULL;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; if (kStatus_USB_Success != USB_DeviceInit(CONTROLLER_ID, USB_DeviceCallback, &amp;amp;s_cdcVcom.deviceHandle))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; USB_DeviceIsrEnable();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; /*Add one delay here to make the DP pull down long enough to allow host to detect the previous disconnection.*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; SDK_DelayAtLeastUs(5000, BOARD_BOOTCLOCKRUN_CORE_CLOCK);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; USB_DeviceRun(s_cdcVcom.deviceHandle);&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Code snapshot for USB de-init:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; uint32_t i_sr;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; uint8_t irqNumber;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; uint8_t usbDeviceEhciIrq[] = USBHS_IRQS;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; irqNumber&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = usbDeviceEhciIrq[CONTROLLER_ID - kUSB_ControllerEhci0];&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; vf_enter_critical(&amp;amp;i_sr);&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; /* Stop the USB Device */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; if(kStatus_USB_Success != USB_DeviceStop(s_cdcVcom.deviceHandle))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; __asm("nop");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; /* Disable the interrupt */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; DisableIRQ((IRQn_Type)irqNumber);&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; s_cdcVcom.attach = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; s_cdcVcom.startTransactions = 0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; /* De-init the USB */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; if(kStatus_USB_Success != USB_DeviceDeinit(s_cdcVcom.deviceHandle))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; __asm("nop");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; if(kUSB_ControllerEhci0 == CONTROLLER_ID)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /* disable the USB pll clock */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CLOCK_DisableUsbhs0PhyPllClock();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; USB_EhciPhyDeinit(CONTROLLER_ID);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; vf_exit_critical(i_sr);&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Nov 2023 06:27:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758098#M215809</guid>
      <dc:creator>Rudy25</dc:creator>
      <dc:date>2023-11-16T06:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758636#M215845</link>
      <description>&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;I understand this query is power consumption related, but is the application itself working correctly?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;Is there any change in the power consumption before initializing the USB for the first time?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;Daniel.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 22:29:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758636#M215845</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2023-11-16T22:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758764#M215860</link>
      <description>&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;The application is working fine, no problem at all. Our project is running with limited power budget, so every juice counts. Really appreciate if you can help me to point out the possible reasons to why the usb power remains even after de-init.&lt;/P&gt;&lt;P&gt;I did not observe any change in power consumption before usb is initialize. Since usb is not running by default, I can clearly see the jump in current when usb is connected and initialized.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 04:50:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1758764#M215860</guid>
      <dc:creator>Rudy25</dc:creator>
      <dc:date>2023-11-17T04:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1759212#M215903</link>
      <description>&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;Please take a look to these articles that might be useful for you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12245.pdf" target="_blank"&gt;AN12245&lt;/A&gt; and &lt;A href="https://www.nxp.com/docs/en/data-sheet/IMXRT1060XCEC.pdf" target="_blank"&gt;Data Sheet&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;Have you tried any low power mode yet? For instance, instead of de-initializing the USB, you could try to set a Low Power Suspend Mode. Please take look to Chapter 42 of the reference manual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;I hope this helps,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in 27.5pt 0in 0in;"&gt;&lt;SPAN&gt;Daniel.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 20:37:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1759212#M215903</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2023-11-17T20:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1760114#M216021</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;I haven't tried to set the usb to low power or suspend mode.&lt;/P&gt;&lt;P&gt;If our core is running at full-speed and no plan to change its state, is it possible to set the usb only to low power or suspend mode? If yes, do you have a reference project that I can use (probably sample project available in SDK)?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 22:34:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1760114#M216021</guid>
      <dc:creator>Rudy25</dc:creator>
      <dc:date>2023-11-20T22:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: USB Current Consumption Remains after De-Init</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1761133#M216120</link>
      <description>&lt;P&gt;Probably some of the suspend-resume SDK examples might be useful.&lt;/P&gt;
&lt;P&gt;For instance,&amp;nbsp;dev_suspend_resume_hid_mouse_bm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps,&lt;/P&gt;
&lt;P&gt;Daniel.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 20:09:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/USB-Current-Consumption-Remains-after-De-Init/m-p/1761133#M216120</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2023-11-21T20:09:57Z</dc:date>
    </item>
  </channel>
</rss>

