linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Stefan Althöfer" <Stefan.Althoefer@janztec.com>
Cc: "Thomas.Kopp@microchip.com" <Thomas.Kopp@microchip.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: AW: mcp251xfd: Bad message receiption
Date: Thu, 22 Dec 2022 14:02:19 +0100	[thread overview]
Message-ID: <20221222130219.xrfnm54g6lfjozvs@pengutronix.de> (raw)
In-Reply-To: <FR0P281MB1966CA0C12ED24574368A36E97E89@FR0P281MB1966.DEUP281.PROD.OUTLOOK.COM>

[-- Attachment #1: Type: text/plain, Size: 3692 bytes --]

On 22.12.2022 10:30:22, Stefan Althöfer wrote:
> Hi Thomas,
> 
> > Do I read the pdf correctly (based on the /var/log stuff) that you have two MCP2518FD connected to a Pi4B and 
> > both of them are running in internal/external loopback mode no interaction between them and the SPIs are separate?
> 
> Yes. For the loopback test the CANs are separate. Errors also occur when sending messages between
> the controllers, but I think that is more difficult to analyze.
> 
> root@raspberrypi:~# ip -d -s a s can0
> 4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP group default qlen 1000
>     link/can  promiscuity 0 minmtu 0 maxmtu 0
>     can <LOOPBACK,BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
>           bitrate 1000000 sample-point 0.800
>           tq 25 prop-seg 15 phase-seg1 16 phase-seg2 8 sjw 6
>           mcp251xfd: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..256 brp-inc 1
>           dbitrate 4000000 dsample-point 0.800
>           dtq 25 dprop-seg 3 dphase-seg1 4 dphase-seg2 2 dsjw 2
>           mcp251xfd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..256 dbrp-inc 1
>           clock 40000000
>           re-started bus-errors arbit-lost error-warn error-pass bus-off
>           0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
>     RX: bytes  packets  errors  dropped missed  mcast
>     3097429872 2517466658 0       0       0       0
>     TX: bytes  packets  errors  dropped carrier collsns
>     3696197680 1258733264 0       0       0       0
> root@raspberrypi:~# ip -d -s a s can1
> 5: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP group default qlen 1000
>     link/can  promiscuity 0 minmtu 0 maxmtu 0
>     can <LOOPBACK,BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
>           bitrate 1000000 sample-point 0.800
>           tq 25 prop-seg 15 phase-seg1 16 phase-seg2 8 sjw 6
>           mcp251xfd: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..256 brp-inc 1
>           dbitrate 4000000 dsample-point 0.800
>           dtq 25 dprop-seg 3 dphase-seg1 4 dphase-seg2 2 dsjw 2
>           mcp251xfd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..256 dbrp-inc 1
>           clock 40000000
>           re-started bus-errors arbit-lost error-warn error-pass bus-off
>           0          112256     0          1          3          1         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
                       ^^^^^^                ^          ^          ^
>     RX: bytes  packets  errors  dropped missed  mcasta
>     2590649888 773910314 3       0       0       0
>     TX: bytes  packets  errors  dropped carrier collsns
>     3442619696 386944310 112254  12      0       0

Why do you have so many errors on can1? The device event went into bus-off.

> This is the SPI setup for the dual CAN PI:
> 
> dtparam=spi=on
> dtoverlay=spi6-1cs
> # mcp251xfd DTS for RPI4 default CAN on SPI6.0
> dtoverlay=mcp251xfd-spi6-0,interrupt_pin=25,oscillator=40000000
> # mcp251xfd DTS for RPI4 CAN extension on SPI0.0
> dtoverlay=mcp251xfd,spi0-0,interrupt=16,oscillator=40000000
> 
> Or did you mean something else with "script"?

Can you share your "scselftest" program?

> I'll try the register dump when I suffer the next error ;-)

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-22 14:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22  7:44 mcp251xfd: Bad message receiption Stefan Althöfer
2022-12-22  9:07 ` Thomas.Kopp
2022-12-22 10:30   ` AW: " Stefan Althöfer
2022-12-22 13:02     ` Marc Kleine-Budde [this message]
2022-12-23  8:18       ` AW: " Stefan Althöfer
2022-12-23 19:25         ` Marc Kleine-Budde
2022-12-24 15:57         ` Marc Kleine-Budde
2022-12-30 22:51           ` AW: " Stefan Althöfer
2023-01-01 10:43             ` Stefan Althöfer
2023-01-04 15:55               ` Stefan Althöfer
2023-01-09  7:10                 ` AW: AW: AW: mcp251xfd: Bad message receiption (1/2) Stefan Althöfer
2023-01-10 12:50                   ` Thomas.Kopp
2023-01-10 14:53                     ` Marc Kleine-Budde
2023-01-10 17:08                       ` Marc Kleine-Budde
2023-01-10 18:39                         ` Marc Kleine-Budde
2023-01-10 21:40                           ` Thomas.Kopp
2023-01-10 21:50                             ` Marc Kleine-Budde
2023-01-10 22:37                               ` Marc Kleine-Budde
2023-01-10 22:43                                 ` Marc Kleine-Budde
2023-01-11  8:17                                   ` Marc Kleine-Budde
2023-01-11 11:54                                     ` Marc Kleine-Budde
2023-01-09  7:10                 ` AW: AW: AW: mcp251xfd: Bad message receiption (2/2) Stefan Althöfer
2022-12-22 14:51 ` mcp251xfd: Bad message receiption Marc Kleine-Budde

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=20221222130219.xrfnm54g6lfjozvs@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Stefan.Althoefer@janztec.com \
    --cc=Thomas.Kopp@microchip.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).