Electronic – CAN module in STM32F207 – continuously transmitting the same message

can

I have configured the CAN module in a STM32F207 to transmit at 1 Mbit/s. The program is such that it will transmit the same CAN frame for every 2 ms. I observe that even if the code is not executing the transmit function, the data is continuously coming on the CAN port, unless I clear all the mailboxes.

How can I overcome this situation?

Best Answer

CAN modules will retransmit until they see an acknowledgement, so you need at least one other CAN device on the same bus with the same baud rate settings in receive mode. In CAN, the acknowledgement is done inside the ACK bit towards the end of the frame, rather than as a separate message.

More details are in the paper Introduction to the Controller Area Network (CAN) from Texas Instruments.

It is also important to follow the rules for the terminating resistors, especially at high data rates and/or long cables, but even at lower rates and shorter cables. For example, I have noticed that I can get away with one terminator with a few meters of cable at 125 kbaud, and it will not work with no terminators. As the cable gets longer, it becomes necessary to have the two usual terminators. Obviously this is more critical at 1 Mbaud.