Hello @rohitkumarkv07
First, please review our recommendations on how to post a thread on this community. Especially on how to share a source code: https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228.
Second, did you configure filters to receive CAN frames? Even to receive all possible IDs, you need to configure at least one filter for your FIFO0.
Example:
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0000;
sFilterConfig.FilterMaskIdHigh = 0x0000;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0;
sFilterConfig.FilterActivation = ENABLE;
Don't forget to configure the filter bank:
sFilterConfig.FilterBank = <depends on the CAN isntance used>
sFilterConfig.SlaveStartFilterBank = <depends on the CAN isntance used>
Hope it helps.