Receiving CAN Message from the wrong CAN-ID sometimes

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

cross mob
User19736
Level 1
Level 1
Hello,

I am using XMC4500 and have a problem, which occurs sometimes.
In general my CAN-Communication works fine.
Sometimes the received data and ID are mixed up with another message. For Example:
Receveid data:

Message 1) CAN ID: 0x181; Message: 0x19 00 1A 00 05 00 36 FF
Message 2) CAN ID: 0x141; Message: 0x67 8E 7B 8E 02 20 36 DD

My progamm process the message: CAN ID: 0x181 and Message 0x67 8E 7B 8E 02 20 36 DD
Therefore the data are not plausible.

Here is our can node configuration:

void canIf_xmcConfigNode(XMC_CAN_NODE_t * const can_node,
const XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t * const nodeConfig)
{
OS_DO_PRIVIL(XMC_CAN_NODE_NominalBitTimeConfigure(can_node, nodeConfig));
OS_DO_PRIVIL(XMC_CAN_NODE_EnableConfigurationChange(can_node));
OS_DO_PRIVIL(XMC_CAN_NODE_SetInitBit(can_node));
if(can_node == CAN_NODE0)
{
XMC_CAN_NODE_SetReceiveInput(can_node, XMC_CAN_NODE_RECEIVE_INPUT_RXDCC); //CAN.N0_RXDC
}
else
{
XMC_CAN_NODE_SetReceiveInput(can_node, XMC_CAN_NODE_RECEIVE_INPUT_RXDCA); //CAN.N1_RXDA , CAN.N2_RXDA
}

OS_DO_PRIVIL(XMC_CAN_NODE_DisableConfigurationChange(can_node));
OS_DO_PRIVIL(XMC_CAN_NODE_Enable(can_node));

/* Enable CAN Alert Interrupt */
OS_DO_PRIVIL(can_node->NCR |= CAN_NODE_NCR_ALIE_Msk);

}

I am using one MO for receiving messages.
For Transmit massages I am using separate MO for each CAN-ID.

For receive CAN-Mgs the XMC_CAN_MO_Receive function from XMClib v2.1.20 is used.
However, the message will received by an interrupt, which pushes the message into a queue.
The OS process it afterwards. With a debugger I found out, that the message is corrupted before it is pushed to the Queue.

We are using classB selftests from Hitex. In these selftest the interrupts will deactived for short moments.
Our guess is, that during the interrupt-deactivation the can-node wont work properly.
By incresing the deactivation of interrupts, the failure rate increases.

Do you have any idea, how i can reduce this failure?
i tried to use a fifo-Receive Buffer, without any change.

Best regards,
Thorben
0 Likes
1 Reply
User12345
Level 1
Level 1
5 sign-ins First reply posted Welcome!

Hi, 

We are facing the same problem. Were you able to solve the problem?

0 Likes