AnsweredAssumed Answered

how to use S32R274 CAN mask

Question asked by Jie Zhang on Dec 23, 2018
Latest reply on May 31, 2019 by Alexandru Nan

hallo, I need your help to set CAN mask for MCU S32R274.

i have a program for CAN receiving with interrupt.

 CAN_1.MB[0].CS.B.CODE = 0x0;           //MB inactive
 CAN_1.MB[0].CS.B.IDE = 0;
 CAN_1.MB[0].ID.R = 10;                                              //set standard ID
 CAN_1.MB[0].DATA.W[1] = 0x00000000;  //data1 set (optional)
 CAN_1.MB[0].DATA.W[0] = 0x00000000;  //data0 set (optional)
 CAN_1.MB[0].CS.B.CODE = 0x4;   //MB empty - ready for receive
If I set CAN receiving without MASK. I use IRMQ=0, RXMGMASK=0x00000000. it works as expected.
it can received MB0 no matter of the ID number.
But by setting following to enable MASK, it always failed. MASK does not work as it supposed to. 
try 1: IRMQ=0, RXMGMASK=0xFFFFFFFC. supposedly ID=10,11,12,13 should be received.
try 2: IRMQ=1, RXIMR0=0xFFFFFFFC.       supposedly ID=10,11,12,13 should be received.
Can you tell me how to set it up?