<?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>Kinetis MicrocontrollersのトピックRe: USB Host interrupt not working after port</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010496#M56089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems the Host Power was not configured correctly in my project, and after fixing this, the Interrupt triggers.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2020 18:37:50 GMT</pubDate>
    <dc:creator>jbaker1</dc:creator>
    <dc:date>2020-02-26T18:37:50Z</dc:date>
    <item>
      <title>USB Host interrupt not working after port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010495#M56088</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've recently begun to work on NXP products, and the next thing I'm trying to add to my project is USB Host MSD capabilities.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with SDK 2.6.0 for FRDM-K66F. On the FRDM-K66 board I was able to get the demo frdmk66f_host_msd_fatfs_freertos to work. I then tested this demo project on the board I am working on, which is a MK66FN2M0VLQ18R.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to successfully observe the expected test printouts on the MK66FN board. Then I tried to port the demo functionality to my project that has many other tasks and modules operating, and I'm unable to observe a USB host enumeration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After troubleshooting it for a while I've learned and fixed a few things:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;the interrupt USBHS_IRQHandler which contains&amp;nbsp;USB_HostEhciIsrFunction(g_HostHandle) never gets called (this interrupt runs constantly within the demo project.&lt;/LI&gt;&lt;LI&gt;The USB_HostTask runs as far as I can tell. It runs once and gets to USB_OsaEventWait, which looks like it's waiting for an event to be created as a result of the USBHS_IRQHandler interrupt detecting a port change.&lt;/LI&gt;&lt;LI&gt;The USB_HostApplicationTask runs correctly, but without the enumeration it doesn't have a device state or a run state.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my attempts at determining the status of the ISR within the code related to the setup within USB_HostIsrEnable. I have striked through areas of the code that are not compiled as a result of a define not being present. (This is using a EHCI controller, not a KHCI for instance)&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void USB_HostIsrEnable(void)&lt;BR /&gt;{&lt;BR /&gt; uint8_t irqNumber;&lt;BR /&gt;#if defined(USB_HOST_CONFIG_EHCI) &amp;amp;&amp;amp; (USB_HOST_CONFIG_EHCI &amp;gt; 0U)&lt;BR /&gt; uint8_t usbHOSTEhciIrq[] = USBHS_IRQS;&lt;BR /&gt; irqNumber = usbHOSTEhciIrq[CONTROLLER_ID - kUSB_ControllerEhci0];&lt;BR /&gt;#endif /* USB_HOST_CONFIG_EHCI */&lt;BR /&gt;&lt;SPAN style="text-decoration: line-through;"&gt;#if defined(USB_HOST_CONFIG_KHCI) &amp;amp;&amp;amp; (USB_HOST_CONFIG_KHCI &amp;gt; 0U)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: line-through;"&gt; uint8_t usbHOSTKhciIrq[] = USB_IRQS;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: line-through;"&gt; irqNumber = usbHOSTKhciIrq[CONTROLLER_ID - kUSB_ControllerKhci0];&lt;/SPAN&gt;&lt;BR /&gt;#endif /* USB_HOST_CONFIG_KHCI */&lt;/P&gt;&lt;P&gt;/* Install isr, set priority, and enable IRQ. */&lt;BR /&gt;&lt;SPAN style="text-decoration: line-through;"&gt;#if defined(__GIC_PRIO_BITS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: line-through;"&gt; GIC_SetPriority((IRQn_Type)irqNumber, USB_HOST_INTERRUPT_PRIORITY);&lt;/SPAN&gt;&lt;BR /&gt;#else&lt;BR /&gt; NVIC_ClearPendingIRQ(irqNumber);&lt;BR /&gt; NVIC_SetPriority((IRQn_Type)irqNumber, USB_HOST_INTERRUPT_PRIORITY);&lt;BR /&gt;#endif&lt;BR /&gt; EnableIRQ((IRQn_Type)irqNumber);&lt;/P&gt;&lt;P&gt;uint32_t test_print = 0;&lt;BR /&gt; IRQn_Type usb_host_irq_num = USBHS_IRQn;&lt;BR /&gt; test_print = NVIC_GetEnableIRQ(usb_host_irq_num);&lt;BR /&gt; debug_print("USB Host Interrupt %s enabled. \n", test_print? "is" : "is not");&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_print = NVIC_GetPendingIRQ(usb_host_irq_num);&lt;BR /&gt; debug_print("USB Host Interrupt %s pending. \n", test_print? "is" : "is not");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The result of the print statements are "is enabled" "is not pending".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Major differences that I can think of that could cause it to work on the&amp;nbsp;demo project&amp;nbsp;but not after porting to my project:&lt;/P&gt;&lt;P&gt;The demo is strictly a C project, and the project I'm porting to is a mix of c++ and c.&lt;/P&gt;&lt;P&gt;The project has 20 tasks running, but to my knowledge the tasks shouldn't override interrupts.&lt;/P&gt;&lt;P&gt;This project also contains a usb device for communication, this is established via middleware and running on USB0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to know possible reasons why the interrupt is not firing as it is in the demo. If anyone can help, I would appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 13:41:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010495#M56088</guid>
      <dc:creator>jbaker1</dc:creator>
      <dc:date>2020-02-25T13:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: USB Host interrupt not working after port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010496#M56089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems the Host Power was not configured correctly in my project, and after fixing this, the Interrupt triggers.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 18:37:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010496#M56089</guid>
      <dc:creator>jbaker1</dc:creator>
      <dc:date>2020-02-26T18:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: USB Host interrupt not working after port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010497#M56090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im glad you were able to resolve this and thank you for posting your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 21:09:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1010497#M56090</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-02-26T21:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: USB Host interrupt not working after port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1375104#M61910</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;but the usb on the k66 together with other activities you work well?&lt;BR /&gt;I am making the same project, but often reading a file continuously from the USB, it goes into error and I have to extract and insert the key again to get it started again.&lt;/P&gt;&lt;P&gt;Did you notice anything strange?&lt;BR /&gt;Maurizio&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 15:41:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/USB-Host-interrupt-not-working-after-port/m-p/1375104#M61910</guid>
      <dc:creator>Microfelix</dc:creator>
      <dc:date>2021-11-22T15:41:29Z</dc:date>
    </item>
  </channel>
</rss>

