<?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 Software Development Kit中的主题 Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465564#M3565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help. Now I have my &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;custom USB Host MSD bootloader &lt;/SPAN&gt;firmware working properly in OSA BareMetal mode both on the TWR-K65F180M and on my custom &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;board based on K66F180 cpu&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see it is mandatory to flag both MPU and FMC settings in the PEx fsl_usb_framework component:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3323i8C96CC5B57141C3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The usbFmw1_host_soc_init() function in the generated usbFmw1_host_bsp.c file automatically enables MPU clock gating and then disables MPU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The USB task priority must be set to 4 (KHCI task priority is set to 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the usbFmw1 component is set to be auto-initialized &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN&gt;for convenience &lt;/SPAN&gt;&lt;/SPAN&gt;at startup. If after the startup my USB task deinitializes the USB Host driver and then re-initializes it (to see if the USB Host driver is well initialized and ready), then the USB Host driver does not work any more. So, I have to trust all the auto-initializations made at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Working with USB on the TWR-K65F180M, care must be taken on driving the two leds D8 and D9 of the two touch pads for visual application signals: these leds are driven by PTA28 and PTA29 cpu port-pin, which are the same GPIO4 and GPIO6 who drive the USB power switch on the TWR-SER board. Blinking those leds causes VB_HOST supply to be disabled. It should be remarked in the TWR-K65F180M user manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 10:22:12 GMT</pubDate>
    <dc:creator>Vagni</dc:creator>
    <dc:date>2016-03-31T10:22:12Z</dc:date>
    <item>
      <title>Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465560#M3561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;On my custom board based on K66F180 cpu I have successfully developed an application that handles &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;memory sticks on USB Host. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I have developed my application with KDS 3.1.0 and KSDK 1.3.0 + PEx. My application is based on MQX RTOS Standard and I created my project following the tutorial &lt;A _jive_internal="true" data-containerid="11347" data-containertype="14" data-objectid="103429" data-objecttype="102" href="https://community.nxp.com/docs/DOC-103429"&gt;How To: Create an MQX RTOS for KSDK project with Processor Expert in Kinetis Design Studio IDE&lt;/A&gt; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Following the tutorial &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://centaurian.co.uk/2015/07/15/frdm-k64f-data-logger-using-fatfs-with-ksdk-1-2-0/" rel="nofollow" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #017bba;"&gt;FRDM K64F Data Logger using FatFs with KSDK 1.2.0 | Centaurian&amp;nbsp; &lt;/A&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;and &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;the host_msd_fatfs_mqx_twrk65f180m demo project provided with KSDK 1.3.0, &lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I chose FatFs file system for the USB mass storage devices.&lt;/SPAN&gt;&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 style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Now, on the same board I am developing another application that &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;handles &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;memory sticks on USB Host. This second application is more simple than the first one (it's a custom USB Host MSD bootloader), so I chose the OSA BareMetal mode provided with PEx. I use the same USB Host and FatFs source files of my first application.&lt;/SPAN&gt;&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 style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;In my application based on &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;the OSA BareMetal mode I defined two task: the main Boot_task and the USB_task. Like in my first application, the USB_task waits for attach/detach events and mounts the FatFs file system on a successfully attached mass storage device.&lt;/SPAN&gt;&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 style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I run into the following issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If the watchdog is enabled (WDOG_DRV_Init()), the application crashes after few seconds. I still don't know why; I chose to not use the watchdog.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;When I inserted a memory stick, on the debug console I got the "3TR Timeout!" error message from the USB Host core. Following the post &lt;A _jive_internal="true" data-containerid="2019" data-containertype="14" data-objectid="329494" data-objecttype="1" href="https://community.nxp.com/thread/329494"&gt;Kinetis Design Studio&amp;nbsp; USB "3TR Timeout!" in khci.c&lt;/A&gt; , I solved the issue disabling MPU on the main startup. But I still don't understand why.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Attach/Detach events now are properly detected, but when mounting the FatFs file system on an attached memory stick, the msd_disk_ioctl() function in the msd_diskio.c source file (used to send the first SCSI commands to the device) never ends, because the end command call-back function is never called by the USB Host core.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I know USB Host core creates some internal OS_tasks, OS_events, OS_MessageQueues and OS_Mutex: for this, there is an adapter interface to the current SDK OS abstraction.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Issue 3. looks like some internal task or event related to the control-pipe transactions is not running properly in my OSA BareMetal system.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I have the macro OS_ADAPTER_ACTIVE_OS = OS_ADAPTER_SDK in the adapter_cfg.h header file. The macro USE_RTOS = 0 (no RTOS is used). In this condition &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;msd_disk_ioctl(), msd_disk_read() and msd_disk_write() functions call the OSA_PollAllOtherTasks() function while waiting the command end. So the internal USB tasks should run and process the command transaction&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;OSA BareMetal mode is a possible choise also in &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;the host_msd_fatfs_mqx_twrk65f180m demo project provided with KSDK 1.3.0.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;What is the right configuration for the USB Host stack working in OSA BareMetal mode?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2016 23:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465560#M3561</guid>
      <dc:creator>Vagni</dc:creator>
      <dc:date>2016-01-26T23:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465561#M3562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alessandro Vagniluca,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I know, PEx for ksdk 1.3 doesn't support&amp;nbsp; Host MSD class, so maybe there is any compatibility issue.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4605iA8759FA46F696422/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but there is a bare metal demo for msd_fatfs based on TWR-K65F180M , you may find it in the folder of "C:\Freescale\KSDK_1.3.0\examples\twrk65f180m\demo_apps\usb\host\msd\msd_fatfs\bm", how about using it as a starting point?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NXP Technical Support&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, 28 Jan 2016 09:11:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465561#M3562</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2016-01-28T09:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465562#M3563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Kan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I know PEx for KSDK 1.3.0 provides only the fsl_usb_framework component for USB Host functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, in my previous MQX_Standard project I got USB Host MSD working properly, just using the fsl_usb_framework component to define and initialize the USB Host driver and then manually adding to my project the source files from the "&amp;lt;KSDK_1.3.0&amp;gt;\usb\usb_core\host" library folder (I am working on my custom board, I haven't got a TWR-K65F180M).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I loaded the fsl_usb_framework PEx component and configured it in Host mode to generate the driver information table for USB_CLASS_MASS_STORAGE with USB_SUBCLASS_MASS_UFI and USB_SUBCLASS_MASS_SCSI sub-classes and USB_PROTOCOL_MASS_BULK protocol. I use the same usb_host_mass_device_event() MSD event call-back function and my USB task has the same architecture of APP_Task() function in the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;host_msd_fatfs_mqx_twrk65f180m demo project provided with KSDK 1.3.0&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;On a USB_DEVICE_INTERFACE_OPENED mass device state event I call f_mount() to mount the FatFs file system on the attached USB memory stick and I signal the available mass storage device ready to all the other tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Now, I copied my previous working project in a new one and I based this one in OSA BareMetal Mode with only the 3 task needed by &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;custom USB Host MSD bootloader&lt;/SPAN&gt;. In this my new project the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;USB task keeps the same architecture of APP_Task() function in the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;host_msd_fatfs_mqx_twrk65f180m demo project.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; I see the macro TASK_MAX_NUM is set to 5 in &amp;lt;MY_PROJECT&amp;gt;\SDK\platform\osa\inc\fsl_os_abstraction_bm.h header file generated by PEx. How many internal tasks are created by the USB Host core?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;In my project I have the macro _DEBUG=1 to enable the debug output on the Debug Console: in fact, I have got the occurrence of issue 2. "3TR Timeout!" through the Debug Console. But I receive no other error messages from the USB Host core.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Alessandro&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 10:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465562#M3563</guid>
      <dc:creator>Vagni</dc:creator>
      <dc:date>2016-01-28T10:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465563#M3564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alessandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could notice that there is a failure in your project when it tries to mount fatfs in the MSD, it seems to be a NULL pointer that would handle the information for attached device, then, host tries to detach the device and re-enumerate again but it does not matter how many times the device is enumerated, the problem is always shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a basic USB Host + PEx + Fatfs 0.09 + KSDK 1.3 and BareMetal implementation example that seems to be working properly. Next image shows how the system is mounted correctly and some IOCTL functions are sent to device correctly.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Terminal Output.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23375iC82158560D65328B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Terminal Output.jpg" alt="Terminal Output.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="USB Host + Fatfs 0.09 + PEx.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23314i4B237041141A05DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="USB Host + Fatfs 0.09 + PEx.jpg" alt="USB Host + Fatfs 0.09 + PEx.jpg" /&gt;&lt;/span&gt;I hope this can help you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 22:59:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465563#M3564</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-03-17T22:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465564#M3565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help. Now I have my &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;custom USB Host MSD bootloader &lt;/SPAN&gt;firmware working properly in OSA BareMetal mode both on the TWR-K65F180M and on my custom &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;board based on K66F180 cpu&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see it is mandatory to flag both MPU and FMC settings in the PEx fsl_usb_framework component:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/3323i8C96CC5B57141C3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The usbFmw1_host_soc_init() function in the generated usbFmw1_host_bsp.c file automatically enables MPU clock gating and then disables MPU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The USB task priority must be set to 4 (KHCI task priority is set to 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the usbFmw1 component is set to be auto-initialized &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN&gt;for convenience &lt;/SPAN&gt;&lt;/SPAN&gt;at startup. If after the startup my USB task deinitializes the USB Host driver and then re-initializes it (to see if the USB Host driver is well initialized and ready), then the USB Host driver does not work any more. So, I have to trust all the auto-initializations made at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Working with USB on the TWR-K65F180M, care must be taken on driving the two leds D8 and D9 of the two touch pads for visual application signals: these leds are driven by PTA28 and PTA29 cpu port-pin, which are the same GPIO4 and GPIO6 who drive the USB power switch on the TWR-SER board. Blinking those leds causes VB_HOST supply to be disabled. It should be remarked in the TWR-K65F180M user manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 10:22:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465564#M3565</guid>
      <dc:creator>Vagni</dc:creator>
      <dc:date>2016-03-31T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465565#M3566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alessandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad you could get your project working in both boards. About PTA28 and PTA29 in TWR-K65F180M, I will try to report this issue to documentation team, so I could expect that User Manual gets updated with this useful information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still editing a document that lists the steps needed to create a basic USB Host MSC + fatfs + KSDK 1.3 + PEx project for future references, will let you know when this is completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If more help is needed just let me know it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:02:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465565#M3566</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-03-31T14:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465566#M3567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;Isaac Avila&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm working under K64, do you have this example project (BM + USB Host) for this processor (K64)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:58:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465566#M3567</guid>
      <dc:creator>bouhady</dc:creator>
      <dc:date>2016-05-23T10:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465567#M3568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yaniv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that you are looking for this document: &lt;A href="https://community.nxp.com/docs/DOC-331376"&gt;USB Host Project with KSDK 1.3 and Processor Expert&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 16:00:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465567#M3568</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-05-23T16:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465568#M3569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is very helpful&lt;/P&gt;&lt;P&gt;In any case i'm tring to create a bootloader Base on USB as a host and I&lt;/P&gt;&lt;P&gt;Wonder if you have this kind of example?&lt;/P&gt;&lt;P&gt;What should I need to do in order to create such process with the BM OS&lt;/P&gt;&lt;P&gt;(goto /swap etc.) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;בתאריך יום ב׳, 23 במאי 2016, 19:01, מאת isaacavila ‏&amp;lt;&lt;/P&gt;&lt;P&gt;admin@community.freescale.com&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;NXP Community&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg&amp;gt;&lt;/P&gt;&lt;P&gt;Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply from isaacavila&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/people/isaacavila?et=watches.email.thread&amp;gt;&lt;/P&gt;&lt;P&gt;in &lt;STRONG&gt;Kinetis Software Development Kit&lt;/STRONG&gt; - View the full discussion&lt;/P&gt;&lt;P&gt;&amp;lt;https://community.freescale.com/message/653164?et=watches.email.thread#comment-653164&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 16:16:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465568#M3569</guid>
      <dc:creator>bouhady</dc:creator>
      <dc:date>2016-05-23T16:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problems Using USB Host MSD with KDS + PEx + FatFs in OSA BareMetal Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465569#M3570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yaniv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I do not have such example, the only reference for this bootloader could be this application note &lt;A href="http://cache.nxp.com/files/microcontrollers/doc/app_note/AN4368.pdf" title="http://cache.nxp.com/files/microcontrollers/doc/app_note/AN4368.pdf"&gt;http://cache.nxp.com/files/microcontrollers/doc/app_note/AN4368.pdf&lt;/A&gt; but this is using MQX. You would need to migrate this for KSDK but maybe this AN can help you!&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 16:32:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-Using-USB-Host-MSD-with-KDS-PEx-FatFs-in-OSA-BareMetal/m-p/465569#M3570</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-05-23T16:32:30Z</dc:date>
    </item>
  </channel>
</rss>

