6 years, 6 months ago.

CAN filter always returns 0 (='Failed or Unsupported', mbed LPC1768)

The same question was raised a number of years ago but has not been answered hence I'm hoping this new post will prompt a reply.

Here's the mbed Class Reference:

/media/uploads/ChrisMabey/capture2.jpg

And here's my code snippet:

/media/uploads/ChrisMabey/capture1.jpg

The problem is that the function always returns 0.

My understanding is that the hardware applies a valid filter handle when undertaking the read:

/media/uploads/ChrisMabey/capture.jpg

Note that I can write, read, set the CAN frequency and use an interrupt for received frames so my problem is only with the filter function. As a workaround I'm using a low-level filter published on the forum but would prefer to use the mbed library if possible.

Thanks, Chris.

1 Answer

6 years, 6 months ago.

Hi Chris, when you look at the source code

Quote:

mbed-os\targets\TARGET_NXP\TARGET_LPC176X\can_api.c

int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle) {
    return 0; // not implemented
}

Accepted Answer

That explains it, thanks Pavel.

posted by Chris Mabey 21 Oct 2017