No /dev/pcan0 after pcan driver loaded.

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
RexTien
Posts: 2
Joined: Tue 24. Feb 2015, 23:11

No /dev/pcan0 after pcan driver loaded.

Post by RexTien » Tue 24. Feb 2015, 23:30

Greetings,

I am trying to install pcan drivers for "PCAN-PCI Dual Channel opto-decoupled" IPEH-002067.

I am running a xenomai-patched linux kernel (3.2.21-xenomai-2.6.1).

I am using peak-linux-driver-7.14.

I successfully compiled and loaded the driver using the following commands as root:
make clean
make NET=NO RT=XENOMAI
sudo make install
sudo modprobe pcan
I verify the module is loaded by doing "cat /proc/pcan" which yields the following:
*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20141219_n (7.14.0) Feb 24 2015 16:59:49 --------------
*------------------- [mod] [isa] [pci] [dng] [par] [rt] ---------------------
*--------------------- 2 interfaces @ major 000 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
0 pci -NA- fbbe0000 016 0x001c 00000000 00000000 00000000 00000000 0x0000
1 pci -NA- fbbe0400 016 0x001c 00000000 00000000 00000000 00000000 0x0000
As far as I know this looks normal. However, /dev/pcan0 does not exist. From what I have been able to gather, this should just be created automatically? Of course because of this I cannot run any of the test programs. The output of "ls -l /dev/pcan*" is
ls: cannot access /dev/pcan*: No such file or directory
Here is the output of "cat /var/log/dmesg | grep -e pcan -e pci" when I tried building again with option DBG=DEBUG USB=NO ISA=NO DNG=NO RT=XENOMAI
[ 2544.309097] pcan: Release_20141219_n (le)
[ 2544.309099] pcan: driver config [dbg] [mod] [pci] [rt]
[ 2544.309100] pcan: DEBUG is switched on
[ 2544.309107] pcan: pcan_search_and_create_pci_devices()
[ 2544.309120] pcan: create_one_pci_device(nChannel=0)
[ 2544.309122] pcan: pcan_pci_channel_init(), irq=16 _pci_devices = 0
[ 2544.309123] pcan: pcan_create_filter_chain()
[ 2544.314128] pcan: pci device minor 0 found
[ 2544.314131] pcan: sja1000_probe()
[ 2544.314134] pcan: CLKDIVIDER traced (0xc7)
[ 2544.314138] pcan: sja1000_irq_disable(0)
[ 2544.314139] pcan: sja1000_irq_disable_mask(0, mask=ffh)
[ 2544.314140] pcan: Hopefully switched to PeliCAN mode
[ 2544.314154] pcan: CHIPSTATUS traced (0x3c)
[ 2544.314157] pcan: INTERRUPT_STATUS traced (0x00)
[ 2544.314161] pcan: RECEIVE_MSG_COUNTER traced (0x00)
[ 2544.314161] pcan: sja1000_probe() is OK
[ 2544.314163] pcan: create_one_pci_device(nChannel=1)
[ 2544.314165] pcan: pcan_pci_channel_init(), irq=16 _pci_devices = 1
[ 2544.314166] pcan: pcan_create_filter_chain()
[ 2544.314172] pcan: pci device minor 1 found
[ 2544.314173] pcan: sja1000_probe()
[ 2544.314177] pcan: CLKDIVIDER traced (0xc7)
[ 2544.314180] pcan: sja1000_irq_disable(1)
[ 2544.314181] pcan: sja1000_irq_disable_mask(1, mask=ffh)
[ 2544.314182] pcan: Hopefully switched to PeliCAN mode
[ 2544.314195] pcan: CHIPSTATUS traced (0x3c)
[ 2544.314199] pcan: INTERRUPT_STATUS traced (0x00)
[ 2544.314202] pcan: RECEIVE_MSG_COUNTER traced (0x00)
[ 2544.314203] pcan: sja1000_probe() is OK
[ 2544.314206] pcan: pcan_search_and_create_pci_devices(): i=0 (001c.0001) pciDev=NULL from=ffff880211fd8000
[ 2544.314209] pcan: pcan_search_and_create_pci_devices(): i=1 (001c.0003) pciDev=NULL from= (null)
[ 2544.314212] pcan: pcan_search_and_create_pci_devices(): i=2 (001c.0004) pciDev=NULL from= (null)
[ 2544.314214] pcan: pcan_search_and_create_pci_devices(): i=3 (001c.0005) pciDev=NULL from= (null)
[ 2544.314217] pcan: pcan_search_and_create_pci_devices(): i=4 (001c.0006) pciDev=NULL from= (null)
[ 2544.314219] pcan: pcan_search_and_create_pci_devices(): i=5 (001c.0007) pciDev=NULL from= (null)
[ 2544.314221] pcan: pcan_search_and_create_pci_devices(): i=6 (001c.0008) pciDev=NULL from= (null)
[ 2544.314223] pcan: pcan_search_and_create_pci_devices(): i=7 (001c.0009) pciDev=NULL from= (null)
[ 2544.314225] pcan: pcan_search_and_create_pci_devices() status=0
[ 2544.314255] pcan: make_legacy_devices()
[ 2544.314268] pcan: major 0.
I don't know where to go from here. I'm perplexed as to why /dev/pcan0 is not being created. Please let me know if I can provide any more information that might be of use. Thank you very much for your time,

Rex Tien

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: No /dev/pcan0 after pcan driver loaded.

Post by S.Grosjean » Wed 25. Feb 2015, 12:44

Hi,

It looks like no UDEV is running nor configured in your Kernel.

Could you please run by yourself the "pcan_make_devices" ?

Code: Select all

$ sudo pcan_make_devices 2
By doing this, the "/dev/pcan" devnodes you need should be created.

Regards,

Stéphane
— Stéphane

RexTien
Posts: 2
Joined: Tue 24. Feb 2015, 23:11

Re: No /dev/pcan0 after pcan driver loaded.

Post by RexTien » Wed 25. Feb 2015, 20:23

Thanks for your quick response. When I try to run "sudo pcan_make_devices 2", I get the following:
Info: Please do first a "modprobe pcan.o or modprobe pcan.ko .. (depends on kernel version)"
However, I have certainly already loaded the pcan module, as the result of "lsmod | grep pcan" is:
pcan 34891 0
parport 46354 4 pcan,parport_pc,ppdev,lp
Thanks again,

Rex

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: No /dev/pcan0 after pcan driver loaded.

Post by S.Grosjean » Thu 26. Feb 2015, 11:52

Hi,

(Ok, my fault, I missed the "xenomai" info).

Have a look to "Documentation/PCAN-Driver_for_Linux_eng_7.x.pdf", p. 59, the Q about "Xenomai RTDM".
You should also have a look to "lib/src/libpcan.c", to see how device nodes are managed under these RT systems.

And finally, you should of course be able to run the provided test programs.

Best regards,

Stéphane
— Stéphane

Post Reply