ID acceptance in CAN Receive block

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

ID acceptance in CAN Receive block

1,010 Views
juliana_rojas30
Contributor III

Good morning,

I am trying to modify the "flexcan_echo_s32k14" example from the library in order to achieve the following: I want to send an ID to the system, it doesn't matter which ID, it only matters that this ID is different than zero. So I modified the  case conditions to achieve this and it seems to be working fine. I also unselected the "Enable Rx FIFO" option in the block parameters ("FCAN_Config" box). The problem is that inside the switch case action (the one originally called "FCAN_Receive_ID_0x3FE"), it requires to specify an ID to receive over the CAN interface to activate the system and send something back.

My question is: is there any way to modify it in order to accept any ID? Or is it necessary to modify the code of the block itself to achieve this?

Thanks in advance!

Juliana

6 Replies

885 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

to accept any ID into the MB clear mask acceptance register, global or individual mask register depending what is used (MCR[IRMQ] bit).

BR, Petr

0 Kudos

885 Views
juliana_rojas30
Contributor III

Hi PetrS,

Thanks for your reply, it sounds good and I'd like to try it. Can you just tell me where can I find these parameters in order to modify this property?

Juliana

0 Kudos

885 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi ,

if using MBDT then refer to https://community.nxp.com/thread/538972#comment-1348866 

Hope it helps.

BR, Petr

0 Kudos

885 Views
juliana_rojas30
Contributor III

Hello PetrS,

The thing is, I changed already the mask parameters for 0s, but it doesn't seem to be working, now I wonder if it is because of the case filter. I put in the case parameters of the switch case the following: {hex2dec('1'):hex2dec('7FF')} , so I am sure that it allows any ID except 0. 

I don't know if I that condition in a switch case is not supposed to work, but since I don't receive any errors building it I assumed it works.

Thanks in advance.

Juliana

0 Kudos

885 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

unfortunately I do not know MBDT, so cannot help you on the setting. Please ask on MBDT community; https://community.nxp.com/community/mbdt 

Generally for masking; you cannot achieve condition to accept every ID (0x1 to 0x7ff) except of 0x0. If mask acceptance register is cleared all incoming ID bits are don't care so 0x0 is also received.

BR, Petr

885 Views
juliana_rojas30
Contributor III

Hi Ptr,

Thanks for your help, at the end I changed the masking parameters of the Rx and added a switch case for the left condition. It seems to be working now.

Kind regards,

Juliana.

0 Kudos