Compiling code for Core fails, does not fail if compiling for Photon

Building target: target/workspace.elf
Invoking: ARM GCC C++ Linker
mkdir -p target/
_PID_CDC=0x607D -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -flto -DINCLUDE_PLATFO
nc -I../wiring/inc -I../hal/inc -I../hal/shared -I../hal/src/core -I../hal/src/s
tm32 -I../system/inc -I../services/inc -I../communication/src -I../platform/shar
ed/inc -I../platform/MCU/STM32F1xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/
STM32F1xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F1xx/SPARK_Firmware
_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F1xx/CMSIS
/Include -I../platform/MCU/STM32F1xx/CMSIS/Device/ST/Include -I../platform/NET/C
C3000/CC3000_Host_Driver -I../dynalib/inc -I. -MD -MP -MF target/workspace.elf.d
 -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-dec
larations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -DSTART
OURCE target/obj/./src/module_info.o  target/obj/startup/startup_stm32f10x_md.o
--output target/workspace.elf -nostartfiles -Xlinker --gc-sections -flto -Os -fu
se-linker-plugin -Tlinker_stm32f10x_md_dfu.ld -L../build/arm/linker --specs=nano
.specs -lc -lnosys -u _printf_float -Wl,-Map,target/  -L../build/ta
rget/user/platform-0-lto -L../build/target/wiring/platform-0-lto/ -L../build/tar
get/system/platform-0-lto/ -L../build/target/services/platform-0-lto/ -L../build
/target/communication/platform-0-lto-prod-0/ -L../build/target/hal/platform-0-lt
o/ -L../build/target/platform/platform-0-lto/ -L../build/target/wiring_globals/p
latform-0-lto/ -L../build/target/newlib_nano/platform-0-lto -L../build/arm/linke
r -Wl,--whole-archive -lnewlib_nano -luser -lwiring -lhal -lsystem -lservices -l
communication -lplatform -lwiring_globals -Wl,--no-whole-archive
/tmp/ccHSquKY.ltrans1.ltrans.o: In function `Timer::invoke_timer(void*) [clone .
/firmware/main/../wiring/inc/spark_wiring_timer.h:119: undefined reference to `o
/tmp/ccHSquKY.ltrans6.ltrans.o: In function `_stop':
/firmware/main/../wiring/inc/spark_wiring_timer.h:71: undefined reference to `os
/tmp/ccHSquKY.ltrans8.ltrans.o: In function `dispose':
/firmware/main/../wiring/inc/spark_wiring_timer.h:92: undefined reference to `os
/tmp/ccHSquKY.ltrans12.ltrans.o: In function `__base_ctor ':
/firmware/main/../wiring/inc/spark_wiring_timer.h:34: undefined reference to `os
/tmp/ccHSquKY.ltrans22.ltrans.o: In function `_start':
/firmware/main/../wiring/inc/spark_wiring_timer.h:66: undefined reference to `os
collect2: error: ld returned 1 exit status
../build/ recipe for target 'target/workspace.elf' failed
make: *** [target/workspace.elf] Error 1

Any ideas what might be causing this and any workarounds?


Are you trying to run Software Timers on a Core?
If so ou may want to look at this

Thanks was just coming here to post I’ve installed that library and seems to compile OK now. Thanks

1 Like

I too having the same problem. May I know from where you got the library file and how you installed.

What’s wrong with the link I posted?

I got it from the link ScruffR posted (but you need to find the source code and download, not the example)

The link I provided also features a GitHub link to the sources, but IIRC you just need to #include the library respective headers since the actual implementations are part of the Particle framework.

Thanks daneboomer and ScruffR for your reply. I went through it and I’ve included those header files and I got the result. Thanks guys for your kind help.