Author Topic: Errors compiling projects which depend on SD.h or SPI.h  (Read 2089 times)

propeller

  • Newbie
  • *
  • Posts: 2
Errors compiling projects which depend on SD.h or SPI.h
« on: November 16, 2016, 04:06:08 pm »
I have the same issues as diginerd posted on october 13, 2015. exact the same error listing. I have copied the SD directory from github arduino 1.6.5r2 and also the arduino 1.5 version to the Programfiles(x86)/Arduino/libaries directory. Without a solution for the problem.
I use the Arduino 1.6.5 version with the digistump addional board manager.
Do I use the right directory? Have anyone a solution for me?

This is my error listing when compiling the datalogger example.
Code: [Select]

D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:27:8: error: 'SPISettings' does not name a type
 static SPISettings settings;
        ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'void Sd2Card::chipSelectHigh()':
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:167:9: error: 'class SPIClass' has no member named 'endTransaction'
     SPI.endTransaction();
         ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'void Sd2Card::chipSelectLow()':
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:176:9: error: 'class SPIClass' has no member named 'beginTransaction'
     SPI.beginTransaction(settings);
         ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:176:26: error: 'settings' was not declared in this scope
     SPI.beginTransaction(settings);
                          ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::init(uint8_t, uint8_t)':
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:269:3: error: 'settings' was not declared in this scope
   settings = SPISettings(250000, MSBFIRST, SPI_MODE0);
   ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:269:53: error: 'SPISettings' was not declared in this scope
   settings = SPISettings(250000, MSBFIRST, SPI_MODE0);
                                                     ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:275:7: error: 'class SPIClass' has no member named 'beginTransaction'
   SPI.beginTransaction(settings);
       ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:279:7: error: 'class SPIClass' has no member named 'endTransaction'
   SPI.endTransaction();
       ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp: In member function 'uint8_t Sd2Card::setSckRate(uint8_t)':
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:518:14: error: 'settings' was not declared in this scope
     case 0:  settings = SPISettings(25000000, MSBFIRST, SPI_MODE0); break;
              ^
D:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:518:66: error: 'SPISettings' was not declared in this scope
     case 0:  settings = SPISettings(25000000, MSBFIRST, SPI_MODE0); break;
                         

propeller

  • Newbie
  • *
  • Posts: 2
Re: Errors compiling projects which depend on SD.h or SPI.h
« Reply #1 on: November 18, 2016, 02:51:13 pm »
After a lot of  try and error I found that I have to copy the SPI directory from Arduino-1.6.5-r5\hardware\arduino\sam\libaries to c:\Users\user\Appdata\Roaming\Arduino15\packages\digistump\hardware\sam\1.6.7\libraries.
Hope this will help someone with the same problem.

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Errors compiling projects which depend on SD.h or SPI.h
« Reply #2 on: November 21, 2016, 03:44:18 am »
Glad you solved. I just saw your posting, and was going to say from the error I thought it was SPI related, as the SPI stuff in the Arduino IDE got an overhaul adding SPI transactions, and that was probably pre DigiX libraries.