Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: SD card issues with 3.2

  1. #1
    Junior Member
    Join Date
    Mar 2016
    Posts
    5

    SD card issues with 3.2

    When using the SD library with the 3.2, I get these errors. My application compiles great until I install Teensyduino. With just a fresh install of Arduino, it compiles fine. This is with the SDInfo example. I tried using the SDFat library, but the 3.2 seems to have an issue where it won't initialize the sd card with that library.


    Code:
    Arduino: 1.6.8 (Mac OS X), TD: 1.28-beta1, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 48 MHz, US English"
    
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:25:57: error: 'void (* SdFile::dateTime_)(uint16_t*, uint16_t*)' is not a static member of 'class SdFile'
     void (*SdFile::dateTime_)(uint16_t* date, uint16_t* time) = NULL;
    
                                                             ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:33:28: error: no 'uint8_t SdFile::addCluster()' member function declared in class 'SdFile'
     uint8_t SdFile::addCluster() {
    
                                ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:46:35: error: no 'uint8_t SdFile::addDirCluster()' member function declared in class 'SdFile'
     uint8_t SdFile::addDirCluster(void) {
    
                                       ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:61:44: error: no 'dir_t* SdFile::cacheDirEntry(uint8_t)' member function declared in class 'SdFile'
     dir_t* SdFile::cacheDirEntry(uint8_t action) {
    
                                                ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:74:27: error: no 'uint8_t SdFile::close()' member function declared in class 'SdFile'
     uint8_t SdFile::close(void) {
    
                               ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:91:71: error: no 'uint8_t SdFile::contiguousRange(uint32_t*, uint32_t*)' member function declared in class 'SdFile'
     uint8_t SdFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) {
    
                                                                           ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:130:44: error: no 'uint8_t SdFile::createContiguous(SdFile*, const char*, uint32_t)' member function declared in class 'SdFile'
             const char* fileName, uint32_t size) {
    
                                                ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:158:36: error: no 'uint8_t SdFile::dirEntry(dir_t*)' member function declared in class 'SdFile'
     uint8_t SdFile::dirEntry(dir_t* dir) {
    
                                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:178:50: error: no 'void SdFile::dirName(const dir_t&, char*)' member function declared in class 'SdFile'
     void SdFile::dirName(const dir_t& dir, char* name) {
    
                                                      ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:201:46: error: no 'void SdFile::ls(uint8_t, uint8_t)' member function declared in class 'SdFile'
     void SdFile::ls(uint8_t flags, uint8_t indent) {
    
                                                  ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:245:58: error: no 'uint8_t SdFile::make83Name(const char*, uint8_t*)' member function declared in class 'SdFile'
     uint8_t SdFile::make83Name(const char* str, uint8_t* name) {
    
                                                              ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:284:57: error: no 'uint8_t SdFile::makeDir(SdFile*, const char*)' member function declared in class 'SdFile'
     uint8_t SdFile::makeDir(SdFile* dir, const char* dirName) {
    
                                                             ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:384:74: error: no 'uint8_t SdFile::open(SdFile*, const char*, uint8_t)' member function declared in class 'SdFile'
     uint8_t SdFile::open(SdFile* dirFile, const char* fileName, uint8_t oflag) {
    
                                                                              ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:476:68: error: no 'uint8_t SdFile::open(SdFile*, uint16_t, uint8_t)' member function declared in class 'SdFile'
     uint8_t SdFile::open(SdFile* dirFile, uint16_t index, uint8_t oflag) {
    
                                                                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:502:64: error: no 'uint8_t SdFile::openCachedEntry(uint8_t, uint8_t)' member function declared in class 'SdFile'
     uint8_t SdFile::openCachedEntry(uint8_t dirIndex, uint8_t oflag) {
    
                                                                    ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:550:26: error: 'uint8_t SdFile::openRoot' is not a static member of 'class SdFile'
     uint8_t SdFile::openRoot(SdVolume* vol) {
    
                              ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:550:26: error: 'SdVolume' was not declared in this scope
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:550:36: error: 'vol' was not declared in this scope
     uint8_t SdFile::openRoot(SdVolume* vol) {
    
                                        ^
    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD/utility/SdFile.cpp:550:41: error: expected ',' or ';' before '{' token
     uint8_t SdFile::openRoot(SdVolume* vol) {
    
                                             ^
    Error compiling for board Teensy 3.2 / 3.1.
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member
    Join Date
    Jun 2014
    Posts
    245
    Looks like you're using a Teensyduino beta version, have you tried the stable 1.27?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,774
    Quote Originally Posted by bckoch View Post
    My application compiles great until I install Teensyduino. With just a fresh install of Arduino, it compiles fine. This is with the SDInfo example.
    I tried to reproduce this problem, but couldn't.

    First, I didn't see any example named "SDInfo". The SD library comes with 6 examples, named CardInfo, listfiles, ReadWrite, Datalogger, DumpFile and Files. I compiled all 6 of these without any errors, using Arduino 1.6.8 with Teensyduino 1.28-beta1.

    Here's a screenshot with all 6 error-free windows, and the About box showing the version.

    Click image for larger version. 

Name:	sc.png 
Views:	122 
Size:	774.0 KB 
ID:	6868
    (click for full size)

    I'd really like to understand what went wrong here, but I just can't manage to reproduce the problem. ALL of the SD library examples compile without error when I try it here on my Mac.

  4. #4
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    Quote Originally Posted by bckoch View Post
    I tried using the SDFat library, but the 3.2 seems to have an issue where it won't initialize the sd card with that library.
    Did you edit SdFatConfig.h? Especially line #81 #define SD_SPI_CONFIGURATION 1 .

  5. #5
    Junior Member
    Join Date
    Mar 2016
    Posts
    5
    My apologies, CardInfo is the one I was looking for. I've reinstalled everything and am still getting that same list of errors. I'll keep plugging away and see what i can figure out.

  6. #6
    Junior Member
    Join Date
    Mar 2016
    Posts
    5
    Quote Originally Posted by Epyon View Post
    Did you edit SdFatConfig.h? Especially line #81 #define SD_SPI_CONFIGURATION 1 .
    No i did not. is that a required edit for it to work? I haven't seen that documented anywhere else.

  7. #7
    Junior Member
    Join Date
    Mar 2016
    Posts
    5
    Quote Originally Posted by PaulStoffregen View Post
    I tried to reproduce this problem, but couldn't.

    First, I didn't see any example named "SDInfo". The SD library comes with 6 examples, named CardInfo, listfiles, ReadWrite, Datalogger, DumpFile and Files. I compiled all 6 of these without any errors, using Arduino 1.6.8 with Teensyduino 1.28-beta1.

    Here's a screenshot with all 6 error-free windows, and the About box showing the version.

    Click image for larger version. 

Name:	sc.png 
Views:	122 
Size:	774.0 KB 
ID:	6868
    (click for full size)

    I'd really like to understand what went wrong here, but I just can't manage to reproduce the problem. ALL of the SD library examples compile without error when I try it here on my Mac.
    For those that are running into this same issue down the road, apparently older Arduino versions had the libraries folder in Mac's Documents folder. It looks like the newer versions the libraries folder is in the arduino Applications folder. Either way, I had TWO libraries folder, and while the SD library in Applications updated, the SD library in Documents DID NOT update. When compiling, it decided to use the library from the Documents folder, thus creating an issues of using an old library.

    SO, if you run into this issue, delete the library folder from Documents, so that arduino will compile with the libraries in the app's application folder.

    Good lord that was wordy. Hope that's clearer than I feel like it is.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,774
    Yeah, it's actually supposed to be a "feature", and often it looks a lot more like a "bug", but the idea is to give you the ability to override Arduino's libraries by placing your own copy in Documents/Arduino/libraries.

    Starting with Arduino 1.6.3, I added code which at least tries to tell you if Arduino found more than one copy of the library, and which one it actually used. Before those messages, this sort of problem was almost impossible to figure out. Well, unless you turned on verbose info in File > Prefs, and then very carefully analyzed the full pathnames printed in the incredible amount of verbose info....

  9. #9
    Junior Member
    Join Date
    Mar 2016
    Posts
    5
    Quote Originally Posted by PaulStoffregen View Post
    Yeah, it's actually supposed to be a "feature", and often it looks a lot more like a "bug", but the idea is to give you the ability to override Arduino's libraries by placing your own copy in Documents/Arduino/libraries.

    Starting with Arduino 1.6.3, I added code which at least tries to tell you if Arduino found more than one copy of the library, and which one it actually used. Before those messages, this sort of problem was almost impossible to figure out. Well, unless you turned on verbose info in File > Prefs, and then very carefully analyzed the full pathnames printed in the incredible amount of verbose info....
    Your code that stated the fact that it found two libraries was actually how I finally figured it out. Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •