1. How to check the bus off status?
The bus off can be checked by installing the errorcallback and then check the error status.
Be aware the driver is selfrecovery enabled from bus_off state.
volatile uint32_t callback_error_status = 0u;
volatile flexcan_event_type_t can_callback_event;
void flexcan_callback(uint8_t instance,
flexcan_event_type_t eventType,
uint32_t buffIdx,
flexcan_state_t *flexcanState)
{
++callback_status;
can_callback_event = eventType;
callback_error_status = FLEXCAN_DRV_GetErrorStatus(instance);
}
main(){
FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0);
FLEXCAN_DRV_InstallErrorCallback(INST_CANCOM1,
(flexcan_error_callback_t)flexcan_callback,
&canCom1_State);
if(callback_error_status == BUS_OF_FLAG)
{
/* Do your staff */
}
}
(2) How many mailbox are occupied when Rx FIFO is used ?
About the no of mailboxes to be configured the RM specify the space used by RxFIFO as Rx MBs 0-5 and the no of MBs used by RxFIFO filters so the minim amount in case of enabled RxFIFO are at least 8 RxFIFO filters and them occupy the MBs from 6-7 so the next available individual MBs is 8.
(3) How to selectable priority between mailboxes and Rx FIFO during matching process in ProcessorExpertconfiguration?
The priority is not configurable is default one and is based on the filter position/ Individual MB position.
The default first scans the matching individual MBs and then RxFifo filters.