MFS behavior different for different flash drive manufacturers?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MFS behavior different for different flash drive manufacturers?

Jump to solution
554 Views
njk909
Contributor II

I am building an application based off the mfs_usb example in MQX 4.0.1 for the 52259evb.  My application is basically as follows:

It is crucial that I sample data every 20ms.  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.  A sample task/buffer, and a write task/buffer.

I grab data samples every 20ms, and stick them in a buffer that can hold up to 400ms worth of sample data.  After 400ms (20 sample points), I swap the pointer for the read/write buffers, and I initiate a file write of the data.  While the write is occurring, I then continue sampling data in the other task into the other buffer.

So basically, every 400ms I have an fprintf() of approximatly 500 bytes followed by an fflush().  After 10,000 entries in a file I close it and open a new file.

So far I have tested with 3 different USB flash drives:

1)  The Freescale flash drive (128MB) that was included with the 52259EVB.  This one is rock solid.  I can run for days without issues.

2)  PNY 16GB.  After several hours of running without issue, I just get an error that it can't open a file.  It's like the flash drive just disappeared.  No detach or anything.  Rebooting fixes it.

3)  A Swissbit 300MB drive.  After several hours of running without issue, I get a DETACH mid write.  Then I get an unhandled exception because it tries to write to the file system again.  Rebooting fixes it.

I've checked stack sizes, and it doesn't look like I'm going over 50% usage in any task.

Any ideas I get unstable behavior from different drives?  Is there something unique about the Freescale flash drive?  Is there any reason to try MQX 4.1?  I didn't see anything in the release notes that would suggest any MFS improvements.

Labels (2)
0 Kudos
Reply
1 Solution
416 Views
soledad
NXP Employee
NXP Employee

Hi Nathan,

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.

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.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
417 Views
soledad
NXP Employee
NXP Employee

Hi Nathan,

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.

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.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply