Arduino code not compiling for artemis module, does compile for RedBoard

Has anyone had issues with code not compiling in the arduino IDE for the artemis module specifically? Strangely, the same code compiles just fine for the RedBoard. Error readout attached. I’ve replaced the username in the filepath with ~. It seems to take issue with the SPI library.

[/In file included from /Users/~/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.h:10,
                 from /Users/~/Documents/Arduino/libraries/Adafruit_FXOS8700/Adafruit_FXOS8700.h:24,
                 from /Users/~/Documents/Arduino/libraries/Adafruit_FXOS8700/examples/sensorapi/sensorapi.ino:1:
/Users/~/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.h:70:72: error: 'SPI' was not declared in this scope
                      uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
                                                                        ^~~
/Users/~/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.h:70:72: note: suggested alternative:
In file included from /Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/mbed.h:65,
                 from /Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/Arduino.h:14,
                 from /Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/sdk/ArduinoSDK.h:9,
                 from <command-line>:
/Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/drivers/SPI.h:98:7: note:   'mbed::SPI'
 class SPI : private NonCopyable<SPI> {
       ^~~
Using library Adafruit_FXOS8700 at version 2.2.0 in folder: /Users/~/Documents/Arduino/libraries/Adafruit_FXOS8700 
Using library Adafruit_BusIO at version 1.10.0 in folder: /Users/~/Documents/Arduino/libraries/Adafruit_BusIO 
Using library Wire at version 2.0.0 in folder: /Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/libraries/Wire 
Using library SPI at version 2.0.0 in folder: /Users/~/Documents/MATLAB/SupportPackages/R2020b/3P.instrset/arduinoide.instrset/idepkgs/packages/SparkFun/hardware/apollo3/2.2.1/libraries/SPI 
Using library Adafruit_Unified_Sensor at version 1.1.5 in folder: /Users/~/Documents/Arduino/libraries/Adafruit_Unified_Sensor 
exit status 1
Error compiling for board Artemis Module.]

Thank you!

In the variants.h for the SKE_ARTEMIS_MODULE it is defined that it has NO SPI interface : #define VARIANT_SPI_INTFCS 0 (line 13). Hence it will not create an instance for SPI.

Thanks Paul. Why does this compile for the artemis module on the redboard?

Because in the variant.h file for SFE_ARTEMIS variant, the variable VARIANT_SPI_INTFCS is defined as 1 ( also line 13). Most of the boards have their own variant definition.

paulvha:
Because in the variant.h file for SFE_ARTEMIS variant, the variable VARIANT_SPI_INTFCS is defined as 1 ( also line 13). Most of the boards have their own variant definition.

Thanks, Paul. I’m not very familiar with varian definitions. Is there a work around for this?

Try this :

In the library variants/SKE_ARTEMIS_MODULE folder, in file variants.h, change #define VARIANT_SPI_INTFCS 0 to #define VARIANT_SPI_INTFCS 1 (line 13). An instance will now be created, but you are not using that anyway…

Hello,

Is the artemis board compatible with being programmed in Matlab? I haven’t had an issue with my uno redboard, but i cannot seem to program the board in Matlab with my artemis board. Please advise.

Thank you,

Emily