cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F CAN messages filtering

Stepan Podhorsky
Associate II
Posted on March 23, 2017 at 11:40

Hello,

I would like to ask you for an advice regarding the CAN messages

filtering. I am not sure whether I understand the filtering and masking

in right manner. I have following settings

CAN_FilterConfTypeDef

filt;

filt.

FilterIdHigh

= (0x6C1 << 5)

; // standard 11 bit identifier

filt.

FilterIdLow

= 0

;

filt.

FilterMaskIdHigh

= 0

;

filt.

FilterMaskIdLow

= 0

;

and I am not sure what ID's will be captured by the CAN periphery. I expect that

all CAN frames will be captured because the mask has all bits zero. Is it correct?

If it is incorrect what ID's will be captured?

Thanks.

#stm32f #can
3 REPLIES 3
Stepan Podhorsky
Associate II
Posted on March 26, 2017 at 17:18

CAN frame is accepted only if (id & mask == filter) logic statement has true value. So the above setting results in no frames to be accepted.

Posted on March 26, 2017 at 18:38

Use this mask to filter the specific message you are looking for

filt.

FilterMaskIdHigh

= 0x7FF << 5

;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 26, 2017 at 21:02

Thanks Clive One.