S32K144 Model-Base CAN RX mask

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

S32K144 Model-Base CAN RX mask

2,341 Views
vinicius_olivei
Contributor III

Hello everyone,

I'm trying to configure CAN RX with Model-Base S32K144 to receive CAN Ext ID 0x1CECXXXX.

I did the configuration for masking as the picture follows:

pastedImage_4.png

So I could receive all IDs that starts with 0x1CEC, but when I debug the model I can see it only accepts 0x1CEC0000, and for example not 0x1CECA232.

Is the masking configuration right? Could someone give me some hints?

Thank you!

11 Replies

1,713 Views
vinicius_olivei
Contributor III

Hi @Constantin Razvan Chivu Mitarbeiter

Works like charm :smileyhappy:.

Thank you for your support in this issue.

Best Regards,

Vinicius Oliveira.

0 Kudos

1,713 Views
constantinrazva
NXP Employee
NXP Employee

You are welcome vinicius.oliveira@enfas.de‌!

I will update our hotfixes patch for S32K available here https://community.nxp.com/thread/489947#comment-1106251.

Thank you again for reporting this issue!

Kind regards,

Razvan.

0 Kudos

1,713 Views
vinicius_olivei
Contributor III

Hi @Constantin Razvan Chivu Mitarbeiter

Any work around for this?

Thank you.

0 Kudos

1,713 Views
constantinrazva
NXP Employee
NXP Employee

Hello again vinicius.oliveira@enfas.de‌,

I have found the culprit - the global Rx mask was set by default 0xFFFFFFFF; so even after setting the individual Rx mask of the MB you wanted to use to 0xFFFF0000, the global mask still overwrites it - after changing this mask, your use-case worked on my end.

Later edit: The problem is with MCR[IRMQ] - individual rx masking and queue enable bit. This controlls if individual rx masking and queue features are enabled or disabled. I have updated the file attached by calling FLEXCAN_DRV_SetRxMaskType function to set Rx masking to individual.

Please find attached here the tlc-file you need to update:

{ROOT_DIR}\mbdtbx_s32k14x\mbdtbx_s32k14x\blocks\fcan\fcan_s32k14_receive.tlc

Please confirm that everything works on your end too.

Thank you for posting this bug with details - that was helpful!

Kind regards,

Razvan.

1,713 Views
constantinrazva
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

Sorry for the delayed answer, I was caught up with other stuff, but I'm now looking at this issue. I'll probably get back to you tomorrow with my findings.

Thank you for your patience,

Razvan.

0 Kudos

1,713 Views
vinicius_olivei
Contributor III

Now it complies and flash.

I can see the difference in the code:

pastedImage_1.png

But, the issue is the same, if I send 0x1CEC1234 for example it does not recognize it, sending 0x1CEC0000 the global RX_DATA variable is updated.

I have 4 global variables that update its value when any CAN message is received (ID, DATA, LENGTH and TIMESTAMP) and I check this with FREEMaster.

0 Kudos

1,713 Views
vinicius_olivei
Contributor III

It didnt work, this is the error message while compiling:

\NXP_MBDToolbox_S32K1xx\code\mbdtbx_s32k14x\mbdtbx_s32k14x\blocks\fcan\fcan_s32k14_receive.tlc Line: 61 Column: 28
Values of NULL type cannot be expanded

0 Kudos

1,713 Views
constantinrazva
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

Sorry, I had the fix made for another version. I have attached the file here for the version you have.

Kind regards,

Razvan.

0 Kudos

1,713 Views
constantinrazva
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

The masking configuration is correct, I will take a look and come back soon with a solution for this problem.

Kind regards,

Razvan.

1,714 Views
vinicius_olivei
Contributor III

Thank you for the fast response Razvan.

This is how the code looks like:

pastedImage_2.png

0 Kudos

1,714 Views
constantinrazva
NXP Employee
NXP Employee

Hello vinicius.oliveira@enfas.de‌,

I have come to the same conclusion and I made the changes necessary. Please replace the following file with the one attached here:

{ROOT_DIR}\mbdtbx_s32k14x\mbdtbx_s32k14x\blocks\fcan\fcan_s32k14_receive.tlc

Could you confirm that with this fix everything is working?

P.S.: Thank you for pointing it out and for your advice on the matter. We will be posting it on the https://community.nxp.com/thread/489947 page, in our cumulative patch after we get your feedback and we make some tests internally.

Kind regards,

Razvan.

0 Kudos