I'm trying to connect an SD card for data storage to an nano 33 ble. When I try to compile code for the nano 33 ble that includes the Arduino SD libraries I get a really long error message attached. All I have in the code currently is #include the SPI and SD libraries. including just the SPI library compiles fine and compiling this code for any other arduino boards, including the other new arm based arduinos, has no problem. I have also tired using the address on my pc for the SPI and SD libraries instead of just # include but the errors remained. Has anyone else run into this problem or have an idea what it is and/or how to fix it? Here's the script I'm currently using:
#include <C:\arduino-1.8.10\hardware\arduino\avr\libraries\SPI\src\SPI.h> #include <C:\arduino-1.8.10\libraries\SD\src\SD.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
The error below is what I get when I just include <SPI.h> and <SD.h> as mentioned. I changed to include the SPI and SD library's address because the error said multiple libraries were found for SPI.h and SD.h. I only get this error if both SD.h and SPI.h are included and no errors when SPI.h alone is included. If I include the correct address for the SPI library. I get the same error as below except for the part about multiple libraries being found.
In file included from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_error.h:28:0,
from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/rtos/Queue.h:28,
from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/rtos/Mail.h:28,
from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/rtos/rtos.h:33,
from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/mbed.h:23,
from C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/Arduino.h:32,
from sketch\test_SPI.ino.cpp:1:
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:62:18: error: expected unqualified-id before numeric constant
#define O_RDONLY 0 ///< Open for reading
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:55:15: note: in expansion of macro 'O_RDONLY'
uint8_t const O_RDONLY = O_READ;
^~~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:63:18: error: expected unqualified-id before numeric constant
#define O_WRONLY 1 ///< Open for writing
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:59:15: note: in expansion of macro 'O_WRONLY'
uint8_t const O_WRONLY = O_WRITE;
^~~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:64:18: error: expected unqualified-id before numeric constant
#define O_RDWR 2 ///< Open for reading and writing
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:61:15: note: in expansion of macro 'O_RDWR'
uint8_t const O_RDWR = (O_READ | O_WRITE);
^~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:62:18: error: expected unqualified-id before numeric constant
#define O_RDONLY 0 ///< Open for reading
^
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:72:22: note: in expansion of macro 'O_RDONLY'
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
^~~~~~~~
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:63:15: note: in expansion of macro 'O_ACCMODE'
uint8_t const O_ACCMODE = (O_READ | O_WRITE);
^~~~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:62:18: error: expected ')' before numeric constant
#define O_RDONLY 0 ///< Open for reading
^
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:72:22: note: in expansion of macro 'O_RDONLY'
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
^~~~~~~~
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:63:15: note: in expansion of macro 'O_ACCMODE'
uint8_t const O_ACCMODE = (O_READ | O_WRITE);
^~~~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:66:20: error: expected unqualified-id before numeric constant
#define O_APPEND 0x0008 ///< Set file offset to end of file prior to each write
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:65:15: note: in expansion of macro 'O_APPEND'
uint8_t const O_APPEND = 0X04;
^~~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:67:20: error: expected unqualified-id before numeric constant
#define O_CREAT 0x0200 ///< Create file if it does not exist
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:69:15: note: in expansion of macro 'O_CREAT'
uint8_t const O_CREAT = 0X10;
^~~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:69:20: error: expected unqualified-id before numeric constant
#define O_EXCL 0x0800 ///< Fail if file exists
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:71:15: note: in expansion of macro 'O_EXCL'
uint8_t const O_EXCL = 0X20;
^~~~~~
C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\cores\arduino/mbed/platform/mbed_retarget.h:68:20: error: expected unqualified-id before numeric constant
#define O_TRUNC 0x0400 ///< Truncate file to zero length
^
C:\arduino-1.8.10\libraries\SD\src/utility/SdFat.h:73:15: note: in expansion of macro 'O_TRUNC'
uint8_t const O_TRUNC = 0X40;
^~~~~~~
Multiple libraries were found for "SPI.h"
Used: C:\Users\reraybon\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.2\libraries\SPI
Multiple libraries were found for "SD.h"
Used: C:\arduino-1.8.10\libraries\SD
exit status 1
Error compiling for board Arduino Nano 33 BLE.