AnsweredAssumed Answered

STM32F205 CAN Filter Master Register - CAN2 start bank ignored

Question asked by WernerPrbk on Jul 21, 2016
Latest reply on Jul 22, 2016 by FTITI.Walid
Hi,

I use CAN1 peripheral and I accidentally set CAN2SB in CAN_FMR to 0.
Referring to the note in the datasheet all filters should therefore be assigned to CAN2.
If I activate a 16-Bit filter (ID List), the interrupts is generated anyway...
CAN2 is not activated.
How is that possible? I already checked the registers, CAN2SB actually is set to 0.

Following code snipped is used for filter initializing (STM32CubeF2 is used):
01.CAN_FilterInitStructure.FilterNumber = 0;
02.CAN_FilterInitStructure.FilterMode = CAN_FILTERMODE_IDLIST;
03.CAN_FilterInitStructure.FilterScale = CAN_FILTERSCALE_16BIT;
04.CAN_FilterInitStructure.FilterIdHigh = (SOME_ID) << 5;
05.CAN_FilterInitStructure.FilterIdLow = 0;
06.CAN_FilterInitStructure.FilterMaskIdHigh = 0;
07.CAN_FilterInitStructure.FilterMaskIdLow = 0;
08.CAN_FilterInitStructure.FilterFIFOAssignment = 0;   // Messages go into FIFO0
09.CAN_FilterInitStructure.FilterActivation = ENABLE; 
10.CAN_FilterInitStructure.BankNumber = 0;
11. 
12.// Set Filter
13.HAL_CAN_ConfigFilter(hcan, &CAN_FilterInitStructure);

Another interesting thing is, if I use CAN2, I can't receive any messages, but transmission works fine. For that I set CAN2SB to 14 and configured Filter-Number 15...
CAN1 clock is activated.

Outcomes