Page 1 of 1

Linux drivers for Debian (Rock pi)

Posted: Tue 15. Nov 2022, 16:27
by deepakverma92
Hi,
i have debian 9 running on Rock Pi.

Code: Select all

# uname -a
Linux linaro-alip 4.4.154-90-rockchip-ga14f6502e045
Linux headers look like:

Code: Select all

# ls -l /usr/src/
total 3568
drwxr-xr-x 24 root root    4096 Jul 10  2019 linux-headers-4.4.154-88-rockchip-00030-g90239a6
drwxr-xr-x 24 root root    4096 Jul 30  2019 linux-headers-4.4.154-90-rockchip-ga14f6502e045
-rw-r--r--  1 root root 3642524 Mar  3  2017 xorg-server.tar.xz

I get the following output for:

Code: Select all

$ sudo grep PEAK_ /boot/config-`uname -r`
CONFIG_CAN_PEAK_PCI=m
CONFIG_CAN_PEAK_PCIEC=y
CONFIG_CAN_PEAK_USB=m

and

Code: Select all

$ lsmod | grep ^peak
peak_usb               40960  0
From this I assume that there is no need for installing linux drivers.

But, while building PCANBasic library, I get, "Unable to build pcanbasic for Linux: install the pcan driver first":

Code: Select all

:~/PCAN-Basic_Linux-4.6.2.36/libpcanbasic$ make

***
*** Processing 'pcanbasic' directory...
***
make[1]: Entering directory '/home/linaro/PCAN-Basic_Linux-4.6.2.36/libpcanbasic/pcanbasic'
Unable to build pcanbasic for Linux: install the pcan driver first
Makefile:70: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/home/linaro/PCAN-Basic_Linux-4.6.2.36/libpcanbasic/pcanbasic'
Makefile:54: recipe for target 'all' failed
make: *** [all] Error 2
So, I tried installing drivers. Kernel headers are already installed. While building the driver, I get:

Code: Select all

~/peak-linux-driver-8.15.2$ make PCC=NO PCI=NO ISA=NO DNG=NO
make[1]: Entering directory '/home/linaro/peak-linux-driver-8.15.2/driver'
***
*** Making pcan driver in chardev mode
***
*** Host OS Release=Debian GNU/Linux v9
*** Host machine kernel version=4.4.154-90-rockchip-ga14f6502e045
*** Driver kernel version=4.4.154-90-rockchip-ga14f6502e045 (4.4.154)
*** Path to kernel sources=/usr/src/linux-headers-4.4.154-90-rockchip-ga14f6502e045
*** use KBUILD=yes
*** use DKMS=
*** gcc version=6.3.0
***
/bin/sh: 1: cannot create dkms.conf: Permission denied
Makefile:587: recipe for target 'dkms.conf' failed
make[1]: *** [dkms.conf] Error 2
make[1]: Leaving directory '/home/linaro/peak-linux-driver-8.15.2/driver'
Makefile:84: recipe for target 'all' failed
make: *** [all] Error 2
What could I be doing wrong? On raspberry pi had worked seamlessly but seems a bit challenging on Rock pi. Thanks in advance!

Regards,
Deepak

Re: Linux drivers for Debian (Rock pi)

Posted: Tue 15. Nov 2022, 17:34
by M.Maidhof
Hi,

at the moment the kernel SocketCAN driver for PCAN-USB is active on your system, so you can build applications using the SocketCAN interface. If you want to use the PCANBasic API, you have to install the latest peak-linux-driver-8.x on your system. It looks like there is an issue with the dkms option, which isn't available on your system. Please try to build the driver without dkms support or install dkms upfront:

make clean
make DKMS=NO_DKMS_SUPPORT PCC=NO PCI=NO ISA=NO DNG=NO

regards

Michael

Re: Linux drivers for Debian (Rock pi)

Posted: Wed 16. Nov 2022, 16:45
by deepakverma92
Hi,
thanks for your hints. I solved the problem " cannot create dkms.conf: Permission denied" by first using "sudo su".
But even then got other errors same as at this link: viewtopic.php?f=59&t=7122. Also solved it as mentioned in the last post on that page.
regards,
Deepak