CAN Error: Receive buffer is small

Hi,

in my application I use CAN lib (CE Lib 2.0b4174-20171120 preliminary release). If I first send a frame with 8 data bytes and then with 1 data byte, everything is fine. But after that I send again a frame with 8 data bytes and get the following error message from output:

CAN Error: Receive buffer is small
Unknown: DEBUGCHK failed in file .\src\can_fastFlex.cpp at line 493 
Application.exe has triggered a breakpoint.

I modified the CANDemo example so that it works similar to my application. Also used the same libs. And there it works. Only get the error:

CANClass::CANInterruptHandler: CAN_TWRN_INT_BIT intr Occor
CAN: overrun.
CAN: queue overrun.

if I send to many frames.

What does this error mean? Can I somehow avoid the crash?

The message is not (or only indirectly) related to the sending of messages.

The error message is generated within Can_Read() or VybCan_Read() .
This function expects a structure of type tCanMsg*, which contains a field dataLen. For Read operations, this field is interpreted as the available buffer size for the received message.

I assume you pass a struct with dataLen set to one, and the received message is larger. I recommend to always pass dataLen=8 when calling Can_Read() or VybCan_Read() .

Well, that’s it. Thanks a lot