Problems with builtin sd card

Status
Not open for further replies.

rcmz

Member
Hello, I'm trying to make an portable music player with a teensy 3.6.

I'm having some trouble with the builtin sd card reader.
Most of the time, sd begins fails with the following errors codes :
0x24 (SD_CARD_ERROR_DMA - DMA transfer failed)
0X08 (SD_CARD_ERROR_CMD10 - Read CID data)

Sometimes, out of nowhere, it works. It seem to have a better chance of succeeding if
i try just after letting my teensy unplugged for a long time (maybe it's tired ?).

To me that sounds like a hardware / wiring problem, but I'm new to this stuff.
My teensy is soldered to an audio adaptor board and connected to a ssd1351
oled screen through a breadboard.

Here is my test code :
Code:
include <SdFat.h>

void setup() {
    Serial.begin(9600);
    while (!Serial);

    SdFat sd;
    if (!sd.begin(BUILTIN_SDCARD)) {
        sd.initErrorPrint();
    } else {
        Serial.println("success !");
    }
}

void loop() {
}

Do you have any idea of what could be going on ?
 
Are you using version 1.53?

In 1.54 we're changing SD and switching to SdFat version 2 (until very recently called SdFat-beta). Might be worthwhile to uninstall SdFat and give the 1.54-beta5 a try.

https://forum.pjrc.com/threads/64592-Teensyduino-1-54-Beta-5

Starting with 1.54-beta3, when you use SD, it's really using SdFat internally, and it's the newer SdFat. If you're starting a new project, probably best to get started on 1.54-beta5, so you don't end up building a lot of code which is likely to break with the upcoming 1.54 release.
 
Thanks for your response !
I tried with this latest version of teensyduino,
sadly it doesn't change anything :'-(
 
I ran it here with the latest beta using Teensy 3.6 and a Samsung 32 EVO Plus in the built in SD socket. Uploaded 10 times. It printed "success !" every time.
 
I've tried with one other card, same thing.
I will try with more once I get my hands on some.
 
Maybe a connection is not good.
Are there any wires between the Audioshield and the Teensy, or are you using pinheaders?
 
Well I guess I will try that tomorow.
But the internal SD is not suppose to interfere with the audio shield pins, am I correct ?
 
oh ok,
I should add that I seem to remeber that this problem was not happening a couple days ago. Could I have fried something while soldering / connecting something badly ?
 
Normally the audio shield should not have any impact on the built in SD socket on Teensy 3.6. None of the signals are shared, only power.
 
SD cards can sometimes draw a lot of current. Maybe look there? Depends on what else you have connected...
I remember I had similar problems, a long time ago. It helped to solder a 100uF cap to the Teensy 3v3+GND pins near the slot, but I'm not 100% sure if that was reason that it began working.. :)
Maybe it was just a problem with the slot and the repeated card-inserts solved it...

@Paul, yes, I wrote this.
 
Well I guess the audio shield + oled screen could be too much of a power draw.
Thanks I'll look in that direction tomorow !
 
SD cards can sometimes draw a lot of current. Maybe look there? Depends on what else you have connected...
I remember I had similar problems, a long time ago. It helped to solder a 100uF cap to the Teensy 3v3+GND pins near the slot, but I'm not 100% sure if that was reason that it began working.. :)
Maybe it was just a problem with the slot and the repeated card-inserts solved it...

@Paul, yes, I wrote this.

Actually that story rings a bell, I migh have red one of your post previously ^^
 
Status
Not open for further replies.
Back
Top