SD card io error from netmf when card used in PC

Now for a couple of times I discovered the following behavior and wonder if others have seen this too.

I have a NETMF application using SD card to access files for read and write. I think the following steps best describe what and when the io errors happen.

  1. Format SD card on PC
  2. Copy all necessary files used by the NETMF application to the SD card
  3. Insert SD card in NETMF device and run the application.
    Everything fine so far… The NETMF application has read and written to SD card in the meantime
  4. Shut down application and remove SD card
  5. Place SD card in PC card reader
  6. Copy new files to SD card
  7. Remove SD card from PC and insert the card in the NETMF device and start NETMF device
  8. The NETMF application tries to access (streamreader) the newly copied files
    Any access to the newly copied file result in a NETMF IO exception
  9. Move again SD card from NETMF device to PC
  10. Run ChkDsk… (No errors)
  11. Copy all Files from SD card to a temporary folder on PC
  12. Format SD Card
  13. Copy all files back
  14. Move SD card from PC to NETMF device.
    Everything runs fine again.

So it seems that the problem shows up after the netmf device has written to the SD card and after that files are copied to the SD card on the PC

@ RobvanSchelven - Have you tried this a few times? What board did you use? Did you try different SD cards?

@ John - discovered this on a custom G120 board as well as on a Cobra II, i used physically different sd cards, one Sandisk Ultra uSD 8GB and one Sandisk Extreme Pro SD card 8GB. I need to setup a test and write a small test example tring to reproduce it

@ RobvanSchelven - As soon as you do let us know and we’ll take a look.

@ John - Sure…

btw here’s a line from a log file:
02/02/2016 10:37:04,2,Exception Message: Exception was thrown: System.IO.IOException StackTrace: Microsoft.SPOT.IO.NativeFileStream::ReadSystem.IO.FileStream::ReadSCII.VS1053B::StreamMusicFile~~, Related to music file: \SD\Media\Cheb Mami - Desert Rose.mp3 IOErrorCode: -536870912

This error code means: “Others = unchecked((int)0xE0000000), // CLR_E_FILE_IO” whatever Others might mean :frowning: