XMC4500 Relax Kit - Help with CAN001

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

cross mob
Not applicable
Hi.

So I recently started programming using DAVE 3.1.10 and using an XMC4500 Relax Kit Lite and I'm having difficulty establishing a communication using CAN. I already tried the CAN examples but those didn't help me much.

I'm using the CAN001 app and I can successfully transmit a message, but I'm not able to receive it on the other end. I already tried several different methods (one CANApp, two CANApps (one for transmitting and another for receiving), same LMO, two LMOs, acceptance mask at 0, just to name a few) and none of them are working. So obviously I'm doing something wrong.

Here's my main:


int main(void)
{
uint8_t Data[8] = {0xAA,0xAA,0xAA,0xAA,0x55,0x55,0x55,0x55}; /* This was just to test the signal on my oscilloscope */

DAVE_Init();

// Update data value to be transmitted in LMO1
CAN001_UpdateMODataRegisters(&CAN001_Handle0,1,8,Data);

// Send data frame
CAN001_SendDataFrame(&CAN001_Handle0,1);

while(1)
{
}

return 0;

}



This sends the message using the LMO1 of the CAN001 app, right? So now I need help in order to receive this message. Please tell me what I have to do, like do I have to create another CAN001 app, or do I just use one app but have to use different LMOs, what kind of interrupts do I need, everything. I've been stuck on this problem for hours and can't figure it out on my own.

I'm also not using Loop Back mode. I'm physically connecting the ports on my Relax Kit using a wire in order to test if the messages are being received.

Thank you so much in advance, every bit of help is appreciated.

Telmo
0 Likes
3 Replies
Not applicable
HI Telmo,

If you would like to connect 2 CAN Nodes, you will need 2 instances of the CAN001 APP. The reason that your project is failing is because you are not connecting the Nodes through CAN transceivers.

Although XMC4500 Relax Lite Kit have connections to the CAN Node signals, it does not have on-board CAN Transceivers. Since you have configured the project for external bus communication( External CAN bus communication requires transceivers), this results in LEC error( Bit0 error).

Extracted from XMC4500 RM, Chapter 18 Controller Area Network (MultiCAN), Table 18-7 Encoding of the LEC Bit Field
Bit0 Error:
Two different conditions are signaled by this code:
1. During transmission of a message (or acknowledge bit, active-error flag, overload flag), the CAN node tried to send a dominant level (0), but the monitored bus value was recessive.
2. During bus-off recovery, this code is set each time a sequence of 11 recessive bits has been monitored. The CPU may use this code as indication that the bus is not continuously disturbed.

For this evaluation, you can consider to use CPU Board (KIT_XMC45_EE1_002) with Satellite Card (KIT_XMC4X_COM_ETH_001)
KIT_XMC45_EE1_002: http://www.infineon.com/cms/en/product/evaluation-boards/KIT_XMC45_EE1_002/productType.html?productT...
KIT_XMC4X_COM_ETH_001: http://www.infineon.com/cms/en/product/evaluation-boards/KIT_XMC4X_COM_ETH_001/productType.html?prod...

Hope this helps.

Regards,
Daryl 🙂
0 Likes
Not applicable
Hi Daryl. Thank you for the response!

I didn't realize that the Relax Kit didn't actually have on-board CAN transceivers! I connected the Relax Kit to another board with CAN transceivers and it worked! I thought that either my code or my apps had some error that I wasn't seeing, but it was just that problem with the transceivers.

Your help was much appreciated!

Regards,
Telmo
0 Likes
Not applicable
Hi Telmo,

No problem. 🙂

Cheers!
Daryl
0 Likes