and getting the compilation error below. I’m using Particle Dev. Should I somehow configure Particle Dev to target a particular firmware version ? When using Particle Build (on the web), my device does say 0.4.7.
/tmp/cccIxLwD.ltrans20.ltrans.o: In function Timer::invoke_timer(void*) [clone .local.178]': /mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/../wiring/inc/spark_wiring_timer.h:91: undefined reference toos_timer_get_id’
/tmp/cccIxLwD.ltrans20.ltrans.o: In function Timer::dispose() [clone .isra.2]': /mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/../wiring/inc/spark_wiring_timer.h:68: undefined reference toos_timer_destroy’
/tmp/cccIxLwD.ltrans5.ltrans.o: In function Timer::stop(bool) [clone .isra.3]': /mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/../wiring/inc/spark_wiring_timer.h:56: undefined reference toos_timer_change’
/tmp/cccIxLwD.ltrans5.ltrans.o: In function start': /mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/../wiring/inc/spark_wiring_timer.h:50: undefined reference toos_timer_change’
/tmp/cccIxLwD.ltrans21.ltrans.o: In function __base_ctor ': /mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/../wiring/inc/spark_wiring_timer.h:35: undefined reference toos_timer_create’
/mnt/compile-service-shared-workspace/0_core__20_1/firmware/main/…/wiring/inc/spark_wiring_timer.h:35: undefined reference to `os_timer_create’
collect2: error: ld returned 1 exit status
The device works quite well, I can compile and flash from the web IDE as long as I don’t use the Timer class. I’m currently using a library instead, but I’d just as soon prefer not to.
I mean, are you sure the device is selected in the WebIDE? The device has to be selected, and the correct firmware versions selected. Then the compiler will use the 0.4.7 branch which includes the timer support.
Yes. As I’m updating the device in question from the web IDE, I’m fairly certain that I’ve selected the correct device, and it does say “Latest (0.4.7)”. As long as I’m not including any Timer objects (I’m currently using a library called “SparcCorePolledTimer” instead), it compiles just fine.
Do you feel like selecting the device first makes the compilation work more reliably ? Since the IDE needs to decide between compiling for a spark core or a photon. Maybe choosing your device before even starting the cloud compilation correctly selects the build environment.