4 channel CAN-FD logger with Raspi5

CAN FD Interface for M.2 (PCIe)
Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Mon 26. Feb 2024, 17:05

Hi again,

just have a little problem to get it work. I followed the steps mentioned here to install the chardev driver: viewtopic.php?t=6897

In the first try, I just changed "make PCC=NO PCI=NO ISA=NO DNG=NO" to "make PCC=NO ISA=NO DNG=NO" to get the PCIe version installed. But even when building the driver just with "make" it does not show an interface when I look at it with "cat /proc/pcan". As I have the 4 channel version of your m.2 adapter, I think there should be listed 4 interfaces?

Any ideas what could be wrong? In the following some outputs of the console:

Code: Select all

logger@raspberrypi:~ $ lspci
0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2712 (rev 21)
0000:01:00.0 Network controller: PEAK-System Technik GmbH Device 001a (rev 01)
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2712 (rev 21)
0001:01:00.0 Ethernet controller: Device 1de4:0001

Code: Select all

logger@raspberrypi:~ $ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20240116_n (8.17.0) Feb 26 2024 14:35:00 --------------
*---------------------- [mod] [isa] [pci] [pec] [usb] -----------------------
*--------------------- 0 interfaces @ major 239 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status



End of file /boot/firmware/config.txt:

Code: Select all

...
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]
# Enable the PCIe external connector
dtparam=pciex1

# Force the GEN Speed to GEN1
dtparam=pciex1_gen=1

Code: Select all

logger@raspberrypi:~ $ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

i2c-dev
pcan

Code: Select all

logger@raspberrypi:~ $ lsmod | grep can
pcan                  245760  0
i2c_algo_bit           65536  1 pcan

G.Lang
Support
Support
Posts: 169
Joined: Wed 22. Sep 2010, 14:58

Re: 4 channel CAN-FD logger with Raspi5

Post by G.Lang » Tue 27. Feb 2024, 10:29

Hi,

please show the output of "uname -a"

Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Tue 27. Feb 2024, 10:48

here the desired output:

Code: Select all

logger@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.0-rpi8-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux
And additionally, I just connected your USB-CANFD-Dongle which apears in the output of cat/proc/pcan

Code: Select all

logger@raspberrypi:~ $ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20240116_n (8.17.0) Feb 26 2024 14:35:00 --------------
*---------------------- [mod] [isa] [pci] [pec] [usb] -----------------------
*--------------------- 1 interfaces @ major 239 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32  usbfd   -NA-        0 081 0x001c 00000000 00000000 00000000 00000000 0x0000


Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Tue 27. Feb 2024, 10:51

Have you applied the additional 5V supply on the "Hat Bottom" when testing? I just connected the circuit board cable.

G.Lang
Support
Support
Posts: 169
Joined: Wed 22. Sep 2010, 14:58

Re: 4 channel CAN-FD logger with Raspi5

Post by G.Lang » Tue 27. Feb 2024, 12:52

Hi,

our RPI5 settings are identical....hm..curious.
I don´t use the additional 5V supply, below a picture which shows the cabling.
pi5_with_m2.jpg
pi5_with_m2.jpg (30.5 KiB) Viewed 1096765 times

Please switch into the PEAK-Linux driver directory and do the following

-> sudo make uninstall
-> make clean
-> make
-> sudo make install
-> sudo modprobe pcan

and check with "cat /proc/pcan" if the card is recognized as CAN device.

Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Tue 27. Feb 2024, 13:09

Hi,
no change, sorry.
I will later reinstall the RaspiOs and restart with a complete blank installation.

Does your M.2 Adapter have any LEDs which should turn on (like the green/red LED on the USB-CANFD Adapter) then connected? On the M.2-Hat I have the green "PWR" LED enlightened, the "ACT" is dark.

G.Lang
Support
Support
Posts: 169
Joined: Wed 22. Sep 2010, 14:58

Re: 4 channel CAN-FD logger with Raspi5

Post by G.Lang » Tue 27. Feb 2024, 13:19

Hi,

the green "PWR" LED is on, the "ACK" is off.

G.Lang
Support
Support
Posts: 169
Joined: Wed 22. Sep 2010, 14:58

Re: 4 channel CAN-FD logger with Raspi5

Post by G.Lang » Tue 27. Feb 2024, 13:33

Did you use a Debian 11 or a Debian 12?
I made all tests with Raspbian based on Debian 12 (bookworm)

Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Tue 27. Feb 2024, 13:42

Debian 12 (bookworm, 64Bit)

Flyget
Posts: 13
Joined: Tue 13. Feb 2024, 09:04

Re: 4 channel CAN-FD logger with Raspi5

Post by Flyget » Tue 27. Feb 2024, 13:55

I have not made the new installation yet, but recognised in the dmesg output some interesting PCIe notes:

Code: Select all

logger@raspberrypi:~ $ dmesg | grep pcan
...
[    2.387296] pcan: loading out-of-tree module taints kernel.
[    2.390087] pcan: Release_20240116_n (le)
[    2.390094] pcan: driver config [mod] [isa] [pci] [pec] [usb]
[    2.390206] pcan 0000:01:00.0: enabling device (0000 -> 0002)
[    2.390227] pcan 0000:01:00.0: PCAN-M.2 sub-system id 14h (4 channels)
[    2.411513] pcan: PCB v2h FPGA v3.2.1 (mode 3)
[    2.411545] pcan 0000:01:00.0: pcan: Rx dma_alloc_coherent(4096) failure
[    2.418357] pcan: probe of 0000:01:00.0 failed with error -12
[    2.418446] usbcore: registered new interface driver pcan
[    2.418453] pcan: major 239.
...
[  137.559116] pcieport 0000:00:00.0: AER: Corrected error received: 0000:00:00.0
[  137.559129] pcieport 0000:00:00.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
[  137.559132] pcieport 0000:00:00.0:   device [14e4:2712] error status/mask=00000080/00002000
[  137.559135] pcieport 0000:00:00.0:    [ 7] BadDLLP
[  137.809522] pcieport 0000:00:00.0: AER: Corrected error received: 0000:00:00.0
[  137.809527] pcieport 0000:00:00.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
[  137.809530] pcieport 0000:00:00.0:   device [14e4:2712] error status/mask=00000080/00002000
[  137.809532] pcieport 0000:00:00.0:    [ 7] BadDLLP
[  137.813878] pcieport 0000:00:00.0: AER: Corrected error received: 0000:00:00.0
[  137.813882] pcieport 0000:00:00.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
[  137.813885] pcieport 0000:00:00.0:   device [14e4:2712] error status/mask=00000080/00002000
[  137.813887] pcieport 0000:00:00.0:    [ 7] BadDLLP
[  137.813976] pcieport 0000:00:00.0: AER: Corrected error received: 0000:00:00.0
[  137.813981] pcieport 0000:00:00.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Receiver ID)
[  137.813983] pcieport 0000:00:00.0:   device [14e4:2712] error status/mask=00000080/00002000
[  137.813986] pcieport 0000:00:00.0:    [ 7] BadDLLP

Post Reply