Simultaneous SDCard Access Corruption

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

Simultaneous SDCard Access Corruption

743 Views
leifzars
Contributor IV

The project is set up as follows. USB with MSC access to the SDCard device, along with MFS on top of the SDCard as well.

Now I know that it is potentially unsafe for both USB and MFS to access to the SDCard simultaneously, but in this case USB is only reading, while MFS both reads and writes. So I know of no reason why this is not acceptable.

When the board boots it starts a self test, writing a few hundred K to a file via MFS and then reading it back to validate. The writing appears to go fine, but the reading randomly fails in random ways. MFS reports no issue but the data is invalid. The odd thing is that when I attempt an immediate re read of the data (1 block of 512 bytes) it is valid. Now this only happens when Windows is scanning / reading the SDCard via USB MSC, and I verified that no writes are being issued via MSC. So as soon as a compile out the MSC support or unplug the USB cable the self test works every time with no re reading necessary.

So some portion of the SDCard driver, or sub driver is being corrupted. I am not overly familiar with this driver, so I am asking for some guidance. Anyone have an idea?

Leif

Labels (2)
0 Kudos
2 Replies

500 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Leif:

Which MQX version you are using?

Not sure what is the root cause now. But if you are using an older version, I would suggest you update to the latest version, MQX 4.2.0 and plus the patch 4.2.0.2. Because this version fixed one important MFS issue.

pastedImage_1.png

Please refer to the release note for more details.

Regards

Daniel

0 Kudos

500 Views
leifzars
Contributor IV

Yes, I am patched through 4.2.0.2

0 Kudos