Questions about flexcan id

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

Questions about flexcan id

488 Views
Oido
Contributor I

I'm using s32k144w.
Can I get multiple IDs in RX with one buffer through FLEXCAN? For example, it is not a method of allowing IDs from 0x200 to 0x20f using RXIMR.
I wonder if it is possible to accommodate non-regular and non-consecutive IDs in one buffer like 0x225, 0x385, 0x448.
CAN0->RAMn[ 3*MSG_BUF_SIZE + 0] = 0xC4000000;
CAN0->RAMn[ 3*MSG_BUF_SIZE + 1] = 0x200<<18;//
CAN0->RXIMR[3] = 0x3f0<<18;

0 Kudos
Reply
4 Replies

450 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Oido

If it is multiple random CAN IDs,then it is hard to do so.

0 Kudos
Reply

444 Views
Oido
Contributor I

Hello.Senlent
It's not random, it's fixed, but it's just not regular.
So you mean you have to use multiple buffers to use multiple IDs??
So S32K144W can use 7 buffers with 64 bytes, so you can only set up up to 7 IDs by combining TX and RX??

Wouldn't it be a problem if I set the RXIMR to 0x200 with one buffer and then get all the IDs and use only 0x201 and 0x600 of them?

CAN0->RAMn[ 3*MSG_BUF_SIZE + 1] = 0x200<<18;
CAN0->RXIMR[3] = 0x200<<18; 


RxID = ((CAN0->RAMN[ 3*MSG_BUF_SIZE + 1] & CAN_WMBn_ID_ID_MASK) >> 16);
if(RxID==0x201||RxID==0x600){
if((RxDATA3[1]&0x00000001)==0x00000001){
Direction = 0;
}
else if ((RxDATA3[1] & 0x00000002)==0x00000002){
Direction = 1;
}
}

Is there a problem with using it like this?

0 Kudos
Reply

436 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Oido

It's possible to do this, but take into account the data coming from the bus, if it's too much then you might lose frames

0 Kudos
Reply

385 Views
Oido
Contributor I

CAN0->RAMn[ 3*MSG_BUF_SIZE + 1] = 0x000<<18;
CAN0->RXIMR[3] = 0x000<<18;


RxID = ((CAN0->RAMN[ 3*MSG_BUF_SIZE + 1] & CAN_WMBn_ID_ID_MASK) >> 16);
if(RxID==0x201||RxID==0x600){
if((RxDATA3[1]&0x00000001)==0x00000001){
Direction = 0;
}
else if ((RxDATA3[1] & 0x00000002)==0x00000002){
Direction = 1;
}
}

 

Does this mean that if I set the RXIMR to 0x000 and get all the IDs and use only the data of the desired ID, I can get into trouble??
If so, is it recommended to use one in each buffer or a continuous range of IDs with RXIMR? I would appreciate it if you could elaborate.

0 Kudos
Reply