<?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 MSD class with external FLASH in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267333#M8119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to confirm that this solution works for me (for now:) ) on khci driver.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2014 13:46:46 GMT</pubDate>
    <dc:creator>primozrebec</dc:creator>
    <dc:date>2014-05-19T13:46:46Z</dc:date>
    <item>
      <title>USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267308#M8094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am using a K20 on a custom board with an external FLASH.&amp;nbsp; I would like to have this external FLASH be a MSD.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have gotten the RAM DISK example working.&amp;nbsp; I have also separately gotten MFS working with the external FLASH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From other threads it appears you cannot use a MSD directly with MFS.&amp;nbsp; Is this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone found a work around or a solution for having a external FLASH act as a MSD?&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;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 19:45:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267308#M8094</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2013-12-17T19:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267309#M8095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you implement an MSD device, you won't need the file system. File system is controlled completely by the host in this case. As shown in the \usb\device\examples\msd\ , all you would need is to fseek to the requested location and write/read the data "from host to data storage"/"from data storage to host".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you might do is to map MQX flashx driver to your external Flash. Then you would be able to use flashx device for fseek(), fwrite() and fread() calls. In response to USB_MSC_DEVICE_READ_REQUEST, it would fseek() to required location in flashx and read the required amount of data (as replacement of USB_mem_copy). In response to USB_MSC_DEVICE_WRITE_REQUEST, it would fseek() to required location and write the required amount of data to flashx, an so forth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mqx\source\io\flashx has examples for various external flash memories.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 10:15:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267309#M8095</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-12-18T10:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267310#M8096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response Martin.&amp;nbsp; I am in process of overlaying the flashx driver with my low-level driver and trying it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One follow up question.&amp;nbsp; As you stated, the HOST (in this case the PC) is controlling the file system.&amp;nbsp; Once I disconnect from the HOST (the PC), I take it I would need to then install MFS to have access to the file system (i.e. I need something "controlling" the file system once I am no longer connected to a PC)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 16:11:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267310#M8096</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2013-12-18T16:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267311#M8097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is right. In response to a USB attach event, perhaps you can uninstall MFS, so the PC gains full control of the data storage. Then in response to a USB detach, MFS can be installed back.&lt;/P&gt;&lt;P&gt;-Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 06:18:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267311#M8097</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-12-20T06:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267312#M8098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 13:04:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267312#M8098</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2013-12-20T13:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267313#M8099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running into a road block with the USB MSD utilizing the flashX driver per your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is from the MQX USB Device User’s Manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use MSD class layer API functions from the application:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Call USB_Class_MSC_Init() to initialize the class driver, all the layers below it, and the device &lt;/LI&gt;&lt;LI&gt;Event callback functions are also passed as a parameter to this function.&lt;/LI&gt;&lt;LI&gt;When the callback function is called with the USB_APP_ENUM_COMPLETE event, the &lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin-left: .5in;"&gt;application should move into the ready state.&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="background: yellow;"&gt;Callback function is called with the USB_MSC_DEVICE_READ_REQUEST event to copy data &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="background: yellow;"&gt;from the storage device before sending it to the USB bus. It reads data from the mass storage device &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="background: yellow;"&gt;to the driver buffer.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;&lt;SPAN style="background: yellow;"&gt;Callback function is called with the USB_MSC_DEVICE_WRITE_REQUEST event to copy data &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="background: yellow;"&gt;from the USB driver buffer to the Storage device. It reads data from the driver buffer to the mass &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="background: yellow;"&gt;storage device.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically my issue is that the callback is called from an interrupt handler routine that for the RAM Disk simply (for a read) copies from RAM to the buffer passed into the callback.&amp;nbsp; In my case, the flashX driver is calling the MQX SPI driver which utilizes semaphores.&amp;nbsp; MQX (with good reason) will not allow you to potentially block on a semaphore in an interrupt handler.&amp;nbsp; The end result is I cannot use the flashX driver from the callback and utilize the fseek(), fwrite(), fread() functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My next thought was when the callback is issued to simply have it signal a Task which will perform the fseek(),fwrite(), fread(). This gets around the first problem, but I encounter another.&amp;nbsp; Specifically it takes too much time to go through the flashX layer, custom SPI layer, MQX SPI layer before the next callback occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the low-level MQX USB driver code for MSD (usb_msc.c).&amp;nbsp; I see the following in an interrupt handler:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msc_obj_ptr-&amp;gt;&lt;STRONG&gt;param_callback.callback&lt;/STRONG&gt;(USB_MSC_DEVICE_READ_REQUEST, (void*)&amp;amp;lba_data, msc_obj_ptr-&amp;gt;param_callback.arg);&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;error = &lt;STRONG&gt;USB_MSC_Bulk_Send_Data&lt;/STRONG&gt;(msc_obj_ptr-&amp;gt;msc_handle,lba_data.buff_ptr,lba_data.size);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first is where the callback occurs.&amp;nbsp; The second is where the data, copied into the buffer in the callback, is sent back to the HOST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this occurring via the interrupt and callback which does not leave much overhead to get the data in the callback buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been going through the documentation trying to understand how to work around this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else had similar issues (have not been able to get up onto the message boards due to maintenance)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&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;Brent W.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Dec 2013 19:23:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267313#M8099</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2013-12-23T19:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267314#M8100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you get it to work? Now I am trying to use the NAND Flash instead of the RAM.&lt;/P&gt;&lt;P&gt;But when it format it, it said can not format it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 21:09:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267314#M8100</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-01-08T21:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267315#M8101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been working with Freescale to try and come up with a solution.&amp;nbsp; The current design for the MQX MSD requires that any reads/writes to the MSD take place within a callback function (void Bulk_Transaction_Callback in their example code).&amp;nbsp; This takes place within an interrupt context.&amp;nbsp; This means, if your driver that accesses the NAND flash utilizes semaphores, then it won't work.&amp;nbsp; MQX (with good reason) will not let you potentially block from within an interrupt context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I am running into.&amp;nbsp; My external FLASH is connected via a SPI bus.&amp;nbsp; The MQX low-level SPI driver (as well as the flashx driver) use semaphores.&amp;nbsp; When called from the callback they return an error due to the semaphore functions being called in an interrupt context.&amp;nbsp; I am thinking that the only solution is to remove the MQX low-level SPI driver and created a simple polling SPI driver that does not use semaphores. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't like the idea that you have to access your MSD device from an interrupt context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 13:43:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267315#M8101</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-09T13:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267316#M8102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Carlos who is one of the Freescale engineer shared me a project which use the SD card as a MSD storage &lt;A href="https://community.nxp.com/message/339709"&gt;USB mass storage device from SD card with TWR-K60&lt;/A&gt;&amp;nbsp; . He said it should work, but when I copy the disk.c to the MQX demo project msd_disk_twrkf120m, it does not work. I am wondering if I did something wrong. I know the read/write on the SD card also use the the interrupt but how does it work? Here is a document shows it use the SD card as a USB MSD storage &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/user_guide/USBUG.pdf" title="http://cache.freescale.com/files/microcontrollers/doc/user_guide/USBUG.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/user_guide/USBUG.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is still a part of the code in that project I don't understand.&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;if(3 == u8gvIndex++)&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sdcard_handle-&amp;gt;LOCATION = (lba_data_ptr-&amp;gt;offset &amp;gt;&amp;gt; 9);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(sdcard_handle,u8gvlba_data_buff,1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; u8gvIndex = 0;&lt;BR /&gt;}&lt;/P&gt;

