Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
saikiran
Level 1
Level 1
10 sign-ins First reply posted First like given

we can able to communicate with the external CAN devices using CAN0, node0 only. 

With this line g_mcmcan.canFilter.id1 = CAN_MESSAGE_ID; we can able to get only the message with that particular CAN_MESSAGE_ID (working as per protocol). But how to configure multiple message objects in order to accept multiple Can messages with different Identifiers? Lets say I want to receive with IDs, 0x01, 0x02, 0x111, 0x777 .... 

I found this in Infineon libraries.

// set filter for Rx Buffer 0
 {
 // Initialize the filter structure
 IfxCan_Filter filter;

 filter.number = 0;
 filter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
 filter.id1 = 0x00;
 filter.rxBufferOffset = IfxCan_RxBufferId_0;

 IfxCan_Can_setStandardFilter(&canNode[0], &filter);
 }

 // set filter for rxBuffer 1
 {
 IfxCan_Filter filter;

 filter.number = 1;
 filter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
 filter.id1 = 0x7ff;
 filter.rxBufferOffset = IfxCan_RxBufferId_1;

IfxCan_Can_setStandardFilter(&canNode[0], &filter);
 }

In this way we tried but only the first configured one is getting configured and receiving messages from that particular id.

Can you please help me?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Kavya_B
Moderator
Moderator
Moderator
10 likes given 25 solutions authored 5 likes given

Hello @saikiran ,

I have modified the Aurix MCMCAN example code 'MCMCAN_1
for KIT_AURIX_TC375_LK' (link: https://www.infineon.com/dgdl/Infineon-MCMCAN_1_KIT_TC375_LK-Training-v01_00-EN.pdf?fileId=5546d4627... to communicate with an external CAN bus. I have configured one Tx message and three Rx messages from/to the same CAN node (CAN node 0). I have tested this on Aurix Lite kit with TC375 successfully.

Please find the attached zipped folder with modified files. In order to test this, please import the above mentioned example project on Aurix development studio and replace the corresponding files in the workspace of the example project with the files I have provided.

Hope this helps you. Please post if you have any further questions.

 

Thanks,

Kavya

View solution in original post

1 Reply
lock attach
Attachments are accessible only for community members.
Kavya_B
Moderator
Moderator
Moderator
10 likes given 25 solutions authored 5 likes given

Hello @saikiran ,

I have modified the Aurix MCMCAN example code 'MCMCAN_1
for KIT_AURIX_TC375_LK' (link: https://www.infineon.com/dgdl/Infineon-MCMCAN_1_KIT_TC375_LK-Training-v01_00-EN.pdf?fileId=5546d4627... to communicate with an external CAN bus. I have configured one Tx message and three Rx messages from/to the same CAN node (CAN node 0). I have tested this on Aurix Lite kit with TC375 successfully.

Please find the attached zipped folder with modified files. In order to test this, please import the above mentioned example project on Aurix development studio and replace the corresponding files in the workspace of the example project with the files I have provided.

Hope this helps you. Please post if you have any further questions.

 

Thanks,

Kavya