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:
signature.asc
Description: PGP signature