Electron 1.5.1.rc-1 and AssetTrackerV2: error LIS3DH

After spending the weekend trying to flash the AssetTrackerV2 with 1.5.1.rc-1 without being able to compile due to LIS3DH errors, I accidentally rolled back to 1.4.2 and it worked. It worked all the way up to 1.5.0.rc.1but seems to be broken when it comes to 1.5.1. Seems to be an SPI error…

Could you share a link to your code so that I can test it? Feel free to DM/create a ticket if you don’t want the code public.

For the sake of demonstration I started a New Project and imported the AssetTrackerRK library. As a test I copied the 1_SimpleGPS example (although all the examples do this) into the test.ino file and ‘configured for device’ 1.5.1.rc-1 on an Electron (and I tried Boron).

The result is:

/Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/AssetTrackerRK/src/AssetTrackerRK.cpp:23:36: error: no matching function for call to 'LIS3DHSPI::LIS3DHSPI(particle::SpiProxy<(HAL_SPI_Interface)0u>&, int, int)'
 static LIS3DHSPI accel(SPI, A2, WKP);
                                    ^
In file included from /Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/AssetTrackerRK/src/AssetTrackerRK.h:6:0,
                 from /Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/AssetTrackerRK/src/AssetTrackerRK.cpp:4:
/Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/LIS3DH/src/LIS3DH.h:402:2: note: candidate: LIS3DHSPI::LIS3DHSPI(SPIClass&, int, int)
  LIS3DHSPI(SPIClass &spi, int ss = A2, int intPin = -1);
  ^
/Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/LIS3DH/src/LIS3DH.h:402:2: note:   no known conversion for argument 1 from 'particle::SpiProxy<(HAL_SPI_Interface)0u>' to 'SPIClass&'
/Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/LIS3DH/src/LIS3DH.h:393:7: note: candidate: constexpr LIS3DHSPI::LIS3DHSPI(const LIS3DHSPI&)
 class LIS3DHSPI : public LIS3DH {
       ^
/Users/philipchatterton/IoCP/Particle/Fred_Hub_Boron/test/lib/LIS3DH/src/LIS3DH.h:393:7: note:   candidate expects 1 argument, 3 provided
make[3]: *** [../build/target/user/platform-10-m/test/AssetTrackerRK/src/AssetTrackerRK.o] Error 1
make[2]: *** [user] Error 2
make[1]: *** [/Users/philipchatterton/.particle/toolchains/deviceOS/1.5.1-rc.1/modules/electron/user-part/makefile] Error 2
make: *** [compile-all] Error 2
The terminal process terminated with exit code: 2

The LIS3DH.h is installed so it’s not that. When. I configure for 1.5 or earlier it worked as always…

Thanks for the response,
philly

All libraries that use SpiClass as a way to generically specify any SPI interface will need to be modified to work with 1.5.1-rc.1 and later. The current version of LIS3DH (0.2.6) does not have this modification.

Fixed.

AssetTrackerRK 0.3.5

  • Update to LIS3DH 0.2.8 to fix compiler error for undefined conversion to SpiClass with 1.5.1-rc.1.

LIS3DH 0.2.8

  • Fix compiler error for undefined conversion to SpiClass with 1.5.1-rc.1.

Can this be considered a breaking change?

It does potentially break numerous libraries and existing projects.
Will Particle update the libraries contributed by other individuals that might not be thrilled to keep chasing after eventual changes like this?

e.g. SdFat is affected and is used in many other libraries. So even if SdFat was to be updated, all dependent libraries would need to pull in that new version (whenever it would happen to be released)

1 Like

I reinstalled the AssetTrackerRK 0.3.5 library and switched to 1.5.1.rc-1 and it worked! It compiled with warnings re: TinyGPS++ but it compiled non the less.

Brilliant – thanks

2 Likes