AnsweredAssumed Answered

Flexcan Message Buffer

Question asked by REYYAN OFLAZ on Jul 12, 2018
Latest reply on Jul 13, 2018 by xiangjun.rong
  I have been searching how to use the FlexCAN interface for the MK10DN512VLQ10, and I need some clarification on how many message buffers are really supported.I've created KSDK1.3+Processor Expert pROJECT
   I've configured 3 message boxes as receivers and  every message box has its own individual Mask, 
There is as structrure in the driver named   flexcan_state_t   used for  pointer to runtime state structure and has a member   volatile uint32_t rx_mb_idx;  
FLEXCAN_DRV_ConfigRxMb(comCAN1_IDX, 0 , &rx_info1, canRxMsgHandlerList[0].msgID);
FLEXCAN_DRV_ConfigRxMb(comCAN1_IDX, 1 , &rx_info2, canRxMsgHandlerList[1].msgID);
FLEXCAN_DRV_ConfigRxMb(comCAN1_IDX, 2 , &rx_info3, canRxMsgHandlerList[2].msgID);
void comCAN1_MbHandler(void)
FLEXCAN_DRV_RxMessageBuffer(comCAN1_IDX, 0, &messageBoxList[0]);
FLEXCAN_DRV_RxMessageBuffer(comCAN1_IDX, 1, &messageBoxList[1]);
FLEXCAN_DRV_RxMessageBuffer(comCAN1_IDX, 2, &messageBoxList[2]);
These are the API s which I have used, as you can see MB1 is configured for ID0 ,MB2 is configured for ID1  and MB2 is configured for ID2   and we get the interrupt only for these mentioned ID's and able to receive data. But corresonding to API ,I need to specify which  MB  the message will come from.
rx_mb_idx  only holds 3rd message box as receive ,when other Message Box (0 and 1 ) receives a message interrupt generated but ISR routine (FLEXCAN_DRV_IRQHandler) wont check 0. and 1. message box.
Kindly let me know what needs to be done with multiple number of message buffer.