krumboeck / usb2can

SocketCAN driver for UAB "8 devices" USB2CAN interface
53 stars 24 forks source link

Unable to build on raspbian #9

Closed andig closed 6 years ago

andig commented 6 years ago

After installing dkms and kernel headers (as close as possible) I'm failing to load the module:

pi@wp ~ $ sudo dkms build -m usb2can -v 1.0 --verbose

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
make -C /lib/modules/4.9.35+/build M=/var/lib/dkms/usb2can/1.0/build clean
make: Entering directory '/usr/src/linux-headers-4.9.35+'
make: Leaving directory '/usr/src/linux-headers-4.9.35+'

{ make -j1 KERNELRELEASE=4.9.35+; } >> /var/lib/dkms/usb2can/1.0/build/make.log 2>&1

make -C /lib/modules/4.9.35+/build M=/var/lib/dkms/usb2can/1.0/build clean
make: Entering directory '/usr/src/linux-headers-4.9.35+'
  CLEAN   /var/lib/dkms/usb2can/1.0/build/.tmp_versions
  CLEAN   /var/lib/dkms/usb2can/1.0/build/Module.symvers
make: Leaving directory '/usr/src/linux-headers-4.9.35+'

DKMS: build completed.
pi@wp ~ $ sudo dkms install -m usb2can -v 1.0 --verbose

usb_8dev:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.9.35+/extra/

do_depmod 4.9.35+

DKMS: install completed.
pi@wp ~ $ sudo modprobe can_raw
pi@wp ~ $ sudo modprobe can_dev
pi@wp ~ $ sudo insmod usb_8dev.ko
insmod: ERROR: could not load module usb_8dev.ko: No such file or directory
pi@wp ~ $ sudo insmod usb_8dev
insmod: ERROR: could not load module usb_8dev: No such file or directory

Any idea appreciated!

krumboeck commented 6 years ago

Please try:

sudo depmod -a
sudo modprobe usb_8dev
andig commented 6 years ago

Solved, thanks you!

andig commented 6 years ago

Actually, I can compile/ load the driver now but the device silent although it's connected (candump can0):

[    8.923225] CAN device driver interface
[    8.968900] usb_8dev: loading out-of-tree module taints kernel.
[    8.998624] usb_8dev 1-1.2:1.0 can0: firmware: 1.7, hardware: 1.0
[    8.998985] usbcore: registered new interface driver usb_8dev
[   15.277655] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined
[   15.332229] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined
[   15.347828] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined
[   15.375574] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined
[   15.385432] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined
[   16.521088] usb_8dev 1-1.2:1.0 can0: bit-timing not yet defined

pi@wp ~ $ sudo ip link set can0 up type can bitrate 125000 sample-point 0.875
RTNETLINK answers: Device or resource busy

Firmware version looks like it's really talking to the device. Is the tainted warning a real problem?

andig commented 6 years ago

... and closing again just had the wrong bitrate :)

fabdrol commented 3 years ago

@krumboeck your answer should prob be part of readme; this tripped me up too