using sdio for onboard sd card with teensy 3.6

Status
Not open for further replies.

GLMc

Member
I need a simple Read/Write code for using SDIO for the card on the Teensy 3.6? I have tried the SDFat library and, per the Kickstarter note by Paul, have tried the updated SD library. None will initialize the card. Usually it is just the 0x1 and 0xFF errors indicating an SPI error. There are DISABLE_CHIPSELECT posts, USE SDIO 1 posts and many many others. Is there anywhere a simple code example that tells what library, what chipSelect, and what terminology to use. Thanks for any help... I am hopelessly confused.
 
The example here : I:\arduino-1.8.1\hardware\teensy\avr\libraries\SD\examples\CardInfo should work with the only change needed to SDIO on T_3.6 listed in the code.

// Teensy 3.5 & 3.6 on-board: BUILTIN_SDCARD
const int chipSelect = 4;

Would become :: const int chipSelect = BUILTIN_SDCARD;

That sample should then work with a properly formatted SD card. Then other samples should be helpful.

I got this message as the format is wrong:
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
 
It works.

The example here : I:\arduino-1.8.1\hardware\teensy\avr\libraries\SD\examples\CardInfo should work with the only change needed to SDIO on T_3.6 listed in the code.

Would become :: const int chipSelect = BUILTIN_SDCARD;

Thanks for the quick response... I had tried your code before and got a "not declared" error at the above line, apparently because it used the SD library in ...C:\....\arduino-1.8.1-windows\arduino-1.8.1\libraries rather than at the above location you give. I am baffled why there are multiple locations for the libraries but your directions work. Hopefully I can take it from here. You have been most helpful!!!

Gary
 
teensie's libraries are made to work for teensy with included modifications, the original libraries usually dont contain the necessary code to work with the teensie' hardware. teensyduino tries its best to make sure it defaults to teensy's libraries rather than the ones supplied by the IDE, but if it doesnt for some reason you have to correct the path
 
teensie's libraries are made to work for teensy with included modifications, the original libraries usually dont contain the necessary code to work with the teensie' hardware. teensyduino tries its best to make sure it defaults to teensy's libraries rather than the ones supplied by the IDE, but if it doesnt for some reason you have to correct the path

Interesting... I am relatively new to the teensy and as you can see there is a lot to learn. Thanks!
 
:) Glad it worked! That was the full path to my install - I should have truncated the start 'install path'.

Do you have multiple installs? That update to allow BUILTIN_SDCARD for SDIO usage is relatively new so maybe it was using an older TeensyDuino install.
 
Arduino gives you the ability to override any library by putting a copy into your sketchbook libraries folder. That's really convenient when you need to install a specific version, or if you want to make your own edits to a library, because the sketchbook folder (which defaults to Documents/Arduino on Windows & Mac) remains intact each time you reinstall newer versions of Arduino.

But it's a powerful feature that gives you enough rope to hang yourself. It's easy to forget you put a copy of some library there months or years ago, especially if it's always worked with other boards.

About a year ago I contributed code to Arduino to print a message about duplicate libraries. Only a few months ago, they changed it to only print in non-verbose mode if compilation fails. I've asked to restore it, and just begged them again to reconsider. Since that contribution, they've reimplemented part of Arduino as a separate program in Go language.... and that's one part Teensyduino doesn't (yet) patch. I'm really hoping to not have to modify that part too...
 
:)

Do you have multiple installs? That update to allow BUILTIN_SDCARD for SDIO usage is relatively new so maybe it was using an older TeensyDuino install.

Yes, I had been using a 3.2 with IDE 1.6.xx and the 3.6 did not like that, so I did a new install of 1.8.11 and teensyduino. I should clear out all the old programs and make a clean start but have everything working and have a couple of devices I need to deliver so keep putting it off. Me??? Ha.
 
Paul, that is where my libraries normally reside. If I had copied the SD folder from the hardware link that defragster used to solve my problem, it should have worked as I first tried it. Regardless, for my application the teensy 3.6 is beyond awesome. I need to record tire data for ~20 min and I can now mount it in the sensor plate, then record both to memory and SD, so redundant. ;):)
 
Status
Not open for further replies.
Back
Top