2025-01-03 02:25 AM - last edited on 2025-01-03 02:53 AM by SofLit
Hi
I am using STM32F407 evb in which I have configured both CAN1 and CAN2 ,I am sendind CAN1(3 ids 501,502,503) and vice versa from CAN2 same I am sending but I am ble to recive all three id on CAN2 Rx but only one ID iam receving on CAN1(501) .I am sahring my filter configuration I am using mask mode
if (can_controller==0){
for (int i=0; i <CAN_MAXTABLEID_0; i++)
{
Can_Configfilter[i].FilterIdHigh = (0x501 << 5);
Can_Configfilter[i].FilterMaskIdHigh =(0xFFC << 5);
Can_Configfilter[i].FilterIdLow = 0x00000000; // Initialize if EXTID used
Can_Configfilter[i].FilterMaskIdLow = 0x00000000; // Initialize if EXTID used
Can_Configfilter[i].FilterFIFOAssignment = CAN_FILTER_FIFO_0;
Can_Configfilter[i].FilterBank = i; //Selection of filterBANk
Can_Configfilter[i].FilterMode = CAN_FILTERMODE_IDMASK; // Identifier mode
Can_Configfilter[i].FilterScale = CAN_FILTERSCALE_32BIT; // Scale selection
Can_Configfilter[i].FilterActivation = CAN_FILTER_ENABLE;// Example activation
Can_Configfilter[i].SlaveStartFilterBank=1; //0-2 CAN1 filter
Can_IPW_Can_ConfigFilter(&hcan,&Can_Configfilter[i]); //Filter configuration
}
}
if (can_controller==1){
for (int i=1; i <CAN2_MAXTFILTER; i++)
{
Can_Configfilter[i].FilterIdHigh = (0x501 << 5);
Can_Configfilter[i].FilterMaskIdHigh =( 0xFFC << 5);
Can_Configfilter[i].FilterIdLow = 0x00000000; // Initialize if EXTID used
Can_Configfilter[i].FilterMaskIdLow = 0x00000000; // Initialize if EXTID used
Can_Configfilter[i].FilterFIFOAssignment = CAN_FILTER_FIFO_0;
Can_Configfilter[i].FilterBank = i; //Selection of filterBANk
Can_Configfilter[i].FilterMode = CAN_FILTERMODE_IDMASK; // Identifier mode
Can_Configfilter[i].FilterScale = CAN_FILTERSCALE_32BIT; // Scale selection
Can_Configfilter[i].FilterActivation = CAN_FILTER_ENABLE;// Example activation
Can_Configfilter[i].SlaveStartFilterBank=1; //2-28 CAN2 filter
Can_IPW_Can_ConfigFilter(&hcan,&Can_Configfilter[i]); //Filter configuration
}
}
Solved! Go to Solution.
2025-01-06 03:25 AM
@Ash1 wrote:
yes because I am trying to send 6 continously ID with single delay at end .
I got your point thanks
So please accept the comment that answered your original question.
2025-01-06 03:45 AM
You accepted the wrong comment:
I will mark the nearest comment that answered your question as "Accepted as Solution".