Wio LTE Tracker: SD Card examples do not compile

Hello together,



when I try to compile any of the incldued SD card examples (e.g., Datalogger), I get the errors below. It seems that are two implementation of the SPI interface included which do not work together. Any idea how to fix this?



In file included from /home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/libraries/SD/SD.h:24:0,

from /home/grueni/Apps/Arduino/Sketchbook/Datalogger/Datalogger.ino:24:

/home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/libraries/SPI/SPI.h:362:17: error: conflicting declaration ‘SPIClass SPI’

extern SPIClass SPI;//(1);// dummy params



^

In file included from /home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/cores/arduino/wirish.h:49:0,

from /home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/cores/arduino/WProgram.h:27,

from /home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/cores/arduino/Arduino.h:3,

from sketch/Datalogger.ino.cpp:1:

/home/grueni/.arduino15/packages/Seeeduino/hardware/Seeed_STM32F4/1.2.5/cores/arduino/HardwareSPI.h:276:20: error: ‘SPI’ has a previous declaration as ‘HardwareSPI SPI’

extern HardwareSPI SPI;



Bye



Matthias

Hi matthias.gruenewald,



Which library are you using? I tried to replicate the error by compiling the DataLogger example code and I didn’t got any error . can you please update to the latest Arduino IDE and Library



Library link: https://github.com/Seeed-Studio/Wio_LTE_Arduino_Library

running into the same problem. The interesting thing is that I tried it on Windows where it works and tested it on a linux machine and there I run into this problem. Both installations are equal. Did someone else had the same problem?

Yes, I solved it by changing the SD library. The include “#include <SPI.h>” needs to be replaced by “#include <HardwareSPI.h>” in file SD.h.

Thanks @matthias.gruenewald this worked for me!

@matthias.gruenewald, hello
Please, can you clarify about “#include <HardwareSPI.h>”?
Where it should replace the SPI.h? There is no SPI.h inside the file SD.h.
Thank you very much in advance