Hello,
If you want to be sure you don't lost messages between MBs config, you can use RxFIFO if you don't use CAN FD messages. To do that you need to set RxFIFO filters.
flexcan_id_table_t flTable[8];
for(i=0;i<8;i++)
{
flTable[i].id = 2;
flTable[i].isExtendedFrame=false;
flTable[i].isRemoteFrame=false;
}
FLEXCAN_DRV_ConfigRxFifo(INST_CANCOM1,FLEXCAN_RX_FIFO_ID_FORMAT_A,&flTable[0]);
/* You can set a filter mask or not for acceptance by setting global mask to be more easy to handle or you can
skip this part and will check all the id filters as set by initialization */
/* This will set mask to 3 and check ID type as filter set */
FLEXCAN_DRV_SetRxFifoGlobalMask(INST_CANCOM1, FLEXCAN_MSG_ID_STD, ((1U<<30U)|0x3));
/* Sets the Rx masking type as rx global mask */
(void) FLEXCAN_DRV_SetRxMaskType(INST_CANCOM1, FLEXCAN_RX_MASK_GLOBAL);
/* End of filter acceptance masking */
Call for transfer of a message already in fifo. For every message in fifo you need to call again the function. If you have a callback installed you can call it again in the event triggered is FLEXCAN_EVENT_RXFIFO_COMPLETE.
status = FLEXCAN_DRV_RxFifo(INST_CANCOM1, &recvBuff);
or you can poll the MBs status for RxFIFO which is MBs 0 all the time.
while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, 0U) == STATUS_BUSY);
BR,
Alexandru Nan