Compilation error with PCAN-miniPCIe Single Channel
Compilation error with PCAN-miniPCIe Single Channel
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?
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?
- Attachments
-
- Captura de pantalla de 2018-07-06 13-17-09.png (254.27 KiB) Viewed 8598 times
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: Compilation error with PCAN-miniPCIe Single Channel
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:
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:
Regards,
Stéphane
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
Code: Select all
$ uname -a
Code: Select all
$ sudo apt-get install libpopt-dev
Stéphane
— Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
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.
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.
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: Compilation error with PCAN-miniPCIe Single Channel
Hi,
Please edit "driver/src/pcan_pci.c" and change line ~278:
into:
then save and rebuild the driver with:
Tell us what happens please...
Regards,
Stéphane
Please edit "driver/src/pcan_pci.c" and change line ~278:
Code: Select all
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
Code: Select all
#if 1//LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
Code: Select all
$ make -C driver
Regards,
Stéphane
— Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
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.
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.
- Attachments
-
- Captura de pantalla de 2018-07-10 08-14-06.png (67.24 KiB) Viewed 8502 times
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: Compilation error with PCAN-miniPCIe Single Channel
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
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
— Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
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: . 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".
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: . 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
please try:
ip link ls
and check which devices you see. Typically they are named can0, can1....
regards
Michael
ip link ls
and check which devices you see. Typically they are named can0, can1....
regards
Michael
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: Compilation error with PCAN-miniPCIe Single Channel
Hello,
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
Well if you plan to use "socket-CAN" then you certainly should build the driver with the NET option too: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:
Code: Select all
$ cd driver
$ make NET=NETDEV_SUPPORT ...
$ sudo make install
Then, you'll be able to configrue them with "ip link" tool...
Stéphane
— Stéphane
Re: Compilation error with PCAN-miniPCIe Single Channel
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:
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: