4 Replies Latest reply on Nov 5, 2014 9:26 PM by Reach41

    Edison/Arduino Breakout Board SPI

    Reach41

      Next time you have one of the subject boards fired up, could you try compiling a sketch in the Arduino/Edison IDE that has #include "SPI.h" called?   If it doesn't sprout a lot of errors, then I'm doing something really wrong.  I have the latest images and drivers.

       

      Thanks,

       

      Gary

       

      Arduino: 1.5.3-Intel.1.0.4 (Windows 7), Board: "Intel® Edison"

       

      In file included from sketch_nov05a.ino:1:0:

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:56:3: error: 'SPDR' was not declared in this scope

         SPDR = _data;

         ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:57:12: error: 'SPSR' was not declared in this scope

         while (!(SPSR & _BV(SPIF)))

                  ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:57:23: error: 'SPIF' was not declared in this scope

         while (!(SPSR & _BV(SPIF)))

                             ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:57:27: error: '_BV' was not declared in this scope

         while (!(SPSR & _BV(SPIF)))

                                 ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:63:3: error: 'SPCR' was not declared in this scope

         SPCR |= _BV(SPIE);

         ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:63:15: error: 'SPIE' was not declared in this scope

         SPCR |= _BV(SPIE);

                     ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:63:19: error: '_BV' was not declared in this scope

         SPCR |= _BV(SPIE);

                         ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:67:3: error: 'SPCR' was not declared in this scope

         SPCR &= ~_BV(SPIE);

         ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:67:16: error: 'SPIE' was not declared in this scope

         SPCR &= ~_BV(SPIE);

                      ^

      C:\Users\Lipstick\Documents\Edison\libraries\Robot_Control/SPI.h:67:20: error: '_BV' was not declared in this scope

         SPCR &= ~_BV(SPIE);

                          ^

       

        This report would have more information with

        "Show verbose output during compilation"

        enabled in File > Preferences.

        • 1. Re: Edison/Arduino Breakout Board SPI
          KurtE

          I ran into this awhile ago.  In my case, I was doing stuff with the Adafruit_ILI9341 driver which also include Adafruit_GFX.h.   the problem sometimes with the Arduino IDE is if multiple libraries are installed, that contain the same header file, it can be pot luck on which one might be included.  In my case the Robot_Control library also contains Adafruit_GFX.h and for whatever reason it choose to install the Robot_Control library.  I believe some later versions of the IDE (don't remember if it was 1.0.6sh or 1.5.7ish) added some code that gave preference that if a library name matched a header file name that version took preference...

           

          Anyway the way I solved it was to simply delete the Robot_Control library off of my machine and then restart the IDE.

          • 2. Re: Edison/Arduino Breakout Board SPI
            Reach41

            Thanks KurtE.  I'll give that a try.

            • 3. Re: Edison/Arduino Breakout Board SPI
              Reach41

              That didn't work (left it deleted anyway), but banging around, I copied the SPI library from arduino-windows-1.0.4\arduino-1.5.3-Intel.1.0.4\hardware\arduino\edison\libraries and used it to replace the one in the libraries folder in my sketch file.  Now it compiles.  Whether it works or not is a whole other question, but at least it compiles!

              • 4. Re: Edison/Arduino Breakout Board SPI
                Reach41

                Update.  What you suggested did work, without any other action.  Simply delete the Robot_Control library, which also contains SPI library files.

                 

                Thanks again.

                1 of 1 people found this helpful