Welcome! Log In Create A New Profile

Advanced

SD Ramps won't read cards

Posted by ambiguousphoton 
SD Ramps won't read cards
April 28, 2012 07:33PM
Hi Everyone,
I bought SD Ramps from Ultimachine for my Ramps 1.4 electronics. I bought a 8 gb san disk card that I would like to use but I am having issues going through this tutorial:
[reprap.org]

It is all soldered okay but when I upload the sample code and just have the sd ramps plugged into the mega 2560, the console in arduino software just displays garbage. The SD ramps card goes green when I insert the card. I have tried formatting the card as fat 32 on a mac and in windows xp, to no avail. It doesn't seem to help even when I format it as fat 16. You often will see the garbage display before inserting the card. Could anyone help me out?

As a sanity check, do you plug the SD ramps into the ground connection (last two holes on the right header) or are you plugging it into holes 42-53?

Thanks so much!

EDIT: Garbage was filling the screen because the baud rate in the console was different from program. Now I actually receive text! The problem is that it says the initialization of the sd ramps has failed.

Edited 4 time(s). Last edit at 04/30/2012 09:51PM by ambiguousphoton.
Re: SD Ramps won't read cards
April 28, 2012 10:45PM
It may not be able to read your 8GB card. Use a 2GB card or lower.
Re: SD Ramps won't read cards
April 29, 2012 12:16AM
Thanks for your response. When you run the sd card program would I expect to get this error if the reader is installed right but it is just missing a sd card?


initialization failed. Things to check:
* is a card is inserted?
* Is your wiring correct?
* did you change the chipSelect pin to match your shield or module?

I would think that if the sd ramps was working properly, I wouldn't get this error immediately I just wouldn't be able to read from the card once inserted.
Re: SD Ramps won't read cards [Solved]
April 29, 2012 10:53AM
Okay, I have it working great now! Here is what I figured out:

Test it out on the Arduino board by itself first. Make sure when plugging it in that the bottom two pins go into the ground pins on the right header. To elaborate further, plug it into pins 44-53 and the two ground ones.

Formatting the card is really important. There are instructions on how to do it for a mac here:
[forums.adafruit.com]

1) Open Terminal in OS X
2) Type: diskutil list
3) Figure out which drive is your SD card. Here is what mine looks like:

/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *160.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 159.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.9 GB disk1
1: DOS_FAT_32 SJ 7.9 GB disk1s1

Here my primary drive is disk0. My SD card is disk1 and the primary partition on that disk is 1.

4) Open Disk Utility from the Utilities folder, find your SD card on the left and unmounts it by pressing the button at the top.
5) In my case to format the sd card I type: newfs_msdos -F 16 /dev/disk1s1. You need to change disk1s1 to whatever disk and partition you want to format. You can seriously mess up your computer if you format the wrong partition.
6) Open Disk Utility again and verify your disk.

Unfortunately this doesn’t seem to work! Formatting it in Windows works a lot better:

1) Figure out what drive the SD card is.
2) Open Command Prompt and type: format E:/FS:FAT16 where E: is your SD card.

This will now work if you plug it into your SD ramps. The only issue is you might see a ton of files when it detects the card. I deleted them in OS X but you could probably do it in Windows too:

1) In Terminal navigate to the SD card and type ls –a
2) Disable spotlight indexing by adding a file: touch .metadata_never_index
3) Remove all files (rm command) including .Trashes, .fseventsd, .Spotlight-V100
You should see a sparkling clean sd card when you put it in the SD ramps now!
Re: SD Ramps won't read cards [Solved]
April 30, 2012 09:51PM
Unfortunately, even though I can read SD cards using the sdrampstest program perfectly, when I load up marlin I get the error: echo: SD init fail
This occurs when calling the M21 command. Has anyone run into this?

Edited 1 time(s). Last edit at 04/30/2012 09:52PM by ambiguousphoton.
Re: SD Ramps won't read cards [Solved]
June 28, 2012 03:38AM
Ambiguousphoton did you get this to work?
Re: SD Ramps won't read cards
July 01, 2012 12:28PM
Bumping this because.my sdramps also works in sdrampstest, but fails to initialize in both Marlin and Repetier.
What's bizarre about this is it was working, I pulled the sdcard copied a file to it, plugged it back into the sdramps and since then it fails to initialize.
As I mentioned above I can run the card and it passes and lists files using sdrampstest, load marlin or repetier on that arduino and they will not initialize the sdramps.

Where would I start even trying to debug this? I looked at the code and the test uses the arduino sdcard library Marlin doesn't, so it's difficult to identify the difference.
Re: SD Ramps won't read cards
July 01, 2012 03:32PM
OK this appears to be a issue in the Marlin and I guess Repetier RAMPS setup when plugging directly into the Arduino.
The RAMPS1.3/1.4 configuration doesn't define the SDPOWER pin in pins.h, the connector on the RAMPS1.4 is supposed to have 5V pin where pin 48 would be, so this should not be an issue with the ramps board connected.
My best guess is I have a bad solder connection on the RAMPS board, need to pull it off and check.

There also appears to be an issue in the Marlin SDCard code, the init fails the first time because it seems that trying to read SPIO immediately after setting chipselect low causes an issue where SPIO never returns not busy, I just added a delay(1) after setting chipselect.

Edited 1 time(s). Last edit at 07/01/2012 04:15PM by Polygonhell.
Re: SD Ramps won't read cards
July 10, 2012 11:41PM
Hey guys!
Unfortunately, I did not. Do you guys think that there is an issue with my specific SD card? I could try buying a new one but it would be unfortunate if it didn't work. I haven't updated my Marlin software in a few months, I can try updating that and see if that does anything.

Polygonhell, are you saying that it should work if I rewrite the pin definitions in Marlin or is it something more complicated?

Thanks!
Re: SD Ramps won't read cards
July 10, 2012 11:49PM
Only one of the 6 sdcards I have here works with my SDRAMPS, none of the Kingston cards work, and that is noted on the wiki.
The one working one I have here is a SanDisk 4GB.
If you can read the card in the test app, there should be no issue in the firmware as long as the pins are set correctly in the firmware.

My issue was a bad solder connection on the sdramps connector (bad soldering by me).
I'd start by checking the solder connections on both the ramps board and the connector on the ramps board itself.

I assume you are plugging the sdramps into a ramps board when testing with Marlin?
As I noted above Marlin will not read the card if the sdramps is plugged into the arduino directly.

Edited 2 time(s). Last edit at 07/10/2012 11:58PM by Polygonhell.
Sorry, only registered users may post in this forum.

Click here to login