Forum Rule: Always post complete source code & details to reproduce any issue!
-
Junior Member
Problems with builtin sd card
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 ?
-
Senior Member
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...no-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.
-
Junior Member
Thanks for your response !
I tried with this latest version of teensyduino,
sadly it doesn't change anything :'-(
-
Senior Member+
Have you tried other cards?
-
Senior Member
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.
-
Junior Member
I've tried with one other card, same thing.
I will try with more once I get my hands on some.
-
Senior Member+
Maybe a connection is not good.
Are there any wires between the Audioshield and the Teensy, or are you using pinheaders?
-
Junior Member
The audio shield is connected using pinheaders, but I haven't soldered every pin.
-
Junior Member

Originally Posted by
PaulStoffregen
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.
Well I gess that's good news !
-
Senior Member+
You should solder at least the needed pins (for the Audiochip and SD, GND and so on..)
-
Junior Member
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 ?
-
Senior Member+
Ah, of course..you're using a Teensy with inbuilt slot. No, in this case it is not needed.
-
Junior Member
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 ?
-
Senior Member
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.
-
Senior Member+
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.
-
Junior Member
Well I guess the audio shield + oled screen could be too much of a power draw.
Thanks I'll look in that direction tomorow !
-
Junior Member

Originally Posted by
Frank B
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 ^^
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules