Problem with M2 and SD Card


MS: Cannot initialize the SD card: MS: Card is unusable, try another one
FS: Can’t open 0:/data to write, error code 12
FS: Attempt to write string to a non-open file.
FS: Attempt to close a non-open file.

Trying to use DataLogger_dif. Builds and loads fine but this is the error that I get. I’ve re-formatted the card per the tool specified on your forum. But still doesn’t work. Help please.


What size is this sdcard?


I tried with a 16 and a 32 gig.


If you have a card available that is less than 4gig try it… The format on a <4gig card is different than a 4gig or bigger card and some devices have trouble taking to them. Atleast take that out of the equation.



Works with a 4gig card. Is this working as expected? Doesn’t seem very current to have such a small size limitation.


You can look for an Arduino Due library that supports larger cards. A 3 second google search shows that you need to insure the card is Fat32 and it SHOULD support up to 32gig of storage. It is a standard Arduino Due SDCard setup and library if I am not mistaken. I have not tried to use it yet.

Above 32gig and the sdcard uses a different technology but it looks like there are libraries out for them too if needed.



Yeah, like Rod said, the limitation is that you need FAT32 formatting. Newer/larger cards are likely to be formatted with exFAT which is a newer formatting type and supports larger sizes. But, up to a certain size you should be able to reformat as FAT32 and be OK. We probably should investigate options to support the newer systems but Microsoft likes to patent their file systems so exfat isn’t so likely to be supported by free and open source drivers. Thus, your best bet really is to stick with 16GB cards and smaller. This is still quite a bit of space for a little embedded processor to use.


I will check my 16 gig cards to make sure they are FAT32. Thanks for everyone’s help.


Just did a little test. On my Mac, I checked the format of a 16gig card and it said it was FAT32. However, the cataloguer sketch distributed with M2 didn’t like it. Same error as before. Still works with a 4 gig card, of course. Will look for another library as previously suggested.


Hey dshield09, I am curious if you ever resolved your problem with large cards? If so, how?