Hello, I have a problem. when I use CAN1, I can receive data, but when ı use CAN2, I can not receive. why ?
Two ideas come to my mind.
One reason of your issue could be wrong confuguration of CAN filtering. Please refer to this thread, which describes similar problem.
Second reason is related to relationship between CAN1 and CAN2. They share some common resources, which are managed by CAN1 always. As a result in order to use CAN2, at least clock for CAN1 has to be enabled. Please make sure that your code calls a function for CAN1 clock enabling.
thank you for explain. at project, ı use CAN2 only.
CAN2 FİTER config :
CAN2_Filter.FilterBank = 14; CAN2_Filter.FilterMode = CAN_FILTERMODE_IDMASK; CAN2_Filter.FilterScale = CAN_FILTERSCALE_32BIT; CAN2_Filter.FilterIdHigh = 0x0000; CAN2_Filter.FilterIdLow = 0x0000; CAN2_Filter.FilterMaskIdHigh = 0x0000; CAN2_Filter.FilterMaskIdLow = 0x0000; CAN2_Filter.FilterFIFOAssignment = CAN_FILTER_FIFO0; CAN2_Filter.FilterActivation = ENABLE; CAN2_Filter.SlaveStartFilterBank = 0;
Retrieving data ...