I can configure CAN filters from main.c file, but I want also to configure them by sending frame from the other node. There is the code from interrupt I want to use to configure filters:
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
sFilterConfig.FilterMode = CAN_FILTERMODE_IDLIST;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.BankNumber = hcan.pRxMsg->Data[1];
sFilterConfig.FilterNumber = hcan.pRxMsg->Data[2];
sFilterConfig.FilterIdHigh = (hcan.pRxMsg->Data[3])<<5;
sFilterConfig.FilterIdLow = 0;
sFilterConfig.FilterMaskIdHigh = 0;
sFilterConfig.FilterMaskIdLow = 0;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);
For example I'm sending Data[1] = 1, Data[2]=0. When I'm sending the frame, the LED changes it's state, so it should work. I used analogous code in main.c file to configure filter while programming STM and it works properly. It's that even possible to configure CAN filters while STM is working? If yes, then where am I wrong?