sd card trouble

10 Feb 2011

Hi, I'm brand new to mbed...this is only my second day using it. I'm coming from about a year using arduinos...so anyway...I'm trying to get my sd card to work and I'm having no luck. Hopefully it's just something stupid I'm missing here.... I get this in my serial monitor (along with blinking LEDs on mbed:: Hello World! No disk, or could not put SD card in to SPI idle state Didn't get a response from the disk Set 512-byte block timed out Could not open file for write

Here is a pic of how I have it set up: http://dl.dropbox.com/u/7072449/2011-02-10%2011.01.23.jpg

Here is the breakout board I bought: http://www.sparkfun.com/products/544

and I used this tutorial..wiring it up just as they say...importing that program right at the top and copying it to the mbed: http://mbed.org/cookbook/SD-Card-File-System

I've used two microSDs...both formatted FAT...one is from sanDisk, 1gig, and the other is from radio shack..just says MicroSD HC on it and it's 4gigs...

Thanks so much for any advice!

11 Feb 2011

I'm not 100% sure your hookup is correct, but when I was working with SD cards I had much much better success with this SDHC card library than the 'standard' mbed one in that tutorial. http://mbed.org/users/xxll/programs/SDHCFileSystem/5zdtq

Give that library a try and see if it works better.

Tim

11 Feb 2011

Hi thanks for the help! Unfortunately that library didn't work for me either...I get: "No disk, or could not put SD card in to SPI idle state init card = 0" in my terminal. Shoot. Anyone else have any other ideas? I double and triple checked my pin set up. I am using the same one as shown on the tutorial here: http://mbed.org/cookbook/SD-Card-File-System which is: CS to 8 (DigitalOut cs) DI to 5 (SPI mosi) VCC to VOUT SCK to 7 (SPI sclk) GND to GND DO to 6 (SPI miso) CD (i do nothing here)

The VCC I had plugged into VU 5v(instead of VOUT), before...could I have fried something? Thanks for any help!

11 Feb 2011

I guess its a possibility that something is fried. I googled around and it seems neither SDCards nor the SPI bus are 5v tolerant, but in my experience the mbed has been quite forgiving of my mistakes.

Also, that first library will almost certainly not work with the 4GB card, but it should support the 1gb card. The library I referenced worked perfectly up to 16gb when I tested it...

Assuming the hookup is correct (which it appears so) and that the pins called out when you declare the object are correct (based on your wiring they should be p5, p6, p7, p8) then maybe you might want to try the other SPI port. I dont know if they are tied together internally causing 5v on one to blow them both but its worth a shot. Change your wiring to p11, p12, p13, p14 and rewire on to those pins. Also if you had another sdcard to swap while in running the correct voltage to see if that gives you any success.

Tim

11 Jun 2014

Thanks a lot dude

I wasted more than a day using 4GB Card And Finally succeed with 1GB Thx

11 Jun 2014

The information in this post is out of date. The standard mbed library does support larger cards now.

Some of the mbed boards can't supply much power on the 3.3V output. (e.g. the C027). If the power supply is right on the limit you will get errors with larger or faster SD cards but small slow ones can still work, this can be either card not present errors or at times file system corruption.

11 Jun 2014

i m using FRDM_KL25Z integrated with FXS Multi B which has MicroSD Connector with that connector i tried 4GB which was not working while with 1GB its fine and smooth

11 Jun 2014

Unfortunately, not all brands of SD cards work with SDFileSystem. I have a 1G, 4G and 16G that work, but a different brand of 4G and 8G that do not.

I have had a lot of success with Patriot brand SD cards.

...kevin

16 Jul 2014

Hi All, Ive been gettin the same errors with SanDisk 1 gb SD card. Im currently wired to pins : p5, p6, p7, p8. Any thoughts or ideas I could get a response from the disk?

thanks!

17 Sep 2014

What often is overlooked that some commands on SD Cards only work after physical power-on the card. I had major headaches debugging SD Card apps until I introduced a P-Channel MOSFET for making the card power switchable by software. When starting my programs I briefly switch off power to the card and wait a few ms and then re-enable it. That solves basically all debugger-introduced problems leaving the card in some undefined state whilst debugging.

I would suggest expanding the standard SDFile lib with ability to deal with such a power switch and the card detect contact some sockets offer.

RR4711

27 May 2015

I have a project that it need data store in µSD. the platform used is the C027. and the first command send by the µC is good, but tried to end the initialization of the SD always receive this mode IDLE. This is possible because the voltege suply in the pin 3.3V of this platform can't supply much power.

Andy A wrote:

The information in this post is out of date. The standard mbed library does support larger cards now.

Some of the mbed boards can't supply much power on the 3.3V output. (e.g. the C027). If the power supply is right on the limit you will get errors with larger or faster SD cards but small slow ones can still work, this can be either card not present errors or at times file system corruption.

27 May 2015

I powered the μSD with an external power supply. and it has effectively run everything correctly

Víctor Najarro wrote:

I have a project that it need data store in µSD. the platform used is the C027. and the first command send by the µC is good, but tried to end the initialization of the SD always receive this mode IDLE. This is possible because the voltege suply in the pin 3.3V of this platform can't supply much power.

27 May 2015

I powered the μSD with an external power supply. and it has effectively run everything correctly

Víctor Najarro wrote:

I have a project that it need data store in µSD. the platform used is the C027. and the first command send by the µC is good, but tried to end the initialization of the SD always receive this mode IDLE. This is possible because the voltege suply in the pin 3.3V of this platform can't supply much power.

02 Jun 2015

Víctor Najarro wrote:

I have a project that it need data store in µSD. the platform used is the C027. and the first command send by the µC is good, but tried to end the initialization of the SD always receive this mode IDLE. This is possible because the voltege suply in the pin 3.3V of this platform can't supply much power.

Andy A wrote:

The information in this post is out of date. The standard mbed library does support larger cards now.

Some of the mbed boards can't supply much power on the 3.3V output. (e.g. the C027). If the power supply is right on the limit you will get errors with larger or faster SD cards but small slow ones can still work, this can be either card not present errors or at times file system corruption.

After making that post I found the root cause, there is a series resistor on the 3.3V pin. If you replace R21 (located between the 3.3V and 5V output pads) with a 0 ohm resistor then you can power an SD card without needing an external source.

17 May 2018

?

17 May 2018

Could anyone finally find a solution to this problem? Any updates on this issue with respect to the recent Mbed library updates ?

13 Jul 2018

Hi Achyutha,

This post has covered too much ground and is too old to know what you are referring to. Please create a new post describing the problem you are having with as much information as possible (i.e., platform you are using, build environment and other pertinent facts).

Thank You,

Ralph, Team Mbed

Please log in to post a reply.