S32K118 CAN RX MB MASK

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K118 CAN RX MB MASK

跳至解决方案
445 次查看
Pohsuan
Contributor III

Hello NXP team,

I'm trying to configure the CAN RX message buffer global mask, based on the reference article in the link below.

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K1xx-FlexCAN-Mask-Setting-Demo/ta-p/1519753

https://community.nxp.com/t5/S32K/S32K344-FlexCAN-How-to-setup-Rx-MB-mask-to-receive-the-CAN-FD/m-p/...

 

However, on my current CAN bus setup, I can only receive messages with IDs 0x300 and 0x400. I’m not able to receive IDs in the ranges 0x301 ~ 0x37F and 0x401 ~ 0x47F.

Am I missing any configuration?

Please check my project as attachment, and provide me some advice, Thank you!

 

标记 (1)
0 项奖励
回复
1 解答
420 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if receiving std ID you need to shift mask accordingly. The API does not do any shifting for mask register setup. So use

FlexCAN_Ip_SetRxMbGlobalMask(INST_FLEXCAN_0, 0x780<<18);

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
2 回复数
421 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if receiving std ID you need to shift mask accordingly. The API does not do any shifting for mask register setup. So use

FlexCAN_Ip_SetRxMbGlobalMask(INST_FLEXCAN_0, 0x780<<18);

BR, Petr

0 项奖励
回复
406 次查看
Pohsuan
Contributor III

Hello PetrS,

Thank you for your guidance. I was able to successfully receive the CAN messages.

When I using FlexCAN_Ip_SetRxMbGlobalMask, I needed to left-shift the mask value by 18 bits.
Is this behavior related to the version of the RTD library, or is it due to differences between the S32K118 and S32K344?

For reference, I’m currently using:
S32K1_RTD_2_0_0_P04_D2404_ASR_REL_4_7_REV_0000_20240417

Pohsuan_0-1746583811029.png

 

标记 (1)
0 项奖励
回复