&lt;/BLOCKQUOTE&gt;&lt;P&gt;Why it use 3 here? If it is used to convert the 64 bytes buffer to 512 bytes, it should use 7. I am confused about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 14:08:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267316#M8102</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-01-09T14:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267317#M8103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SDCard example I have is from the non-MQX USB stack:&amp;nbsp; C:\Program Files (x86)\Freescale USB Stack v3.1.3\Source\Device\app\msd.&amp;nbsp; It contains the usb_descriptor files, SDCard and SPI source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SPI driver code, for the SDCard MSD example is all poll driven.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 14:23:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267317#M8103</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-09T14:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267318#M8104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you look at this thread &lt;A href="https://community.nxp.com/message/339709"&gt;USB mass storage device from SD card with TWR-K60&lt;/A&gt;. Carlos shared a project which is based on MQX. It use the esdhc channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 15:03:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267318#M8104</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-01-09T15:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267319#M8105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did not, I am using a custom board which does not have a SD Card.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 15:06:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267319#M8105</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-09T15:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267320#M8106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the callback issue within the interrupt context, what about using a synchronization service to signal another task to use the driver?&lt;SPAN style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/SPAN&gt; Something like a &lt;SPAN class="SpellE"&gt;lwevent&lt;/SPAN&gt;, or a message?&lt;SPAN style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/SPAN&gt; The interrupt can signal the task, and then return.&lt;SPAN style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/SPAN&gt; The task can then execute using the existing drivers to access the flash, and then the semaphores would run in the task context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a thought.&lt;SPAN style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/SPAN&gt; Thanks&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:08:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267320#M8106</guid>
      <dc:creator>dereksnell</dc:creator>
      <dc:date>2014-01-09T16:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267321#M8107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the input Derek, I had tried that also.&amp;nbsp; The issue is with the design of the MQX USB stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; For example in a read case:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; A USB interrupt goes off&lt;/P&gt;&lt;P&gt;2) USB interrupt handler does two things&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a) calls callback function (this is where I signaled another task to perform the read)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b) once callback function returns, the interrupt handler sends out the "read" data to the USB host (PC). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of these are done from an interrupt context (USB interrupt).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; The issue here is that I don't have the data yet.&amp;nbsp; Even though I signaled the thread to do the read/write, it won't start until the interrupt handler has returned (i.e. done it's thing) and is scheduled to do so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had tried taking the send data back to USB Host out of the stack and doing this in Thread, but that did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 18:43:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267321#M8107</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-09T18:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267322#M8108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The solution I used was to read the USB interrupt status (which is 32-bits) and then pass that off to a (high priority) task using an lwevent.&amp;nbsp; Then you move the processing of the status from the USB interrupt to that task.&amp;nbsp; This means your processing will no longer occur in an interrupt context and you can access blocking drivers.&amp;nbsp; I am using the EHCI driver - did not test with KHCI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:51:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267322#M8108</guid>
      <dc:creator>michaelbrudevol</dc:creator>
      <dc:date>2014-01-09T19:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267323#M8109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good thought Michael, I will try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:58:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267323#M8109</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-09T19:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267324#M8110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try the Michael's method? Does it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 13:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267324#M8110</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-01-16T13:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267325#M8111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having some issues pulling the appropriate code (KHCI) out.&amp;nbsp; I have been meaning to follow up with Michael to get some more details, but got pulled off onto something else for the time being.&amp;nbsp; I will probably be revisiting it soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 13:42:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267325#M8111</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-16T13:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267326#M8112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also trying it. If you get some result, could you share here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 14:55:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267326#M8112</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2014-01-16T14:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSD class with external FLASH</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267327#M8113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure and if you get it working please share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael, not sure if you could share a portion of your code demonstrating how to do this?&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;Brent W&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 14:58:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSD-class-with-external-FLASH/m-p/267327#M8113</guid>
      <dc:creator>brentwilliams</dc:creator>
      <dc:date>2014-01-16T14:58:35Z</dc:date>
    </item>
  </channel>
</rss>

