i think i figured out what was the problem. I have made a new project where i just use the CAN and the filter configulation. I configured the FiFo 0 to catch just 0x7C1 is filter list mode just like that:
CAN_FilterTypeDef canfilterconfig_FIFO0;
canfilterconfig_FIFO0.FilterActivation = CAN_FILTER_ENABLE;
canfilterconfig_FIFO0.FilterBank = 0;
canfilterconfig_FIFO0.FilterFIFOAssignment = CAN_RX_FIFO0;
canfilterconfig_FIFO0.FilterIdHigh = 0x7C1<<5;
canfilterconfig_FIFO0.FilterIdLow =0x0000;
canfilterconfig_FIFO0.FilterMaskIdHigh = 0x7C1<<5;
canfilterconfig_FIFO0.FilterMaskIdLow = 0x0000;
canfilterconfig_FIFO0.FilterMode = CAN_FILTERMODE_IDLIST;
canfilterconfig_FIFO0.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig_FIFO0.SlaveStartFilterBank = 0; //has no effect
if(HAL_CAN_ConfigFilter(&hcan, &canfilterconfig_FIFO0) != HAL_OK)
{
Error_Handler();
}
After that i configured FiFo1 for the extened ID-s (it is the same config in the question):
CAN_FilterTypeDef canfilterconfig_FIFO1;
canfilterconfig_FIFO1.FilterActivation = CAN_FILTER_ENABLE;
canfilterconfig_FIFO1.FilterBank = 1;
canfilterconfig_FIFO1.FilterFIFOAssignment = CAN_RX_FIFO1;
canfilterconfig_FIFO1.FilterIdHigh = 0x0000;
canfilterconfig_FIFO1.FilterIdLow = 0x04; // IDE bit
canfilterconfig_FIFO1.FilterMaskIdHigh = 0x0000;
canfilterconfig_FIFO1.FilterMaskIdLow = 0x04; // IDE bit
canfilterconfig_FIFO1.FilterMode = CAN_FILTERMODE_IDMASK;
canfilterconfig_FIFO1.FilterScale = CAN_FILTERSCALE_32BIT;
canfilterconfig_FIFO1.SlaveStartFilterBank = 0; //has no effect
if(HAL_CAN_ConfigFilter(&hcan, &canfilterconfig_FIFO1) != HAL_OK)
{
Error_Handler();
}
I tried with this and now it works well. My colleague and I think that because I have made an new project with this configulation it erased the whole mikrocontroller program from the STM32 so it erased the other filterbanks which i used at the begining of the project. (maybe filterbank 10 I cant remembered well) Next to that I configured new filterbank which in the question (filterbank 1 and 2) but the filter bank 10 stayed in the configured. So because the filter bank 10 was set (and i forgetted that) it filtered the message. So I erased the whole program from the mikrocontroller and flashed again and now it works fine.