Compile error edge board

Hello,

I am facing the following error while compiling. Does anyone have an idea? Thanks a lot.

/Arduino/libraries/SparkFun_BMI270_Arduino_Library/src/SparkFun_BMI270_Arduino_Library.cpp: In static member function 'static int8_t BMI270::readRegistersSPI(uint8_t, uint8_t*, uint32_t, BMI270_InterfaceData*)':
/Arduino/libraries/SparkFun_BMI270_Arduino_Library/src/SparkFun_BMI270_Arduino_Library.cpp:1226:5: error: 'SPI' was not declared in this scope
     SPI.beginTransaction(SPISettings(interfaceData->spiClockFrequency, MSBFIRST, SPI_MODE0));

The root cause is that EDGE does not have a SPI interface. There are 2 ways forward:

  1. change the BMI270 library and remove all the SPI references OR

  2. fool the system to make it look like there is a SPI interface.

Option 2 is easier and faster : In the apollo3 library folder (on my Ubuntu on) packages/SparkFun/hardware/apollo3/2.2.1/variants/SFE_EDGE, the file variant.h

Change lines 13 & 14 from

#define VARIANT_SPI_INTFCS  0
#define VARIANT_WIRE_INTFCS 1

to

#define VARIANT_SPI_INTFCS  1 // fake a SPI interface
#define VARIANT_SPI_SDO 1  // dummy MISO pin
#define VARIANT_SPI_CLK 1  // dummy clock pin
#define VARIANT_SPI_SDI 1  // dummy MOSI pin
#define VARIANT_WIRE_INTFCS 1  // keep the WIRE interface

Perfect, thank you so much.