Page 1 of 1

PCAN error "not enough minors"

Posted: Fri 5. Jan 2018, 14:30
by jhpauls
Hi all,

I tried to plug two PCAN-USB X6 in one host (Ubuntu 16.04 LTS with Peak/PCAN driver, i.e. not the Linux SocketCAN kernel driver).
For the first X6, all ports work just fine having device names pcan32...pcan37 mapped to can0...can5. For the second, the first two ports seem to work fine (having device names pcan38 and pcan39 mapped to can6 and can7), but then the driver reports the following:

Code: Select all

[1182841.521888] pcan: not enough minors
[1182841.521894] pcan: failed to register PCAN-USB X6 CAN1 as a new USB CAN channel err -19
Full dmesg report:

Code: Select all

[1182841.329762] pcan: PCAN-USB X6 (01h PCB03h) fw v2.2.3 bl v1.0.2
[1182841.330054] pcan: PCAN-USB X6 channel 1 device number=0
[1182841.330424] pcan: registered CAN-FD netdevice can6 for usbfd hw (238,38)
[1182841.330426] pcan: usb device minor 38 found
[1182841.330680] pcan: PCAN-USB X6 channel 2 device number=0
[1182841.331019] pcan: registered CAN-FD netdevice can7 for usbfd hw (238,39)
[1182841.331020] pcan: usb device minor 39 found
[1182841.521888] pcan: not enough minors
[1182841.521894] pcan: failed to register PCAN-USB X6 CAN1 as a new USB CAN channel err -19
[1182841.710073] pcan: not enough minors
[1182841.710077] pcan: failed to register PCAN-USB X6 CAN1 as a new USB CAN channel err -19
/proc/pcan dump:

Code: Select all


*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20171027_n (8.5.1) Jan  3 2018 15:46:05 --------------
*---------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] [net] -----------
*--------------------- 8 interfaces @ major 238 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32  usbfd   can0       90 000 0x001c 06a06acd 0000000e 01733d66 00000000 0x0000
33  usbfd   can1       90 000 0x001c 0a5e6ab7 00000010 023b0e07 00000000 0x0000
34  usbfd   can2       90 000 0x001c 00000000 00000000 00000000 00000000 0x0000
35  usbfd   can3       90 000 0x001c 00000000 00000000 00000000 00000000 0x0000
36  usbfd   can4       90 000 0x001c 0596b462 0000000e 0141713b 00000000 0x0000
37  usbfd   can5       90 000 0x001c 0ee0f37c 00000008 033043ce 00000000 0x0000
38  usbfd   can6       91 000 0x001c 00000000 00000000 00000000 00000000 0x0000
39  usbfd   can7       91 000 0x001c 00000000 00000000 00000000 00000000 0x0000
Is there an (official?) workaround/fix to connect more than 8 PCAN-USB devices to one host?

I know that there are fixed device minor number ranges for each category (cf. p.13 of the manual), but as we do not have any PC-CARD devices, using those minor numbers (40...47) or those starting at 48 would work both for me.

Thank you already,
Jan

Re: PCAN error "not enough minors"

Posted: Fri 5. Jan 2018, 15:06
by S.Grosjean
Hello,

Thanks for using our PCAN products.

We're aware of that issue and our next release will reserve more spaces for each kind of CAN interface.
Meanwhile, you can easily workaround this limitation by compiling and installing the driver but without PCCARD_SUPPORT, that is:

Code: Select all

$ cd peak-linux-driver-8.5.1/driver
$ make PCC=NO_PCCARD_SUPPORT NET=NETDEV_SUPPORT
$ sudo make install
You should now be able to handle all the 12x USB interfaces.

(The "NET=" option is here because of the logs you've given above. If you finally doesn't want to use the netdev interface, please remove this option when compiling the driver again.)

Regards,

Stéphane

Re: PCAN error "not enough minors"

Posted: Fri 5. Jan 2018, 17:35
by jhpauls
Hi Stéphane,

wow, awesome support! That works perfectly for me. :)

Yep, I'm using NETDEV mode. But it would work just the same if I would use CHARDEV mode (the default for 8.5.1), right?
I'm asking as I think about switching from NETDEV to CHARDEV mode to obtain the hwtime from X6's onboard timer.

Kind regards,
Jan