Linux CAN drivers development
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Cc: Ratheendran <ba.rsrajeshwaran@tataelxsi.co.in>,
	linux-can@vger.kernel.org, John Whitmore <arigead@gmail.com>
Subject: Re: detect auto baud rate on can bus in linux driver.
Date: Tue, 29 Apr 2014 14:12:02 +0000	[thread overview]
Message-ID: <e8ee658e497ba57266139a0de5645e71@grandegger.com> (raw)
In-Reply-To: <20140429133355.GA20084@vandijck-laurijssen.be>

On Tue, 29 Apr 2014 15:33:55 +0200, Kurt Van Dijck
<dev.kurt@vandijck-laurijssen.be> wrote:
> On Tue, Apr 29, 2014 at 12:57:05PM +0530, Ratheendran wrote:
>> Thanks John , Kurt Van Dijck for your valuable support.
>> 
>> I am going ahead with the shell script & iproute2 supported tool
testing
>> a set
>> of fixed baud rate from table.
>> 
>> My observations with the existing imx6 flexcan hardware running linux
>> 3.0.x.
>> 
>> Two imx6 board ,both are enabled for FLEXCAN  communication.
>> CAN dev bring up command with baud rate.
>> command -> ip link set can0 up type can bitrate 125000

For bus error reporting the option "berr-reporting on" needs to
be added. Otherwise only CAN error state changes will be send.

>> one board run cansend while other end candump--e command

It's good practice to use:

 # candump -td -e any,0:0,#FFFFFFFF

> 
> The 'autobaud' node must do
> 	$ ip link set canX type can listen-only on
> 
>> 
>> 
>> Case 1 both imx6 operate on same CAN baudrate
>>   cansend can0 -i0x100 11 22 33 44
>>   on candump terminal I receive  <0x100> [4] 0b 16 21 2c
> 
> Do you use the latest tools from gitorious?
> The syntax of cansend and the output of candump look different.
> 
> [...]
>>   Case 2: imx6 CAN on different baud rate. 
>>  received packets( I am not able to interpret the below packet)
>>  <0x004> [8] 00 04 00 00 00 00 00 00 
> 
> Well, this is not ok.

Ratheendran, what kernel version are you using? Your flexcan driver might
have (old) issues.

> I'd expect an error or status frame, but I don't see it in your candump
> output.

Me too, that's weird.

> I do notice that the received frame has 8 bytes, and only 1 bit set.
> So, if I suppose that the CAN_ERR_FLAG has been set,
> I see (with include/linux/can/error.h aside)
> <0x004> Controller problem, info in data[1]
> 
> data[1] 04: Reached warning level for RX errors.
> 
> I'd expect something like that.
> Wolfgang Grandegger may explain more, as he did author these.

Sounds reasonable, also because the rx error counter did reach 128.

> Next step is to make a script that does all that, and that makes candump
> stop after a limited time (few seconds).
> I would suggest to skip a baudrate if you receive any error frame, so
the
> interpretation may be not necessary.

Wolfgang.


      reply	other threads:[~2014-04-29 14:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 13:20 detect auto baud rate on can bus in linux driver Ratheendran
2014-04-27  9:44 ` John Whitmore
2014-04-27 18:01   ` Kurt Van Dijck
2014-04-29  8:33     ` Ratheendran S. Rajeshwaran
2014-04-29  8:35       ` Ratheendran S. Rajeshwaran
2014-04-29 19:58       ` Robert Schwebel
     [not found]         ` <5360E8A6.8040204@tataelxsi.co.in>
2014-04-30 14:41           ` Kurt Van Dijck
2014-04-30 16:35             ` Oliver Hartkopp
2014-05-01 18:49               ` Kurt Van Dijck
     [not found]                 ` <5363243E.7070406@tataelxsi.co.in>
2014-05-02 11:00                   ` Kurt Van Dijck
2014-04-29 12:47     ` Heinz-Jürgen Oertel
     [not found]       ` <535FA7BB.3070700@tataelxsi.co.in>
2014-04-29 14:12         ` Heinz-Jürgen Oertel
     [not found]     ` <535F5449.7000108@tataelxsi.co.in>
2014-04-29 13:33       ` Kurt Van Dijck
2014-04-29 14:12         ` Wolfgang Grandegger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8ee658e497ba57266139a0de5645e71@grandegger.com \
    --to=wg@grandegger.com \
    --cc=arigead@gmail.com \
    --cc=ba.rsrajeshwaran@tataelxsi.co.in \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox