AnsweredAssumed Answered

How to setup KW36 FlexCAN multiple mailbox?

Question asked by frank xu on Sep 3, 2019
Latest reply on Sep 6, 2019 by Felipe García

Can any NXP engineer help me?

 

KW36 can set receive MASK to receive data by different mailbox by this funciton.

FLEXCAN_SetRxMbGlobalMask(HMI_CAN, FLEXCAN_RX_MB_STD_MASK(rxIdentifier, 0, 0));

by  this function, only setup one mailbox. I have two RX ID , how to initial/setup?

 

and how to get the data by flexcan_callback() function?

static void flexcan_callback(CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData)
{
    switch (status)
   {
       case kStatus_FLEXCAN_RxIdle:
          if (RX_MESSAGE_BUFFER_NUM == result)
          {
             rxComplete = true;
          }
       break;

       case kStatus_FLEXCAN_TxIdle:
       if (TX_MESSAGE_BUFFER_NUM == result) 
       {
          txComplete = true;
       }
      break;

      default:
      break;
   }
}

 

Could you please give me one demo code to show how to work?

Outcomes