No SD cards work on new Teensy 3.2 + Audio adapter

Status
Not open for further replies.

orbitronics

Well-known member
Hi,

I'm not sure if i have a fault with the teensy hardware, but absolutely none of my SD cards work on any of the examples that want an SD card, such as the playing audio or SD card test, which just outputs 'SD card is not connected or unusable :-('.

One of the SD cards is even the recommended one on the official adapter page.

I have the cards formatted as FAT32, and the files 16 bit 44.1KHz all in the root and with capital file name and extensions.

Any ideas?
 
EDIT: the SD that worked with FAT16 was class 2, which (i think) was the reason why WAVs longer than a few seconds started having horrible artifacts. trying a class 10 sd...

Using the sd hardware test sketch, and after formatting with sdformatter:

SD Card Test
------------
SD card is connected :)
Card type is SDHC
File system space is 15552.48 Mbytes.
SD library can not access the filesystem!
Please report this problem, with the make & model of your SD card.
http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
Unable to find SDTEST1.WAV on this card



it's a Philips FM16MD45B

Same thing with a class 4 kingston card
 
Last edited:
Hey, so now you have no problem with SD card? I am doing the Audio shield tutorial from pjrc and I have sound when I upload part 1 04(Blink while playing) but when I upload part 1 05(do more while playing) Teensymonitor says it is Unable to read the SD card. The one I am using is SanDisk Ultra 16GB HC I class 1 and files are PCM 16bit 44.1kHz waves. I have installed SD library 1.0.8. Any ideas??
 
I did SD card test and everything seems to be ok

SD Card Test
------------
SD card is connected :)
Card type is SDHC
File system space is 15923.15 Mbytes.
SD library is able to access the filesystem
 
I'd recommend testing with a genuine Sandisk Ultra/Extreme or Samsung EVO or Kingston card.

Some cheap no-name and counterfeit cards actually are made with a much smaller and low quality flash chip. The card lies about its size, and may be unreliable even if you use only a small portion of its memory.

http://www.rmprepusb.com/tutorials/-fake-usb-flash-memory-drives

Thanks.

I tested with a genuine sandisk ultra, and a class 10 genuine philips SD card, along with a bunch of kingston cards. I know for a fact all except the last are definitely genuine. I'm not certain on the kingstons as i didn't buy them myself.

The solution i found was very bizarre; in the library manager i get the option to update to SD 1.1.1 IF i'm on 1.1.0, and in this state no SD cards work in ANY firmware. now if i click update or manually install 1.1.1 it updates but takes me to version 1.8.0 no matter which i choose, and only then the SD firmware works correctly. It's pretty bizarre.
 
Perhaps you're actually using Arduino's SD library, rather than the one from Teensyduino? It has no code for Teensy, but might sort-of work with low performance. Maybe?

Try adding a syntax error in your code and click Verify. Recent versions of Arduino only show duplicate library info when there's a compile error. You should see info about which SD libs it found, with the complete pathname of which one it used and the others it ignored.
 
Thank you for replying.

Yeah i saw a few times that it had duplicates (considering this is a vanilla installation, i assumed it would be using teensyduinos version). But i can't figure out if that issue i described in my last post is switching between the arduino / teensyduino libs.

on version 1.0.8 (the one that works):
Code:
Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
Multiple libraries were found for "SerialFlash.h"
 Used: C:\Users\benka\Documents\Arduino\libraries\SerialFlash
 Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash

and on 1.1.0 that doesn't work:
Code:
Multiple libraries were found for "SerialFlash.h"
 Used: C:\Users\benka\Documents\Arduino\libraries\SerialFlash
 Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash
Multiple libraries were found for "SD.h"
 Used: C:\Users\benka\Documents\Arduino\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD

So you were spot on.

The question is, how do i force use teensyduino libraries?

Edit: I updated serialFlash in the lib man from 0.4 to 0.5 and the dupe error is gone.
 
Last edited:
Simplest solution would be to delete C:\Users\benka\Documents\Arduino\libraries\SD. Or just move it somewhere else on your machine where Arduino doesn't find it.
 
