Problem statement: MCAN Rx message buffer: Accepts only message of one ID.
Configurations that I am using:
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:
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).
Note:
The example provided uses RX FIFO. But I am interested in using the HW Message buffers.
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
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
Hi Hemadri,
yes, your understanding is correct.
BR, Petr