Flexcan Message Buffer

Showing results for 
Search instead for 
Did you mean: 

Flexcan Message Buffer

Contributor I
  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.
Labels (1)
Tags (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hi, Reyyan,

The FlexCan module of k10 has 16 MB(message buffers), each MB has 16 bytes RAM, the total RAM size is 16*16=256 bytes.

Pls refer to the section in RM of K10:

" Number of message buffers
Each FlexCAN module contains 16 message buffers. Each message buffer is 16 bytes.


Hope it can help you


Xiangjun Rong

0 Kudos