Page 1 of 2
Compilation error with PCAN-miniPCIe Single Channel
Posted: Fri 6. Jul 2018, 13:23
by aperlado
Hello,
I'm a bit desperate with the driver of mi can board.
First of all I'm try to establish CAN communication between my PC (Linux Ubuntu 16.04) (kernel 4.13.0-45-generic) and another PC. For that I'm using a PCAN-miniPCIe Single Channel (
https://www.peak-system.com/PCAN-miniPC ... html?&L=1#). I download the driver 8.5.1 from the official website (
https://www.peak-system.com/fileadmin/m ... /index.htm) and follow all the steps in the documentation, but when I'm try to compile it I obtain two different errors, as you can see in the picture bellow. What i should do?
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Fri 6. Jul 2018, 15:09
by S.Grosjean
Hi,
The code with "pci_enable_msi_range()" shouldn't be compiled since everything looks like you're running Kernel 4.13:
src/pcan_pci.c; line 278:
Code: Select all
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
#define pcan_pci_enable_msi_range(a, b, c) \
pci_alloc_irq_vectors_affinity(a, b, c, PCI_IRQ_MSI, NULL)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#define pcan_pci_enable_msi_range(a, b, c) pci_enable_msi_range(a, b, c)
#else
Can you give us the output of:
About your 2nd issue: the enclosed Documentation says that you have to install the libpopt-dev package to be able to successfully compile the test programs:
Code: Select all
$ sudo apt-get install libpopt-dev
Regards,
Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Mon 9. Jul 2018, 12:34
by aperlado
Now the second issue its fixed, I don't obtain the error of the popt.h.
The output of "uname -a" is: Linux Carretilla-MXE210 4.13.0-45-generic #50~16.04.1-Ubuntu SMP Wed May 30 11:18:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
And don't understand what i should do with the code of "pci_enable_msi_range()", should i remove it?
Thanks for the support.
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Mon 9. Jul 2018, 13:25
by S.Grosjean
Hi,
Please edit "driver/src/pcan_pci.c" and change line ~278:
Code: Select all
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
into:
Code: Select all
#if 1//LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
then save and rebuild the driver with:
Tell us what happens please...
Regards,
Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Tue 10. Jul 2018, 08:25
by aperlado
Hi,
I modified the code as you explained to me, for compile it later with "make -C driver". I obtain the next lines, it seems that now its working fine.
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Tue 10. Jul 2018, 10:15
by S.Grosjean
Hi,
Yes it should. But I don't explain why you have had to do this change: according to your system configuration, your Kernel is 4.13, so the piece of code I told you to change should have been compiled by the compiler...
Tell us now if everything works.
Regards,
Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Mon 16. Jul 2018, 11:55
by aperlado
Hi,
I still have issues with the communication. My problem now is the next:
First of all I'm using socketcan_bridge to establish the communication, so when I write "ls /dev" to see what devices I can use, I see this:

- Captura de pantalla de 2018-07-16 11-48-31.png (102.69 KiB) Viewed 8330 times
. So i know I can use pcan0 and pcan1, but when I type "sudo ip link set pcan0 up type can bitrate 500000" I obtain the message: "Cannot find device "pcan0"". the same with pcan1.
I dont kwon how test if I configure the driver properly but, I compile it with "make PCC=NO DNG=NO ISA=NO USB=NO PAR=NO" and installed it with: "sudo make install".
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Mon 16. Jul 2018, 14:47
by M.Maidhof
please try:
ip link ls
and check which devices you see. Typically they are named can0, can1....
regards
Michael
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Tue 17. Jul 2018, 10:23
by S.Grosjean
Hello,
First of all I'm using socketcan_bridge to establish the communication, so when I write "ls /dev" to see what devices I can use, I see this:
Well if you plan to use "socket-CAN" then you certainly should build the driver with the NET option too:
Code: Select all
$ cd driver
$ make NET=NETDEV_SUPPORT ...
$ sudo make install
Then, you won't see any /dev/pcan* device node anymore but "canX" network interfaces instead.
Then, you'll be able to configrue them with "ip link" tool...
Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
Posted: Fri 20. Jul 2018, 11:53
by aperlado
Hi,
I follow your indications, and i obtain new error messages, in this case the error codes are the ones you can see in the next picture:

- Captura de pantalla de 2018-07-20 12-00-27.png (187.95 KiB) Viewed 8259 times