2020-06-12 07:44 AM
2020-06-12 08:00 AM
According to the BxCAN manual,
Loopback + Silent mode does not transmit CAN frames to TX pins and only frame loopback operation.
2020-06-12 08:16 AM
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
2020-06-13 05:24 AM
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?
2022-05-05 10:18 AM
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 ?
2022-05-05 09:15 PM
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".