Arduino-STM32-CAN icon indicating copy to clipboard operation
Arduino-STM32-CAN copied to clipboard

Sending data issue

Open banbeiduyao opened this issue 1 year ago • 9 comments

I am currently using one F405, one F103, and USB to CAN for testing. There is no problem transferring data between USB to CAN and F103. However, after connecting F405 to send data for a period of time, F103 cannot send data. The reason cannot be determined! Screenshots of normal and abnormal situations e7c0651bdea610a1bf860f1d3fdaa39 910061234ba317e61b302793ac4d3f9

banbeiduyao avatar Mar 20 '24 13:03 banbeiduyao

What exactly is USB to CAN?

nopnop2002 avatar Mar 20 '24 13:03 nopnop2002

CAN data can be monitored through a computer

banbeiduyao avatar Mar 20 '24 13:03 banbeiduyao

It works correctly when there are two nodes, USB to CAN and F103.

It works correctly when there are two nodes, USB to CAN and F405.

It works correctly when there are two nodes, F103 and F405.

However, it does not work correctly when there are three nodes: USB to CAN, F103, and F405.

Is this understanding correct?

nopnop2002 avatar Mar 20 '24 13:03 nopnop2002

Yes, as long as F405 is connected, F103 will fail to send data after a period of time, and the time may not be certain

banbeiduyao avatar Mar 20 '24 13:03 banbeiduyao

It works correctly when there are two nodes, USB to CAN and F103. ---> The CAN bus has a short stub length.

It works correctly when there are two nodes, USB to CAN and F405. ---> The CAN bus has a short stub length.

It works correctly when there are two nodes, F103 and F405. ---> The CAN bus has a short stub length.

However, it does not work correctly when there are three nodes: USB to CAN, F103, and F405. ---> The CAN bus stub length is a little longer.


The CAN bus stub length may be too long. ISO11898 Standard specifies a maximum bus length of 40m and maximum stub length of 0.3m at 1Mbps. See here.

Or Lowering the Bit-Rate may solve the problem.

nopnop2002 avatar Mar 20 '24 13:03 nopnop2002

Thank you very much, but the wiring distance here is very short. F405>>5cm>>F103>>20cm>>USB-CAN

banbeiduyao avatar Mar 20 '24 14:03 banbeiduyao

The problem may be solved by lowering the Bit-Rate or changing the value of the terminating resistor.

The value of the terminating resistor is related to the length of the CAN-BUS. However, obtaining accurate resistance values ​​requires extremely difficult calculations.

nopnop2002 avatar Mar 20 '24 14:03 nopnop2002

Okay, I'll test it again. Thank you

banbeiduyao avatar Mar 20 '24 14:03 banbeiduyao

If you have a mix of 3.3V and 5V transceivers, a +1V ground shift using split termination can be very effective. Check out Figure 7 here. https://www.ti.com/lit/an/slla337/slla337.pdf


Please check again if the Bus is as shown below.

Terminator--F405--5cm--F103--20cm--USB-CAN--Terminator

nopnop2002 avatar Mar 20 '24 14:03 nopnop2002