Supported MicroSD card for M2

I have tried to use a 32GB micro SD card and tried to write something into a file (based on DataLogger_dif). After opening the serial console, I see the following message:

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.

Anyone tried using SD card? It would be great if you can send me the link.

Have you made sure it is formatted as Fat32? NTFS won’t read on many systems…

Thanks for your reply. It seems the card slot of M2 UTD is not working. I have tested the SD card with another M2 UTH. I want to exchange now.

@albal13 - sorry to hear you are having trouble with SD card. Did you try reformatting to FAT32?

We’d suggest using this software to reformat:

For reference, we test every single M2 before it ships and this includes reading and writing to an SD several times.

Our test rig uses a 16GB Lexar-branded MicroSD card.

Just to double check, I ran that same “DataLogger_dif” example sketch. Here is serial terminal capture:

MS: SD card detected!
Capacity: 0
MS: Bus clock: 128
MS: Bus width: 1
MS: Card type: SDHC
FS: File created.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.
FS: File opened.
FS: File closed.

and here is what shows up in the “data” file on the SD:

i= 1
i= 2
i= 3
i= 4
i= 5
i= 6
i= 7
i= 8
i= 9

Thanks for your reference. I did reformatting FAT32 in Windows 7 and ran the program again. It did not work.

I will try using reformatting using the software mentioned. I am just wondering why it would work perfectly in M2 UTH but not in M2 UTD.

Interesting, I may have misunderstood then! You are saying SD works on one M2 but not the other?

If that is the case, we’ll want to capture that unit to investigate since there is no difference in SD circuitry between UTH and UTD. I’ll send you a PM for instructions on how we can swap it out for you.

Thank you. I tried reformatting the SD card with the software and it did not work. I am wondering if it is due to the size of SD card. But Arduino Duo should support any SD card less or equal to 64GB.

I am confused again - were you able to get the SD card to work on either M2 (UTH or UTD)? If so, please tell us more about the SD card that DID work and we can go from there.

Sorry for my typos. SD card works perfectly in M2 UTH. But SD card does not work in M2 UTD. I use SanDisk Ultra 32GB microSDHC UHS-I Card (

I think the card slot in M2 UTD is malfunctioning. For my project, I need to save all data to SD card.

OK, right on - we’ll swap out the defective UTD right away.

Regarding the separate issue of maximum capacity that the HSMCI library can handle, we’ll need to dive in deeper to see how library works. Anyone out there an expert on the subject?

It is possible that the library is only compatible with “microSDHC” (and not “SDXC”) cards which have a maximum capacity of 32GB. microSDXC capacities go up to 2TB !

Above solution is valid:

  • use 32Gb or under card
  • use official SD flasher
  • official SD flasher will reformat card to ExFAT32
  • SDXC cards don’t work (I attempted as much with 64Gb card, and it was little more than a brick)