Boron program compiles locally and runs fine and very similar program for Electron compiles both locally and in cloud. But when I try to compile the Boron program in the cloud I get errors that start with:
In file included from lib/SparkIntervalTimer/src/SparkIntervalTimer.cpp:24:
lib/SparkIntervalTimer/src/SparkIntervalTimer.h:37:4: error: #error "*** PARTICLE device not supported by this library. PLATFORM should be Core or Photon ***"
37 | #error "*** PARTICLE device not supported by this library. PLATFORM should be Core or Photon ***"
| ^~~~~
lib/SparkIntervalTimer/src/SparkIntervalTimer.cpp:110:4: error: #error "*** PARTICLE device not supported by this library. PLATFORM should be Core or Photon ***"
110 | #error "*** PARTICLE device not supported by this library. PLATFORM should be Core or Photon ***"
| ^~~~~
Trying to compile Boron device with target Platform Boron and deviceOS@5.5.0
Using Particle Workbench in Visual Studio Code.
I haven't modified lib files locally or anything like that.
I did a particle Clean Application (local) with no effect.
Hints on where to look for a solution much appreciated.
john
It's a library that allows to generate precise, relatively high frequency interrupts by facilitating the hardware timers of the STM32 chips used on Gen1 and 2 of Particle devices.
Some other libraries (e.g. RGBMatrixPanel, ParticleSoftSerial, ...) use it to control their time critical tasks.
So chances are that some of the libraries your project employs use SparkIntervalTimer internally.
Thanks for the info. I don't pretend to understand the cloud compile very well but this would seem to suggest that my local libraries are compatible with Boron (i.e. do not call SparkIntervalTimer) but that the cloud based libraries are not compatible with Boron. Does that make sense?
I'm using local libraries: #include <Ubidots.h> //Ubidots 3.2.3 [verified] 247781 Ubidots library for Particle devices #include <CE_BME280.h> //CE_BME280 1.0.1 18445 Control Everything BME280 Library
I could switch the local libraries I'm using, at least the BME one, but since it's a cloud compile problem would that help?
Have you tried to run a search for SparkIntervalTimer in your project folder?
You may still have a copy of this library (or any library using it) in there that may result in this error, even when they are not used.
The compiler cannot know whether any module it finds in the project will be needed or not. Hence all present modules will be compiled just in case - if they are not, the linker will just not link them in.
For cloud compile you may also need to consider the dependencies stated in the project.properties and library.properties files.
For more targeted advice we'd need to know more about your project structure.
e.g. posting a directory tree showing all folders and files of that particular project.
Yes! I had an unused library listed in the project.properties file. When I did particle find library for that library. It returned: "ParticleSoftSerial 0.0.15 92478 Basic SoftSerial implementation (requires SparkIntervalTimer library to work)". Once I removed ParticleSoftSerial from the project.properties file the program successfully cloud compiled. Thanks a ton.
Two followup questions:
How do I keep the dependencies listed in project.properties file consistent with the libraries I have locally installed and #include in my program. I often see libraries that are either in my project and not listed in the project.properties file, or the other way around.
How do I remove a local library so that it doesn't clutter up my project? There is "Particle install library" but no "Particle remove library". Can I just delete the library from the project directory and from the project.properties file? or is there a better way.
john
Particle install library will download the sources and add dependencies.
If there is now dependencies entry in project.properties but the sources are installed in the lib folder then these sources will be uploaded to the build farm for remote building.
When you want to tweak a library to suite your particular needs, you need to disable the dependencies entry (e.g. by adding a leading # symbol as first letter in that line) so that the cloud compile doesn't use the stock sources but use your local copy instead.
To remove a library it's OK to just delete the respective subdirectory and the dependencies entry from project.properties.