<?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>MCU BootloaderのトピックRe: USB detection on TWR-K22F120M board not working</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662546#M355</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;My understanding was wrong and it was as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In bootloader mode, I can use the target as host and can connect mass storage device (eg. Pendrive) to the USB port and it will be able to detect the USB.&amp;nbsp; But it is not so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But implementation in Bootloader is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The target is implemented USB MSC (Mass Storage Class) composite device classes.&amp;nbsp; Plugging in Mass Storage Device to the target board will not help because our target itself is acting as mass storage device.&amp;nbsp;&amp;nbsp; (It is not implemented as host).&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;As explained in Section 6.6 of the user manual (Kinetis Bootloader v2.0.0 Reference Manual), I am able to connect the target as mass storage device and device drive letter appears in the file manager of the operating system.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;But my aim is to make target as host in the Bootloader mode.&amp;nbsp; How do we do it?&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;How do I make my target device as Host in Bootloader mode?&amp;nbsp; By doing so I should be able to connect USB mass storage device to the target and read the files from the pen drive.&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;What are the options available? Is there any support from NXP towards this?&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Any hint towards this direction is highly appreciated.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Regards&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 07:21:42 GMT</pubDate>
    <dc:creator>srinivasa_raow</dc:creator>
    <dc:date>2017-03-06T07:21:42Z</dc:date>
    <item>
      <title>USB detection on TWR-K22F120M board not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662545#M354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on TWR-K22F120M board.&amp;nbsp; &amp;nbsp;I am just working on the existing code and I have selected target device as “MK22F51212” and I have problem in USB detection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Able to compile and download bootloader and LED Demo application code to target board.&lt;/P&gt;&lt;P&gt;Able to use KinetisFlashTool and download the application.&lt;/P&gt;&lt;P&gt;I have UART and USB peripherals enabled in Bootloader Configuration area.&amp;nbsp; I am able to work with UART.&amp;nbsp; Able to send command from blhost and do all the stuff with UART.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In bootloader_config.h I have ensured that&lt;/P&gt;&lt;P&gt;BL_CONFIG_USB_HID and BL_CONFIG_USB_MSC are enabled.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the hardware side, I have ensured that jumpers J26 and J28 are mounted.&amp;nbsp; Pin 1 and 2 of J27 is shorted and J34 is mounted.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After inserting USB, USB is not being detected.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon debugging, I have found that bootloader&amp;nbsp; reads the configuration data, USB is enabled (enabledPeripherals = 0xF9, //!&amp;lt; Enabled Peripheral: UART CAN USB-HID), USB registration is success and handle is returned successfully.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Futher in bl_main.c, it polls for active peripherals, it is able to find UART but not USB.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Wait for a peripheral to become active&lt;BR /&gt; while (activePeripheral == NULL)&lt;BR /&gt; {&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Going further, below line invokes&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if (peripheral-&amp;gt;controlInterface-&amp;gt;pollForActivity(peripheral)) &amp;nbsp;(line 403 of bl_main.c)&lt;/P&gt;&lt;P&gt;calls below &amp;nbsp;function in "usb_hid_msc_peripheral_interface.c"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bool usb_hid_poll_for_activity(const peripheral_descriptor_t *self)&lt;BR /&gt;{&lt;BR /&gt; // uint32_t hidInfoIndex = self-&amp;gt;instance / 2;&lt;BR /&gt; bool hid_active = false;&lt;BR /&gt; bool msc_active = false;&lt;BR /&gt;#if USB_DEVICE_CONFIG_HID&lt;BR /&gt; hid_active = g_device_composite.hid_generic.hid_packet.didReceiveFirstReport;&lt;BR /&gt;#endif // USB_DEVICE_CONFIG_HID&lt;BR /&gt;#if USB_DEVICE_CONFIG_MSC&lt;BR /&gt; msc_active = g_device_composite.msc_disk.msc_state.isActive;&lt;BR /&gt;#endif // USB_DEVICE_CONFIG_HID&lt;/P&gt;&lt;P&gt;s_dHidMscActivity[0] = hid_active;&lt;BR /&gt; s_dHidMscActivity[1] = msc_active;&lt;BR /&gt; return (g_device_composite.attach &amp;amp;&amp;amp; (hid_active || msc_active));&lt;BR /&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;variables hid_active and&amp;nbsp;msc_active is never SET&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why? &amp;nbsp;What is that I am missing? &amp;nbsp;Am i getting interrupts? &amp;nbsp;Am i registered with interrupts?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2017 11:39:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662545#M354</guid>
      <dc:creator>srinivasa_raow</dc:creator>
      <dc:date>2017-02-23T11:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: USB detection on TWR-K22F120M board not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662546#M355</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;My understanding was wrong and it was as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In bootloader mode, I can use the target as host and can connect mass storage device (eg. Pendrive) to the USB port and it will be able to detect the USB.&amp;nbsp; But it is not so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But implementation in Bootloader is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The target is implemented USB MSC (Mass Storage Class) composite device classes.&amp;nbsp; Plugging in Mass Storage Device to the target board will not help because our target itself is acting as mass storage device.&amp;nbsp;&amp;nbsp; (It is not implemented as host).&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;As explained in Section 6.6 of the user manual (Kinetis Bootloader v2.0.0 Reference Manual), I am able to connect the target as mass storage device and device drive letter appears in the file manager of the operating system.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;But my aim is to make target as host in the Bootloader mode.&amp;nbsp; How do we do it?&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;How do I make my target device as Host in Bootloader mode?&amp;nbsp; By doing so I should be able to connect USB mass storage device to the target and read the files from the pen drive.&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;What are the options available? Is there any support from NXP towards this?&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Any hint towards this direction is highly appreciated.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Regards&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 07:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662546#M355</guid>
      <dc:creator>srinivasa_raow</dc:creator>
      <dc:date>2017-03-06T07:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: USB detection on TWR-K22F120M board not working</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662547#M356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivasa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KBOOT doesn't support Host USB and there is not example available for your specific device, but you could check the following links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/assets/documents/data/en/application-notes/AN4368.pdf" title="http://www.nxp.com/assets/documents/data/en/application-notes/AN4368.pdf"&gt;http://www.nxp.com/assets/documents/data/en/application-notes/AN4368.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-102616"&gt;TWR-K70 MSD HOST Bootloader based on AN4368 source code&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/328326"&gt;USB MSD Host Bootloader for K22FN1M0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend to create this USB Host bootloader by using Kinetis Bootloader as reference, and because AN4368 uses USB BareMetal stack (4.1.1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for all inconvenience it may cause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 20:11:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/USB-detection-on-TWR-K22F120M-board-not-working/m-p/662547#M356</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2017-03-13T20:11:10Z</dc:date>
    </item>
  </channel>
</rss>

