All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Julien Pilet <julien@anemomind.com>,
	Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: Bad reading from mcp2515 with j1939
Date: Fri, 15 Apr 2016 16:52:55 +0200	[thread overview]
Message-ID: <57110047.3040305@grandegger.com> (raw)
In-Reply-To: <4C069C3C-A7B8-4D3D-BA66-0D2140E93996@anemomind.com>

Hello,

Am 15.04.2016 um 15:02 schrieb Julien Pilet:
> Hi,
>
> Thanks for your response.
>
> I managed to reproduce the error and validate that the reading is erroneous.
>
> I have one device sending can messages. I have two device reading, one being my mcp2515, the other is a usb nmea2000 adapter from actisense.
>
> Beside the changing sequence id (first byte) I expect to read always the same data. So I ran:
>
> ./candump can0  | grep 09FD0200 | grep -v "19 00 60 7A FA FF FF"
>
> It selects only the messages I’m interested in (09FD0200) and remove correct frames. Most frames are correct and are not displayed. A few frames show wrong values, though:
>    can0  09FD0200   [8]  AA 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  C2 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  AA 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  AE 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  A6 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  86 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  E6 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  8E 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  8E 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  A2 99 00 60 7A FA FF FF
>    can0  09FD0200   [8]  CA 99 00 60 7A FA FF FF
>
> It is again the MSB bit of byte number 2 which is wrong. It should show 19 00, not 99 00. On the other reading device, I see correctly 19 00. So the problem is in the reading.
>
> I tried switching triple-sampling on and off, but it does not change anything.
>
> I observed the same issue on different physical devices, so it is not an isolated issue.

Maybe the hardware does not work properly. Try lowering the SPI bus 
frequency or other hw parameters.

Wolfgang.

>
> Julien
>
>> On 15 avr. 2016, at 12:19, Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> wrote:
>>
>> I'm sure that your host does not introduce a problem.
>> The 80 00 appears on the wire. Your linux kernel can't change that :-)
>>
>> Can you validate your claim that this is erroneous?
>> Can you see these frames exactly the same on an other host?
>

  reply	other threads:[~2016-04-15 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  9:54 Bad reading from mcp2515 with j1939 Julien Pilet
2016-04-15 10:19 ` Kurt Van Dijck
2016-04-15 13:02   ` Julien Pilet
2016-04-15 14:52     ` Wolfgang Grandegger [this message]
2016-04-15 16:25       ` Julien Pilet
2016-04-15 16:34         ` Wolfgang Grandegger
2016-04-18  5:48           ` Wolfgang Grandegger
2016-04-18  4:29         ` Tom Evans
2016-04-15 13:07 ` Ramesh Shanmugasundaram

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=57110047.3040305@grandegger.com \
    --to=wg@grandegger.com \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=julien@anemomind.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.