AnsweredAssumed Answered

STM32F4 CAN filtering

Question asked by ragazzi.valerio on Nov 24, 2015
Latest reply on Nov 24, 2015 by Clive One
Hi, I'm using a STM32F407, I'm implementing the CAN communication. My purpose is to receive only one type of message and filter out all other messages.
I can not understand which settings to use for filtering messages.
I get messages on CAN1 (Master), FIFO0, with EXID = 0x0654.

My Filter setup is:

sFilterConfig.FilterNumber = 0;        // Inizializzo il filtro n°0
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0654;
sFilterConfig.FilterMaskIdHigh =0xFFFF;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 14;

Can someone
explain to me how you choose values of FilterIdHigh, FilterIdLow, FilterMaskIdHigh and FilterMaskIdLow to set the filter to receive only mess with ID = 0x0654?

thank you all.