Can Communication Doubts

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

cross mob
User11187
Level 2
Level 2
Dear all,

I'm trying to implement a CAN Communication between two xmc4500 based boards.
I configured CAN App to send one Tx message with ID 0x255 and the other board to receive one Rx message with ID 0x255.

When I start to debug I have the first board sending tx message continuously and other board doesn't receive anything. Why?
Could you help me to debug my system? I'm not an expert of can communication.

PS. I can see the Tx messages are sent correctly using a CAN sniffer.

Regards

Matteo
0 Likes
7 Replies
DRubeša
Employee
Employee
First solution authored First like received
Hi Matteo,

we can continue our discussion on this thread also. I will reply to that last question in other thread but here I will ask you to provide me the code for the transmitter and receiver board separately. In other thread you´ve sent me the modified example of loop-back mode, so I guess now you have separated code between two boards. As you mentioned, CAN sniffer can pick up properly transmitted messages so I guess the problem is with receiver board (software OR hardware issue).

Best regards,
Deni
0 Likes
lock attach
Attachments are accessible only for community members.
User11187
Level 2
Level 2
Dear Deni,

I attached two separate projects for React and Request.

As I said you I can read Tx messages sent continuously from my sniffer. Why this happens? I used only once transmit function.

Regards

Matteo
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
HI Matteo,

what I saw really quickly....in the example you sent me "Identifier Value" of TX message is 0x7FF, while "Identifier Value" of RX message is 0x255. Obviously, this cannot work.

Fix this and try again 🙂

Best regards,
Deni
0 Likes
lock attach
Attachments are accessible only for community members.
User11187
Level 2
Level 2
It doesnt' work anyway.

I would focus on a easier problem. I attached you the Rx project. I am using a software from to send messages in the bus. A board running react project is connected on the other side.
As soon as I send the message I receive "BUSHEAVY" error from my PC software. Using my oscilloscope I see a signal on CanH and CanL.
Maybe it is an hardware problem?

Matteo
0 Likes
User11187
Level 2
Level 2
In the support forum of the software PC I found this sentence: a Busheavy can occur when you want to send a CAN-message and no other CAN-node is able to send a acknowlegde frame (wrong baudrate, CAN-bus not connected, no CAN-termination, a CAN-bus system with only one CAN-node etc.)
0 Likes
User11187
Level 2
Level 2
After I use the function

CAN_NODE_MO_Transmit(&Request_Node_LMO_01_Config); the related interrupt arises and the function CAN_NODE_GetStatus return me 99
What does it means?

This information could be useful?
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Matteo,

I see there are still some issues present...the problem is that I cannot guarantee that the problem doesn´t come from hardware while you´re using your own CAN transceivers. So, we need to pinpoint the problem and exclude hardware or software cause.

So, regarding this 99 coming from "CAN_NODE_GetStatus" function...that would me that CAN controller went into bus-off state while it had to many unsuccessful transmit attempts.To verify this can you please check what is the value of NECNT register of the node that is trying to send the message. This way we can verify that the transmitting node is doing it´s job but the receiver part is not acknowledging messages.What´s also interesting is that you got also bits TXOK and RXOK set meaning that one transmission was successful. Additionally, you get "stuff error" that more than 5 equal bits where detected in a sequence in LEC bitfield. CAN transceivers should take care of that so I´m currently not understanding what´s causing exactly the issue for you.

As you said that "BUSHEAVY" error can occur because of multiple reasons, so I guess you should double check the things that are mentioned above (are you sure you use the same baudrate in the PC software as on your receiver board; can you double check that CAN transceiver is properly connected, and so on).

After that I have a suggestion. You should first try to run the loopback example once again...keep everything else the same but use loopback mode...then take a screenshot of your node´s registers (both of them, TX and RX), together with the accompanying MO registers BEFORE and AFTER transmit function has been used. Verify that CAN transmission was successful. Then connect everything as you need for you project and try again....compare the status of the register before transmit and after transmit occurs with the shots you took before in loopback mode. Take special care with NSR and MOSTAT register...the issue should be visible there.

Let me know how it went and best regards,
Deni
0 Likes