Arduino Forum

Using Arduino => Storage => Topic started by: stangogh on Jan 10, 2020, 07:33 pm

Title: Cannot compile SD examples on Nano 33 Ble Sense
Post by: stangogh on Jan 10, 2020, 07:33 pm
I'm trying to compile the SD examples for the Nano 33 Ble Sense, but it fails with an error: "Multiple Libraries were found for SPI.h"

When I compile the CardInfo sketch, and select the Nano 33 Ble Sense as the board, I get the following error:

Quote
In file included from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_error.h:28:0,
                 from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/rtos/Queue.h:28,
                 from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/rtos/Mail.h:28,
                 from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/rtos/rtos.h:33,
                 from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/mbed.h:23,
                 from /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/Arduino.h:32,
                 from sketch/CardInfo.ino.cpp:1:
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_retarget.h:62:18: error: expected unqualified-id before numeric constant
 #define O_RDONLY 0        ///< Open for reading
                  ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:55:15: note: in expansion of macro 'O_RDONLY'
 uint8_t const O_RDONLY = O_READ;

               ^~~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_retarget.h:63:18: error: expected unqualified-id before numeric constant
 #define O_WRONLY 1        ///< Open for writing
                  ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:59:15: note: in expansion of macro 'O_WRONLY'
 uint8_t const O_WRONLY = O_WRITE;

               ^~~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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
                  ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:61:15: note: in expansion of macro 'O_RDWR'
 uint8_t const O_RDWR = (O_READ | O_WRITE);

               ^~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_retarget.h:62:18: error: expected unqualified-id before numeric constant
 #define O_RDONLY 0        ///< Open for reading
                  ^
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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)
                      ^~~~~~~~
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:63:15: note: in expansion of macro 'O_ACCMODE'
 uint8_t const O_ACCMODE = (O_READ | O_WRITE);

               ^~~~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_retarget.h:62:18: error: expected ')' before numeric constant
 #define O_RDONLY 0        ///< Open for reading
                  ^
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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)
                      ^~~~~~~~
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:63:15: note: in expansion of macro 'O_ACCMODE'
 uint8_t const O_ACCMODE = (O_READ | O_WRITE);

               ^~~~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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
                    ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:65:15: note: in expansion of macro 'O_APPEND'
 uint8_t const O_APPEND = 0X04;

               ^~~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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
                    ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:69:15: note: in expansion of macro 'O_CREAT'
 uint8_t const O_CREAT = 0X10;

               ^~~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/mbed/platform/mbed_retarget.h:69:20: error: expected unqualified-id before numeric constant
 #define O_EXCL     0x0800 ///< Fail if file exists
                    ^
/Applications/Arduino 3.app/Contents/Java/libraries/SD/src/utility/SdFat.h:71:15: note: in expansion of macro 'O_EXCL'
 uint8_t const O_EXCL = 0X20;

               ^~~~~~
/Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/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
                    ^
/Applications/Arduino 3.app/Contents/Java/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: /Users/danoved/Library/Arduino15/packages/arduino/hardware/mbed/1.1.3/libraries/SPI
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino
exit status 1
Error compiling for board Arduino Nano 33 BLE.
This error doesnt occur if I select ArduinoMKR1000 as the board.

An SD card would be ideal with the nano sense because you can use it to store all of the sensor data.
Title: Re: Cannot compile SD examples on Nano 33 Ble Sense
Post by: stangogh on Jan 10, 2020, 07:46 pm
Scratch that!  Updating to the latest version of the SD library fixed the issue :)
Title: Re: Cannot compile SD examples on Nano 33 Ble Sense
Post by: pert on Jan 11, 2020, 04:34 pm
Thanks for taking the time to post an update @stangogh. I'm glad to hear you got the SD library working with your Nano 33 BLE. Enjoy!