cancel
Showing results for 
Search instead for 
Did you mean: 

Does CAN Loopback test will send frames out from TX pin and we can monitor them either on TX pin or Transceiver H/L Vs ground connected. User manual refers to we can monitor Tx signal when scope is connected.

HKuma.1
Associate II
 
5 REPLIES 5
YS.K
Associate III

According to the BxCAN manual,

Loopback + Silent mode does not transmit CAN frames to TX pins and only frame loopback operation.

Figure 388. bxCAN in loop back mode

Controller area network (bxCAN) RM0390

1038/1328 RM0390 Rev 4

30.5.2 Loop back mode

The bxCAN can be set in Loop Back Mode by setting the LBKM bit in the CAN_BTR

register. In Loop Back Mode, the bxCAN treats its own transmitted messages as received

messages and stores them (if they pass acceptance filtering) in a Receive mailbox.

This mode is provided for self-test functions. To be independent of external events, the CAN

Core ignores acknowledge errors (no dominant bit sampled in the acknowledge slot of a

data / remote frame) in Loop Back Mode. In this mode, the bxCAN performs an internal

feedback from its Tx output to its Rx input. The actual value of the CANRX input pin is

disregarded by the bxCAN. The transmitted messages can be monitored on the CANTX pin.

I am using loopback only mode. and don't see any frames on Tx pin

You're right.

In loopback only mode, after the send, the can frame output should be to the Tx pin.

Did you CAN test using STM32CubeMX library?

I'm testing on the Nucleo-L476RG board using the CubeMX CAN library,

and loopback work is okay, but there is same phenomenon what I can not output CAN Tx Rx.

CAN Tx Rx is okay on the STM32CubeMX CAN library with STM32F103 MCU.

May I ask what MCU model & CAN library what you are using?

Tetrastruct
Associate II

I have the same situation.

I use the STM32F103 MCU with St32CubeIDE, Loopback Mode singulär.

No TX activities are to see.

HAL_CAN_AddTxMessage(&hcan, &pTxHeader,&canoutdatas_hello, &pTxMailbox);

is regulary invoked every 1ms in a timer interrupt.

No errors at compilation,CAN initialized and started, pTxHeader sttruct filled with

 pTxHeader.DLC =8;

 pTxHeader.IDE = CAN_ID_STD;

 pTxHeader.RTR = CAN_RTR_DATA;

 pTxHeader.StdId=0x222;

 pTxHeader.TransmitGlobalTime=DISABLE;

what is wrong that I do not see the frame at TX ?

Output signals and inputs to external Tx and Rx pins do not work in the "loopback mode" & "silent mode" of the BxCAN on the STM32 MCU.

CAN function worked that the STM32F103 MCU and the ST32CubeMx CAN library (with CAN normal mode).

Test the STM32CubeMx after changing the CAN setting to "normal mode".