tsandmann / freertos-teensy

FreeRTOS port with C++ std::thread support for ARM boards Teensy 3.5, 3.6, 4.0 and 4.1 (cortex-m4f and cortex-m7f)
92 stars 15 forks source link

Linker error: can't find reference to serialEvent_default #21

Closed krav4 closed 1 year ago

krav4 commented 1 year ago

Looks like using the latest version of freertos port to teensy is causing linker issues with finding the serialEvent function. Implementing it in a .cpp file did not seem to make a difference.

platformio file that does not work:

[env:teensy_pat]
platform               = https://github.com/tsandmann/platform-teensy.git
board                  = teensy41
framework              = arduino
lib_deps               = 
  https://github.com/tsandmann/freertos-teensy
  SPI
  https://github.com/sparkfun/SparkFun_LSM6DS3_Arduino_Library.git
  https://github.com/PaulStoffregen/Time.git#a18e50dcea4ee17285d732d39e7bc559482d1d3d

platformio file that does work (hammering the commit)

[env:teensy_pat]
platform               = https://github.com/tsandmann/platform-teensy.git
board                  = teensy41
framework              = arduino
lib_deps               = 
  https://github.com/tsandmann/freertos-teensy#379d9b5ad82f8c1be995f95add3fd32bb3add2c1
  SPI
  https://github.com/sparkfun/SparkFun_LSM6DS3_Arduino_Library.git
  https://github.com/PaulStoffregen/Time.git#a18e50dcea4ee17285d732d39e7bc559482d1d3d

Linker error:

Indexing .pio/build/teensy_pat/libFrameworkArduino.a
Linking .pio/build/teensy_pat/firmware.elf
/home/vagrant/.platformio/packages/toolchain-arm-cortexm-linux/bin/../lib/gcc/arm-cortexm7f-eabi/12.2.0/../../../../arm-cortexm7f-eabi/bin/ld: .pio/build/teensy_pat/lib953/libfreertos-teensy.a(teensy_4.cpp.o): in function `_ZN8freertos5yieldEv':
teensy_4.cpp:(.flashmem+0x100): undefined reference to `_ZN8freertos20_serialEvent_defaultE'
collect2: error: ld returned 1 exit status
*** [.pio/build/teensy_pat/firmware.elf] Error 1
tsandmann commented 1 year ago

Could you please run pio pkg update to make sure the platform lib is the latest version?