Teensy 3.2 Failed To Access SD Card

Status
Not open for further replies.

Forest

New member
[Solved] Teensy 3.2 Failed To Access SD Card

I'm running Paul's optimised ILI9341 Teesny library and using Teensyduino 1.25 and everything works great except for the SD card which fails to initialize. All sample sketches work, the wiring is correct and I've double checked with an Uno and another set of code to make sure it's not a hardware issue on the part of the screen or SD card. Both the screen and SD card work flawlessly with the UNO, so I'm assuming its an issue with the code somewhere.

I checked and made sure that the code was using the proper SD library (the one included with Teensyduino) so that's not it. Before I go mucking around in the code breaking stuff I was wondering if there was a quick fix.
 
Last edited:
Running the CardInfo example it says

Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card

Would this be the issue? Seems like a simple fix, weird that it wouldn't affect the Uno if that was the issue.

edit: Card is FAT32 formatted, still giving that error

edit2: changing the init line in the CardInfo to card.init(SPI_QUARTER_SPEED, chipSelect) seems to work, will see if I can use this to make the bmp draw work.

edit: now the spitftbitmap sketch works, just had to edit the begin() statement in the SPI.cpp to use quarter speed instead of half. Now to try to speed this up.
 
Last edited:
Edit SD_t3.h to turn on the experimental optimizations.

Please understand you can't write to the card at all with that turned on. But reading gets better! :)
 
Running the CardInfo example it says

Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card

Would this be the issue? Seems like a simple fix, weird that it wouldn't affect the Uno if that was the issue.

edit: Card is FAT32 formatted, still giving that error

edit2: changing the init line in the CardInfo to card.init(SPI_QUARTER_SPEED, chipSelect) seems to work, will see if I can use this to make the bmp draw work.

edit: now the spitftbitmap sketch works, just had to edit the begin() statement in the SPI.cpp to use quarter speed instead of half. Now to try to speed this up.


Any chance you meant begin() statement in SD.cpp ??
 
If the SD-Adpter you use works with the uno, it's likely that there are some level-converters on board. Those are not needed for Teensy and can introduce such problems.
 
Yup... Other than a TVS, I wouldn't have anything between the card and the MCU on the SPI bus. The TVS is optional but a good idea.
 
I changed the begin() statement in SD.cpp from HALF to QUARTER and it works fine as far as I can see. this is going into a datalogger which will be storing 50 character strings at one second intervals. so far so good. I think I'm running Teensy 3.2 at 96 mHz, but don't need the speed. on the other hand it is working.
 
Is there any reason to think that the official Teensy SD card behaves any differently than the larger Catalex Cards? it looks like your card and the bigger one use the same IC's. The specific problem I'm having is writing a filename to the card. It writes the data fine, but I need to collect files from different runs on the same card and so have to have each file have a different name.

the answer to my question could be that there should be no difference and that if I can write data to the file then I may have some other problem. I've had to recompile since I did the earlier setup a year ago. It's possible that something has been updated in one of the libraries which is causing this problem. I'm still using the SD.cpp with QUARTER rather than HALF.

I suppose I can work my up through rebuilding this part of my code.
 
The SD card we ship with the audio tutorial kit is just a Kingston 8GB card.

Maybe Kingston and Catalex (a brand I've never heard of) cards are significantly different? Maybe not. I don't know.

i found the problem - bad code. Apparently when I did this a year ago i'd fixed the problem but didn't save the repaired sketch so when i recompiled and loaded it had the old problem unfixed.

It's working fin now and your little SD card holder is just fine and I'm happy to save all the room the old one took.

it would be nice if it had a latch though.

very best,

john
 
Status
Not open for further replies.
Back
Top