AUIRX tc387 CAN0 not receiving messages

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
Hi, Iam using aurix TC387 evaluation board. I can able to send CAN Tx message with a particular message ID and sucesfully received at the other end. But I cannot receive messages from the other end. I found only one example for this with loopback mode and could not find any example related to CAN0 reception and message box configuration. In libraries I did not found any function to configure message boxes. Can anyone help me please.
0 Likes
1 Solution
Nambi
Moderator
Moderator
Moderator
500 replies posted 50 likes received 5 likes given

Hi,

Please configure the required message ID via CAN_MESSAGE_ID in the below code snippet and check.

g_mcmcan.canFilter.number = 0;
g_mcmcan.canFilter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
g_mcmcan.canFilter.id1 = CAN_MESSAGE_ID;
g_mcmcan.canFilter.rxBufferOffset = IfxCan_RxBufferId_0;

Best Regards.

View solution in original post

0 Likes
4 Replies
Nambi
Moderator
Moderator
Moderator
500 replies posted 50 likes received 5 likes given

Hi,

Did you check the discussion in the below thread and test the corresponding example code https://community.infineon.com/t5/AURIX-Development-Studio/CAN0-external-loopback-not-working-in-TC3...

Best Regards.

0 Likes
saikiran
Level 1
Level 1
10 sign-ins First reply posted First like given

Yeah, I checked the reference. With the code you have suggested TX is working and successfully reached to destination with message ID 0x777 as it is configured as transmit & receive frame type in source node_0. But the actual problem lies in receiving the CAN messages with other message id like 0x111. I am not understanding where I can configure message boxes? I tried to put break point inside RX interrupt service routine. But the breakpoint is not hitting. 

Can you please guide me?

0 Likes
Nambi
Moderator
Moderator
Moderator
500 replies posted 50 likes received 5 likes given

Hi,

Please configure the required message ID via CAN_MESSAGE_ID in the below code snippet and check.

g_mcmcan.canFilter.number = 0;
g_mcmcan.canFilter.elementConfiguration = IfxCan_FilterElementConfiguration_storeInRxBuffer;
g_mcmcan.canFilter.id1 = CAN_MESSAGE_ID;
g_mcmcan.canFilter.rxBufferOffset = IfxCan_RxBufferId_0;

Best Regards.

0 Likes
saikiran
Level 1
Level 1
10 sign-ins First reply posted First like given

So, Now we can able to communicate with the external world 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