Skip to main content
ranran
Senior
November 7, 2019
Question

Understanding CAN external loopback mode

  • November 7, 2019
  • 7 replies
  • 7597 views

Hello,

STM32H7 contains example for  CAN external loopback mode.

In the readme there is no mention for the need of wiring a physical loopback between tx and rx pins.

Is it required in the external loopback mode ?

Thanks

This topic has been closed for replies.

7 replies

Uwe Bonnes
Chief
November 7, 2019

Probably CAN_TX and CAN_RX need to be connected and have some Pull-Up.

turboscrew
Senior III
November 7, 2019

I don't know about H7-devices, but in F4-devices the loopback is chip-internal. In normal loopback mode, the tx is connected to rx inside the chip, and the lines are also connected to the pins. In silent loopback mode, the connection to outside is cut off. It's only internal.

ranran
ranranAuthor
Senior
November 7, 2019

When I simply wire connect between them I don't get the transmitted frame,.

Is it not possible to do a physical loopback with can bus?

Tesla DeLorean
Guru
November 7, 2019

>>STM32H7 contains example for CAN external loopback mode.

This example?

STM32Cube_FW_H7_V1.5.0\Projects\STM32H743I-EVAL\Examples\FDCAN\FDCAN_Loopback

Please be SPECIFIC

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
turboscrew
Senior III
November 8, 2019

Connecting Tx and Rx lines should work too, but in normal, not loopback mode.

ranran
ranranAuthor
Senior
November 10, 2019

It did not work when I tried with with eval. It also seems that theoretically , there is a problem in trying to do it:

https://electronics.stackexchange.com/questions/224022/can-bus-test-via-loopback-possible-or-not

Tesla DeLorean
Guru
November 10, 2019

The device has an internal loop back for testing. If you want to test externally you could presumably wire up both CAN1 and CAN2, so the latter can monitor and acknowledge traffic.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
turboscrew
Senior III
November 10, 2019

At least that should work.

turboscrew
Senior III
November 10, 2019

There are two loopback modes in F4 CAN controllers - I suspect they are there in other chips too. The loopback-mode sends the data, but also receives it, if the filters are set that way. The quiet loopback mode doesn't send the data outside the chip, but the controller receives the sent message if the filters are set that way.