PCBs Manufactured based on Fez Cerb but Micro SD socket only works on some

Hello, I’ve recently received 5 sample PCBs based on the Fez Cerb design but with only 2 of the Boards is the Micro SD socket recognised, the other 3 I get an error when trying this line of code "

", I don't know whether it's a fault with the board or whether my code could be better, I've formatted the Micro SD as FAT32 - 4KB, see photos for more. I'm hoping it's a software issue as I'll not have to send the boards back

If 2 are working ok with the same code then your code should be ok.

Yes, I suspected that, I had the board made in China but had the MCU installed with a local company, is it likely that the MCU installation maybe the issue as I can’t imagine that installing an SD Socket would be complicated

Try adding a 22 uF capacitor to right on the sd connector. And also try 0.1uF

I’m not really in a position to modify the board myself, what purpose would this serve, see attached the current schematic for SD Socket

Have you try to enhance power supply? it seems you are powering the board using USB. Try a powered USB hub or cut a usb cable to inject 5VDC from a power enough source (7805 or better as recom r78B innoline series). The cap can also do the trick, it’s a good design tip to add pads for such caps in your design .

Hi, I’ve just tried with a Powered USB hub, makes no difference, is it possible that the MCU or SD Socket were not installed correct?

all is possible… just check with an ohmeter the connection between the socket and your mcu. If all seems ok try adding capacitor

Okay, I’ve done a continuity check, all SD pins that I can access seem to be correctly connected to the associated MCU pins, the only thing I could see was that R10 which is shown as 4.7K is actually 800Ohms

As Gus said, you have don’t appear to have any supply decoupling close to the VCC and GND pins on the SD card. This is a must. Try somehow adding a 0.1uF across the VDD and GND pins close to the SD card and it should work.

@ chillydk147 - 800Ohms shouldn’t be a problem. The last option is to add capacitors… :think:

Is this not already taken care of, on another location on the Schematic there are Capacitors connected between VCC and GND, or would an extra Capacitor connected close to the SD VCC/GND pins make the difference, see attached to see what I mean

capacito should be as closed as possible of the sd slot: https://www.ghielectronics.com/community/forum/topic?id=8459

Thanks but this post link if I’m correct in thinking is referring to the importance of using a Capacitor for SD of certain classes, I get the code exception as shown earlier even without an SD Card inserted??

Tried the 0.1uf option, no luck, still the same issue

Considering you said it happens even if the card is not inserted, check the code to make sure the card detect is not being used elsewhere.

I saw this recently with touch where I was creating analog_0 for a sensor when it should have been analog_5. It caused the touch driver to fail.

What does the debug output show for this exception?

I’ve sent the troubled boards to my engineer abroad, as the code is throwing an exception at the sdCard.Mount() code call, he wants to know what exactly is happening inside the Mount method in order to help us figure out what the issue is. I’ve tried looking at this methods implementation but it’s part of a dll, I had a trial version of .Net Reflector but it’s expired now. Does anyone have any snippet of code which I can run which does what Mount() is doing, it should help me get closer to determining the root cause.

@ chillydk147 -

public void Mount()
  if (this.disposed)
	throw new ObjectDisposedException();
  if (this.mounted)
	throw new InvalidOperationException("The device is already mounted.");
  this.mounted = true;

And as you probably know, native calls = black magic :slight_smile:

Yea that looks like black magic for sure, I was hoping that it was just some setting of a Pin to Hi/Low that would latch onto the SD Card thus mounting it, for my project the SD Card will always be inserted.

I could be totally wrong here, but I think:
this.NativeMount(-1) => GHI_OSHW_Mount => FS_MountVolume