Question
STM32F205 CAN Filter Master Register - CAN2 start bank ignored
Posted on July 21, 2016 at 13:55
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):
CAN_FilterInitStructure.FilterNumber = 0;
CAN_FilterInitStructure.FilterMode = CAN_FILTERMODE_IDLIST;
CAN_FilterInitStructure.FilterScale = CAN_FILTERSCALE_16BIT;
CAN_FilterInitStructure.FilterIdHigh = (SOME_ID) << 5;
CAN_FilterInitStructure.FilterIdLow = 0;
CAN_FilterInitStructure.FilterMaskIdHigh = 0;
CAN_FilterInitStructure.FilterMaskIdLow = 0;
CAN_FilterInitStructure.FilterFIFOAssignment = 0;
// Messages go into FIFO0
CAN_FilterInitStructure.FilterActivation = ENABLE;
CAN_FilterInitStructure.BankNumber = 0;
// Set Filter
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 ..
CAN1 clock is activated.
#can #stm32f2 #stm32f205 #can2