FlexCAN Rx Mailbox Config to allow all CAN ID

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

FlexCAN Rx Mailbox Config to allow all CAN ID

Jump to solution
2,772 Views
soumyajit_das
Contributor I

MCU: S32K144

Hi,

I have imported the example project "S32K144_Project_FlexCan" in the S32 IDE. I see that the example shows how to accept data from a particular CAN ID (incoming messages). I would like to know how do we configure the registers to accept messages from any CAN ID (incoming).

I see there are three relevant register settings in FlexCAN:

1. RXMGMASK (Rx Mailboxes Global Mask register)

2. RXIMRx (Rx Individual Mask registers)

3. CAN  ID field of the MB Message Box Structure

In the given example, the registers RXMGMASK is set to 0xFFFF indicating that all bits of the incoming CAN Message ID needs to be considered. Same for RXIMRx also. In this case, when you configure MB CAN ID as (say) 555, then incoming messages with CAN ID 555 will only be allowed to be received by the Rx MB.

What if I want the Rx MB to receive any CAN message bearing any CAN ID? Is the required setting 'RXMGMASK=0x0000' & 'RXIMRx=0x0000'?

If yes, then what should we put in the Rx MB CAN ID field?

NOTE:

  1. I am using standard CAN ID only

  2. CAN FD (Flexible Data Rate) not used

  3. I am using FlexCAN0 of the MCU

Thanks

Regards

Soumyajit

Bosch, Bangalore

1 Solution
2,705 Views
danielmartynek
NXP TechSupport
NXP TechSupport
2 Replies
2,396 Views
Andre_b
Contributor II

Hi

I read the solution proposed by Daniel but I didn't understand how to modify the example project "S32K144_Project_FlexCan" to obtain reading all message incoming with all available IDs.

In the example any message has the own ID buffer, so it can be read as below

RxID = (CAN0->RAMn[ 4*MSG_BUF_SIZE + 1] & CAN_WMBn_ID_ID_MASK) >> CAN_WMBn_ID_ID_SHIFT; /* Read ID

but without a buffer for reading ID and message, how can I read ID and datafield?

Thanks

Regards 

Andrea

0 Kudos
2,706 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi soumyajit.das@in.bosch.com,

It was answered here:

S32K148 CAN receiver without filtering 

Regards,

Daniel