IMXRT1171 Flexcan MassageBox Filter (range filter function?)

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

IMXRT1171 Flexcan MassageBox Filter (range filter function?)

596 Views
Seunghyup
Contributor I

Hello,
I have a question regarding FlexCAN filtering.

I am currently using CAN FD, and with the FD configuration, the number of available Message Buffers (MBs) is limited to a maximum of 13.

When looking at settings from the MCUXpresso Config Tool or in code such as:

const flexcan_rx_mb_config_t CAN1_rx_mb_config_0 = {
.id = FLEXCAN_ID_STD(291UL),
.format = kFLEXCAN_FrameFormatStandard,
.type = kFLEXCAN_FrameTypeData
};

It seems that a single Message Box is mapped to a single CAN ID filter.

In the previous MCUs I used, there were filtering functions that allowed for range-based filtering.
Is there a similar way to implement this in the current setup?
For example, receiving only CAN IDs within the range of 0x100 to 0x200.

Thank you!

0 Kudos
Reply
3 Replies

517 Views
mayliu1
NXP Employee
NXP Employee

Hi @Seunghyup ,

Thank you so much for your interest in our products and for using our community.

RXMGMASK: RXMGMASK is used to mask the filter fields of all Rx MBs, excluding MBs 14-15,
which have individual mask registers.

Please pay attention MCR[IRMQ] setting.

mayliu1_0-1732875758077.png

RXIMR0~63: These can allow  more fine-grained filtering settings for each available Rx mailbox.

mayliu1_1-1732876122044.png

 

Wish it helps you.
If you still have question about it, please kindly let me know.

 

BR

mayliu

0 Kudos
Reply

573 Views
eva78mason
Contributor I

Hello,

For FlexCAN filtering with CAN FD, you can use global masking to filter a range of CAN IDs. Set a global mask to accept the desired range, for example, IDs from 0x100 to 0x200. Use FLEXCAN_SetRxMbGlobalMask to apply this mask and configure individual masks for each message buffer accordingly LiteBlue

0 Kudos
Reply

543 Views
Seunghyup
Contributor I

Testing Based on Your Response:

MB0: RX 0x64
MB1: TX
MB2: RX 0x67
RXMGMASK = 0x1FF3FFFF

When testing with this configuration, I confirmed that MB0 could receive IDs ranging from 0x64 to 0x67 in its buffer.

I understood that the setting for the RXMGMASK is based on configuring '0' bits for the range between criterion A and criterion B, which defines the allowed IDs.

However, I have set 0x64 and 0x67 as MB0 and MB2, respectively, but is there any specific criterion for assigning MB (Message Buffer) numbers?

If I add another criterion to a different MB, how would it behave?
For example: MB3: RX 0x70

0 Kudos
Reply