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
已解决! 转到解答。
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
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
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?
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