s32K144 CAN0 RXIMR registers doesn't work wellt

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

s32K144 CAN0 RXIMR registers doesn't work wellt

跳至解决方案
3,301 次查看
shingozhou
Contributor III

Hi, I have a question about RXIMR register of instance CAN0 using SDK 0.8.4 release.

Inorder to receive the can frame those ID between 0x500 to 0x57F and FLEXCAN_RX_FIFO_ID_FORMAT_A, I use RxFiFo filter, and set the related register belows:

1. CAN0->RAMn[24 + 0] = ((0x500 << FLEXCAN_RX_FIFO_ID_FILTER_FORMATA_STD_SHIFT) &       FLEXCAN_RX_FIFO_ID_FILTER_FORMATA_STD_MASK);

2. CAN0->RXIMR[0] = (0x780 << CAN_ID_STD_SHIFT) & CAN_ID_STD_MASK;

But the result is that CAN0 could only receive the incoming frame which ID is 0x500, and it does not achieve my requirements. So, Is there no distinction betwen setting RXIMR = 0xFFFFFFFF and RXIMR = (0x780 << CAN_ID_STD_SHIFT)? The RXIMRs register are not useful register?

Best regards,

shingo

标签 (1)
标记 (1)
1 解答
2,766 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do you have CAN_MCR[IMRQ] set?

The CAN_MCR[IRMQ] bit determines which mask register is used for the RXFIFO ID table elements.

If CAN_MCR[IRMQ]=0 then all ID Table is affected by RXFGMASK. If CAN_MCR[IRMQ]=1, elements in ID table are affected by Individual Mask Registers (RXIMRx) according setting of CTRL2[RFFN].

BR, Petr

在原帖中查看解决方案

4 回复数
2,767 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do you have CAN_MCR[IMRQ] set?

The CAN_MCR[IRMQ] bit determines which mask register is used for the RXFIFO ID table elements.

If CAN_MCR[IRMQ]=0 then all ID Table is affected by RXFGMASK. If CAN_MCR[IRMQ]=1, elements in ID table are affected by Individual Mask Registers (RXIMRx) according setting of CTRL2[RFFN].

BR, Petr

2,766 次查看
shingozhou
Contributor III

Petr:

How many elements are there in the register CAN_RXIMR? On one hande, it have 32 in the Reference Manual, On the other hand it have 16 In the SDK 0.8.4 release. Could I modify the macro definition directly in the SDK?

1526284634(1).png

1526284581(1).png

0 项奖励
回复
2,766 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

on the S32K144 FlexCAN_0 has 32 MBs and so 32 RXIMRs. FlexCAN_1 and FlexCAN_2 modules have 16 MBs and 16 RXIMRs.

You can modify the header file, but also you have to reduce the length of RESERVED_6 array accordingly.

The header in the SDK 0.8.6 has 32 for CAN_RXIMR_COUNT.

BR, Petr

2,766 次查看
shingozhou
Contributor III

Petr:

Thank you for you advice!

It's successful to solve the problem.

BR,

shingo 

0 项奖励
回复