<?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 MFS behavior different for different flash drive manufacturers? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-behavior-different-for-different-flash-drive-manufacturers/m-p/321504#M10264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building an application based off the mfs_usb example in MQX 4.0.1 for the 52259evb.&amp;nbsp; My application is basically as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is crucial that I sample data every 20ms.&amp;nbsp; It is not possible to sample the data, write it to file, then flush the file in 20ms, so what I do is I have two tasks, and two buffers.&amp;nbsp; A sample task/buffer, and a write task/buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I grab data samples every 20ms, and stick them in a buffer that can hold up to 400ms worth of sample data.&amp;nbsp; After 400ms (20 sample points), I swap the pointer for the read/write buffers, and I initiate a file write of the data.&amp;nbsp; While the write is occurring, I then continue sampling data in the other task into the other buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically, every 400ms I have an fprintf() of approximatly 500 bytes followed by an fflush().&amp;nbsp; After 10,000 entries in a file I close it and open a new file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have tested with 3 different USB flash drives:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; The Freescale flash drive (128MB) that was included with the 52259EVB.&amp;nbsp; This one is rock solid.&amp;nbsp; I can run for days without issues.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; PNY 16GB.&amp;nbsp; After several hours of running without issue, I just get an error that it can't open a file.&amp;nbsp; It's like the flash drive just disappeared.&amp;nbsp; No detach or anything.&amp;nbsp; Rebooting fixes it.&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; A Swissbit 300MB drive.&amp;nbsp; After several hours of running without issue, I get a DETACH mid write.&amp;nbsp; Then I get an unhandled exception because it tries to write to the file system again.&amp;nbsp; Rebooting fixes it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked stack sizes, and it doesn't look like I'm going over 50% usage in any task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas I get unstable behavior from different drives?&amp;nbsp; Is there something unique about the Freescale flash drive?&amp;nbsp; Is there any reason to try MQX 4.1?&amp;nbsp; I didn't see anything in the release notes that would suggest any MFS improvements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jul 2014 12:30:24 GMT</pubDate>
    <dc:creator>njk909</dc:creator>
    <dc:date>2014-07-17T12:30:24Z</dc:date>
    <item>
      <title>MFS behavior different for different flash drive manufacturers?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-behavior-different-for-different-flash-drive-manufacturers/m-p/321504#M10264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building an application based off the mfs_usb example in MQX 4.0.1 for the 52259evb.&amp;nbsp; My application is basically as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is crucial that I sample data every 20ms.&amp;nbsp; It is not possible to sample the data, write it to file, then flush the file in 20ms, so what I do is I have two tasks, and two buffers.&amp;nbsp; A sample task/buffer, and a write task/buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I grab data samples every 20ms, and stick them in a buffer that can hold up to 400ms worth of sample data.&amp;nbsp; After 400ms (20 sample points), I swap the pointer for the read/write buffers, and I initiate a file write of the data.&amp;nbsp; While the write is occurring, I then continue sampling data in the other task into the other buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically, every 400ms I have an fprintf() of approximatly 500 bytes followed by an fflush().&amp;nbsp; After 10,000 entries in a file I close it and open a new file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have tested with 3 different USB flash drives:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; The Freescale flash drive (128MB) that was included with the 52259EVB.&amp;nbsp; This one is rock solid.&amp;nbsp; I can run for days without issues.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; PNY 16GB.&amp;nbsp; After several hours of running without issue, I just get an error that it can't open a file.&amp;nbsp; It's like the flash drive just disappeared.&amp;nbsp; No detach or anything.&amp;nbsp; Rebooting fixes it.&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; A Swissbit 300MB drive.&amp;nbsp; After several hours of running without issue, I get a DETACH mid write.&amp;nbsp; Then I get an unhandled exception because it tries to write to the file system again.&amp;nbsp; Rebooting fixes it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked stack sizes, and it doesn't look like I'm going over 50% usage in any task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas I get unstable behavior from different drives?&amp;nbsp; Is there something unique about the Freescale flash drive?&amp;nbsp; Is there any reason to try MQX 4.1?&amp;nbsp; I didn't see anything in the release notes that would suggest any MFS improvements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 12:30:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-behavior-different-for-different-flash-drive-manufacturers/m-p/321504#M10264</guid>
      <dc:creator>njk909</dc:creator>
      <dc:date>2014-07-17T12:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: MFS behavior different for different flash drive manufacturers?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-behavior-different-for-different-flash-drive-manufacturers/m-p/321505#M10265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;USB MQX examples are based on the MSD specification; however, several USB sticks manufacturers don’t meet the specification (timing, endpoint handling, supported commands etc). Thus, when a USB stick is out of specification, the embedded file-system libraries are unable to support all the variations such as non-embedded RTOS, OS or stack/library do (like Mac-OS or MS Windows). So, it may be required adding a considerable amount of code in order to support all the variations.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;MQX developers are continuously improving the MSD Host applications, testing more USB sticks for every release and applying workarounds if necessary. However, a universal workaround for this is not possible because of the big variety of non-compliant USB sticks on the market. We are very sorry for any inconveniences this may cause.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Fri, 18 Jul 2014 14:14:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-behavior-different-for-different-flash-drive-manufacturers/m-p/321505#M10265</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2014-07-18T14:14:04Z</dc:date>
    </item>
  </channel>
</rss>

