Several Configuration question about S32K FlexCAN

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Several Configuration question about S32K FlexCAN

1,586 Views
qianghu
Contributor II

Deer engineer,

         I have three question when configuring S32K146 FlexCAN with ProcessorExpert as follows:

(1) How to check the bus off status?

There is not API or callback function to check the bus off status in ProcessorExpert.

I just find the IRQ handler[CAN0_ORed_IRQHandler(void)]  for OR'ed interrupts can be used to check bus off.

Is there another way to check bus off ?

(2) How many mailbox are occupied when Rx FIFO is used ?

 I want to configure MBs 0~5 for Rx FIFO and configure MBs 7~31 for individual MBs, but when I do so, I find MB 7 can not be used as individual MB and MB8~31 can be used as individual MB.

May I ask if there is an error in doing this?

(3)How to  selectable priority between mailboxes and Rx FIFO during matching process in ProcessorExpert configuration?

I can not find the optional configuration item about the priority between mailboxes and Rx FIFO during matching process in ProcessorExpert.

pastedImage_12.png

Attachment information:

  • S32 Design Studio for ARM Version: 2018.R1
  • SDK V0.8.6 /SDK V3.0.1
6/5000
Optional configuration item
Labels (1)
1 Reply

1,238 Views
alexandrunan
NXP Employee
NXP Employee

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.