cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding CAN external loopback mode

ranran
Senior II

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

9 REPLIES 9
Uwe Bonnes
Principal II

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

turboscrew
Senior III

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
Senior II

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?

>>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 Up vote any posts that you find helpful, it shows what's working..
turboscrew
Senior III

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

ranran
Senior II

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

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 Up vote any posts that you find helpful, it shows what's working..

At least that should work.

turboscrew
Senior III

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.