MPC5777C: MCAN Rx message buffer: Accepts only message of one ID.

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

MPC5777C: MCAN Rx message buffer: Accepts only message of one ID.

669 Views
hemadri_payam
Contributor III

Problem statement: MCAN Rx message buffer: Accepts only message of one ID.

 

Configurations that I am using:

  1. Receive Message buffers are configured (Not FIFO)
  2. No. of RX buffer 1
  3. No. of Tx Buffer 6
  4. 1 MBPS
  5. Buffer 0 is configured for receive
  6. Filter configurations: Range filter, Filter config RX Buffer, FD Enabled, ID 1 = 10, ID 2 = 100
  7. Only one buffer and only one filter table

 

Message Buffer zero is configured for receive.

When receiving any data through MCAN, it receives only one ID of 10. All other messages from 11 to 100 are filtered by MCAN.

 

I am working with the latest driver and here are the few observations:

  1. Fn: MCAN_DRV_ConfigRxMb

  if ( ( rx_info->msg_id_type == CAN_MSG_ID_EXT ) &&

       ( status == STATUS_SUCCESS ) ) {

    if ( mb_idx >= MCAN_GetExtIDFilterSize ( base ) ) {

      status = STATUS_CAN_BUFF_OUT_OF_RANGE;

    } else {

      mcan_id_table_t filterID;

      filterID.filterConfig = FILTER_CONF_RX_BUFF;

      filterID.filterType   = FILTER_TYPE_RANGE_ID;

      filterID.id1          = msg_id;

      /* Stored in the MB offset from MB 0 */

      filterID.id2             = mb_idx;

      filterID.isExtendedFrame = true;

      MCAN_SetEXT_IdFilter ( base, &filterID, mb_idx );

    }

  }

Filter ID 2 is set to buffer index, but it should be configured to the ID specified (which is 100).

 

  1. The filter address that it is mapped to while updating the filter configurations: when MCAN_DRV_Init is called, the filter address for the filter table configuration is 0xFFE34008

 

  1. When the MCAN_DRV_ConfigRxMB, the filter address: 0xFFE3400A

 

Note:

The example provided uses RX FIFO. But I am interested in using the HW Message buffers.

0 Kudos
3 Replies

542 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if setting filter element for RX buffer the ID range cannot be used. Each filter element must contain specific ID, there must be exact match, no masking is possible. So you can configure up to 64 unique IDs.  Assuming extended IDs, for each Rx Buffer a Extended Message ID Filter Element with EFEC = 111 and EFID2[10:9] = 00 has to be configured. EFT[1:0] is ignored. EFID1[28:0] holds the ID and  EFID2[5:0] indicates the RX message number. Please refer to chapter 41.5.4.1.7 of the RM for more info.

BR, Petr

0 Kudos

542 Views
hemadri_payam
Contributor III

Hi Petr,

Thanks for the response.

I have gone through the section specified and if my understanding is right, the MCAN peripheral can accept maximum of 64 unique message IDs configured to each Rx Message buffers.

So when using Rx Message buffers, MCAN does neither provide the feature of Range filtering (filtering from ID 1 to ID2) nor the Classic filter (ID and mask).

Hemadri

0 Kudos

542 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Hemadri,

yes, your understanding is correct.

BR, Petr

0 Kudos