sjw in can_calc_bittiming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

we recently had a case here where one member of a CAN bus couldn't receive
frames with data content of only zeros:

$ cansend can0 123#0000000000000000

After some investigation we found the root cause to be a slight difference
(about 1%) in actual bitrates of the two members. The one with showed the
RX errors had a sjw value of 1 and a lot of time quanta (40) due to the 40MHz
CAN clock.

This leads to a build up of phase error (as sjw is not able to compensate for
enough of the bitrate difference) which at some point leads to a framing
error due to missing a stuff bit. Playing around with the sample point can
improve or worsen the behavior.

We can fix this quite easily by specifying a higher sjw value.

Question is now:
Wouldn't it make sense to increase sjw in can_calc_bittiming() to something
like 5% of the total time quanta? This may increase the reliability of the CAN
network when there are differences in the bitrates of the single members. Are
there any arguments against such an arbitrary selection of sjw?

If you agree with such a change I can come up with a proper patch. If I wrote
totally nonsense please tell me :-)

Regards

Matthias



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux