In https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RT1052-FLEXCAN-for-any-ID-communication/t... ,you tell us how to use RT1052 FLEXCAN for any IDs communication.However, I need to know how to use RT1052 FLEXCAN for five or so different IDs (for example,0x18554400,0x18557800,0x18214400,0x13557800,0x10554400)communication and thus the other IDs communication will not performed.
Solved! Go to Solution.
Hi @FromCH0 ,
Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.
If you need more ID filter, then you can use more MB, then set the individual MASK for the related MB,
You can check the SDK API:
void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask)
Define the different MB, then configure the related mask, then it will just receive your defined IDs.
Wish it helps you!
Best Regards,
Kerry
Wish it helps you!
Hi @FromCH0 ,
Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.
If you need more ID filter, then you can use more MB, then set the individual MASK for the related MB,
You can check the SDK API:
void FLEXCAN_SetRxIndividualMask(CAN_Type *base, uint8_t maskIdx, uint32_t mask)
Define the different MB, then configure the related mask, then it will just receive your defined IDs.
Wish it helps you!
Best Regards,
Kerry
Wish it helps you!
Than you very much!I'll try.
Hi @FromCH0 ,
You are welcome!
If you have issues, just let me know.
If your question is solved, please tell me to mark the correct answer, just close this case, thanks.
Best Regards,
Kerry
mb_config_0.format=kFLEXCAN_FrameFormatExtend; //扩展帧
mb_config_0.type=kFLEXCAN_FrameTypeData; //数据帧
mb_config_0.id=FLEXCAN_ID_EXT(can2_rxid_0); //接收的帧ID
FLEXCAN_SetRxMbConfig(CAN2,8,&mb_config_0,true);
mb_config_1.format=kFLEXCAN_FrameFormatExtend; //扩展帧
mb_config_1.type=kFLEXCAN_FrameTypeData; //数据帧
mb_config_1.id=FLEXCAN_ID_EXT(can2_rxid_1); //接收的帧ID
FLEXCAN_SetRxMbConfig(CAN2,10,&mb_config_1,true);
FLEXCAN_SetRxIndividualMask(CAN2,8,FLEXCAN_RX_MB_EXT_MASK(can2_rxid_0,0,0));
FLEXCAN_SetRxIndividualMask(CAN2,10,FLEXCAN_RX_MB_EXT_MASK(can2_rxid_1,0,0));
以上是我的测试程序的部分内容,测试程序接收到了指定的多个ID号的数据。
感谢!