2017-03-23 03:40 AM
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 #can2017-03-26 08:18 AM
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.
2017-03-26 11:38 AM
Use this mask to filter the specific message you are looking for
filt.
FilterMaskIdHigh
= 0x7FF << 5
;
2017-03-26 02:02 PM
Thanks Clive One.