tonton81 / FlexCAN_T4

FlexCAN (CAN 2.0 / CANFD) Library for Teensy 3.x and 4.0
https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4
MIT License
192 stars 63 forks source link

Unable to debug when using FlexCAN_T4 on platformIO #68

Open Moi78 opened 10 months ago

Moi78 commented 10 months ago

Hello, I was trying to debug a program on a Teensy 4.0 but I found out that I was completely unable to compile my firmware in debug mode due to FlexCAN_T4.

Here is the error :

c:/users/mathys.d/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: .pio\build\teensy40\src\main.cpp.o: in function `FlexCAN_T4<(CAN_DEV_TABLE)1075642368, (FLEXCAN_RXQUEUE_TABLE)256, (FLEXCAN_TXQUEUE_TABLE)16>::FlexCAN_T4()':
C:\Users\mathys.d\.platformio\packages\framework-arduinoteensy\libraries\FlexCAN_T4/FlexCAN_T4.tpp:68: undefined reference to `vtable for FlexCAN_T4_Base'

I am using PlatformIO in visual studio.

Thanks in advance,

ishelly404 commented 1 month ago

I ran into this issue as well, I was able to fix it by changing line 331 in FlexCAN_T4.h from virtual uint8_t getFirstTxBoxSize(); to virtual uint8_t getFirstTxBoxSize() = 0;. The issue seems to be because of a missing definition of the virtual function getFirstTxBoxSize().

I was able to debug without issue after making this change.