Re: mcp251xfd: loopback test on waveshare canfd hat

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

 



On Mon, Nov 2, 2020 at 3:22 PM Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote:
>
> On 11/2/20 3:20 PM, Drew Fustini wrote:
> > I am able to have can0 (spi0.0) and can1 (spi1.0) initialize ok on the
> > waveshare canfd hat (solder jumper mode A) with the mcp251xfd driver
> > from Marc's rpi 5.4 branch.  However, I am not able to do a loopback
> > test successfully.
> >
> > No errors from setup:
> > sudo ip link set can0 type can bitrate 250000 listen-only on
> > sudo ip link set can1 type can bitrate 250000 listen-only on
>                                                 ^^^^^^^^^^^^^^
>
> It really does listen-only on the bus, i.e. not send anything :)
>
> Marc

Thanks for pointing that out!  /me might need new glasses :)

The can0->can1 test is now working with mcp251xfd:

pi@raspberrypi:~$ sudo ip link set can0 type can bitrate 250000
pi@raspberrypi:~$ sudo ip link set can1 type can bitrate 250000
pi@raspberrypi:~$ sudo ifconfig can0 up
pi@raspberrypi:~$ sudo ifconfig can1 up
pi@raspberrypi:~$ dmesg |tail
[   75.751015] mcp251xfd spi0.0 can0: bit-timing not yet defined
[   75.811003] mcp251xfd spi1.0 can1: bit-timing not yet defined
[   96.934271] mcp251xfd spi0.0 can0: FIFO setup: TEF: 8*12 bytes = 96
bytes, TX: 8*16 bytes = 128 bytes
[   96.934292] mcp251xfd spi0.0 can0: FIFO setup: RX-0: 32*20 bytes = 640 bytes
[   96.934308] mcp251xfd spi0.0 can0: FIFO setup: free: 1184 bytes
[   96.942154] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[   97.020451] mcp251xfd spi1.0 can1: FIFO setup: TEF: 8*12 bytes = 96
bytes, TX: 8*16 bytes = 128 bytes
[   97.020464] mcp251xfd spi1.0 can1: FIFO setup: RX-0: 32*20 bytes = 640 bytes
[   97.020474] mcp251xfd spi1.0 can1: FIFO setup: free: 1184 bytes
[   97.990436] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready

pi@raspberrypi:~$ candump can1 &
[1] 1037
pi@raspberrypi:~$ cansend can0 01a#11223344AABBCCDD
  can1  01A   [8]  11 22 33 44 AA BB CC DD

thanks,
drew



[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