Hey, so now you have no problem with SD card? I am doing the Audio shield tutorial from pjrc and I have sound when I upload part 1 04(Blink while playing) but when I upload part 1 05(do more while playing) Teensymonitor says it is Unable to read the SD card. The one I am using is SanDisk Ultra 16GB HC I class 1 and files are PCM 16bit 44.1kHz waves. I have installed SD library 1.0.8. Any ideas??

I just started learning with Teensy Audio Shield tutorial and I think there's a typo:

In Part_1_04:

Code:
  if (!(SD.begin(SDCARD_CS_PIN))) {
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }

But in Part_1_05:

Code:
  SPI.setMOSI(SDCARD_MOSI_PIN);
  SPI.setSCK(SDCARD_SCK_PIN);
  if (!(SD.begin(SDCARD_SCK_PIN))) {
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(500);
    }
  }

I changed the line if(!(SD.begin(SDCARD_SCK_PIN))) {

to if (!(SD.begin(SDCARD_CS_PIN))) { and it started working.

I do not yet know what these pins do but it seems that it's a typo.
 
Yup, it was a mistake. Originally many of the examples had just numbers. They were all edited to the names and defines to configure for different hardware. That particular example got a wrong copy-and-paste in the editing.

A fix was committed on April 29.

https://github.com/PaulStoffregen/Audio/commit/909537ca1de7f468bfd138321fe80d159bd5171d

If you install 1.37-beta you'll have the fixed version. But 1.36 was released before this fix. A final 1.37 release is a week or two away.
 
SD card issues on Teensy 3.2 with Audio Board

Simplest solution would be to delete C:\Users\benka\Documents\Arduino\libraries\SD. Or just move it somewhere else on your machine where Arduino doesn't find it.

I am trying to run the SD card test sketch that came with the Teensy after having no luck running the > Part_1_03_Playing_Music test sketch.

Error:

Unable to access SD card.

I've used a number of audio boards in the past and I know card formats are always finnicky. I am using an 8GB Sandisk Ultra. I have tried FAT32, NTFS and exFAT, all of which failed. I have an 8GB HC MicroUSB that also fails.

I'm running Win 8.1 and have no options apparently to format to FAT16. Suggestions?
 
What happens if you run File > Examples > SD > cardinfo? (remember to uncomment these lines)

Code:
  //UNCOMMENT THESE TWO LINES FOR TEENSY AUDIO BOARD:
  //SPI.setMOSI(7);  // Audio shield has MOSI on pin 7
  //SPI.setSCK(14);  // Audio shield has SCK on pin 14


That can at least help narrow down whether the SD library doesn't recognize the filesystem, or if the card itself isn't responding.
 
Well, that's where things get interesting and we go back to another issue I thought I solved. I had conflicting SD libraries, so I got rid of my regular Arduino version and kept Teensy. Now to run this test I need to bring it back. So now I get a series of errors:

CardInfo:36: error: 'SPI' does not name a type
SPI.setMOSI(7); // Audio shield has MOSI on pin 7

^

CardInfo:37: error: 'SPI' does not name a type
SPI.setSCK(14); // Audio shield has SCK on pin 14

^

Multiple libraries were found for "SD.h"
Used: C:\...Documents\Arduino\libraries\SD
Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
'SPI' does not name a type
 
Hmmm... I formatted as FAT32 using 16kb blocks and now I am seeing some success...

SD Card Test
------------
SD card is connected :)
Card type is SDHC
File system space is 7937.23 Mbytes.
SD library is able to access the filesystem

Reading SDTEST1.WAV:
Overall speed = 0.33 Mbyte/sec
Worst block time = 3.12 ms
107.64% of audio frame time

Suggestion: Teensy Audio page should be updated with some of this more detailed critical info for working with SD cards.
 
Multiple libraries were found for "SD.h"
Used: C:\...Documents\Arduino\libraries\SD
Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

This looks like a possible problem.

Arduino is using a copy of SD which you put in Documents\Arduino\libraries. The one Teensyduino installed is hardware\teensy\avr\libraries\SD.

Whatever copy of SD you installed is overriding the copy you should be using with Teensy. This is a feature of Arduino, to allow you to easily override any library. But it can turn into quite a curse if you override a library (or did this from the library manager) and then months or years later try using that lib with another board, not remembering you installed your own copy.
 
Status
Not open for further replies.
Back
Top