PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Hi, PeakCAN support team:
We have some problems when using PEAK-CAN miniPCIe device on xenomai 3.0.5.
My testing environment:
· Linux kernal: 4.9.38 (ubuntu 16.04)
· Xenomai: 3.0.5
· PeakCan model: PEAK-CAN miniPCIe
· intel Pentium CPU N4200, x4
Two tested cases are performed:
1) disable the shared interrupt in Xenomai/cobalt core features.
rtcan device fails to register when system started. (see pictures)
It shows the interrupt 22 is busy. but I use the command $cat /proc/interrupts to search the interrupt 22, but there was no 22 interrupt.
I also make a confirm with the intel hardware agency, they said 22 interrupt was not used.
2) enable the shared interrupt in Xenomai/cobalt core features.
rtcan device registered successfully. Then I use the commands to do the tests:
· cat /proc/rtcan/devices —— it displays the rtcan0 & rtcan1
· sudo /usr/xenomai/sbin/rtcanconfig rtcan0 -b 1000000 -c none start -v —— starts rtcan0
· sudo ./rtcansend rtcan0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v —— send the data to another Can device
(send data was failed, the slave device can not receive any data)
· sudo /usr/xenomai/sbin/rtcanconfig rtcan1 -b 1000000 -c none start -v —— starts rtcan1
· sudo ./rtcanrecv rtcan1 —— receive the data from another Can device
(receive nothing)
We have also tested on another PC with another PeanCAN device, same problems were taken place.
Please help us, thank you all.
Regards,
Johnny Mao
We have some problems when using PEAK-CAN miniPCIe device on xenomai 3.0.5.
My testing environment:
· Linux kernal: 4.9.38 (ubuntu 16.04)
· Xenomai: 3.0.5
· PeakCan model: PEAK-CAN miniPCIe
· intel Pentium CPU N4200, x4
Two tested cases are performed:
1) disable the shared interrupt in Xenomai/cobalt core features.
rtcan device fails to register when system started. (see pictures)
It shows the interrupt 22 is busy. but I use the command $cat /proc/interrupts to search the interrupt 22, but there was no 22 interrupt.
I also make a confirm with the intel hardware agency, they said 22 interrupt was not used.
2) enable the shared interrupt in Xenomai/cobalt core features.
rtcan device registered successfully. Then I use the commands to do the tests:
· cat /proc/rtcan/devices —— it displays the rtcan0 & rtcan1
· sudo /usr/xenomai/sbin/rtcanconfig rtcan0 -b 1000000 -c none start -v —— starts rtcan0
· sudo ./rtcansend rtcan0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v —— send the data to another Can device
(send data was failed, the slave device can not receive any data)
· sudo /usr/xenomai/sbin/rtcanconfig rtcan1 -b 1000000 -c none start -v —— starts rtcan1
· sudo ./rtcanrecv rtcan1 —— receive the data from another Can device
(receive nothing)
We have also tested on another PC with another PeanCAN device, same problems were taken place.
Please help us, thank you all.
Regards,
Johnny Mao
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
I have also downloaded the peak-linux-driver-8.10.0, and build the package under the environment: Linux4.9.38 + xenomai 3.0.5 with the command
make RT=XENOMAI3,
then the following errors occurs:
make RT=XENOMAI3,
then the following errors occurs:
Code: Select all
robot@wam:~/linux_xenomai_ws/peak-linux-driver-8.10.0$ make RT=XENOMAI3
make[1]: Entering directory '/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver'
***
*** Making the Xenomai 3.0 version of the pcan driver
***
*** Host OS Release=Ubuntu v16.04
*** Host machine kernel version=4.9.38-xenomai-3.0.5
*** Driver kernel version=4.9.38-xenomai-3.0.5 (4.9.38)
*** Path to kernel sources=/usr/src/linux-headers-4.9.38-xenomai-3.0.5
*** use KBUILD=yes
*** gcc version=5.4.0
***
make -C /usr/src/linux-headers-4.9.38-xenomai-3.0.5 EXTRA_CFLAGS="-I/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DNO_USB_SUPPORT -DPCI_SUPPORT -DNO_PCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DXENOMAI3 -I/usr/xenomai/include/trank -D__XENO_COMPAT__ -I/usr/xenomai/include/cobalt -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__COBALT__ -I/usr/xenomai/include/alchemy -Wno-date-time" V=0 modules SUBDIRS=/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver
make[2]: Entering directory '/usr/src/linux-headers-4.9.38-xenomai-3.0.5'
make[3]: *** No rule to make target '/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver/src/pcan_main.o', needed by '/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver/pcan.o'. Stop.
Makefile:1490: recipe for target '_module_/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver' failed
make[2]: *** [_module_/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.9.38-xenomai-3.0.5'
Makefile:508: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/robot/linux_xenomai_ws/peak-linux-driver-8.10.0/driver'
Makefile:72: recipe for target 'all' failed
Last edited by M.Gerber on Mon 30. Mar 2020, 09:32, edited 1 time in total.
Reason: Inserted [code] tags for improved readability
Reason: Inserted [code] tags for improved readability
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
I have also change the non-rt Linux kernal 4.13.0-36-generic (ubuntu 16.04),and use the build command:
$ make –C driver NET=NETDEV_SUPPORT DNG=NO_DONGLE_SUPPORT
make is done without errors, but when I try to install with
$ sudo make install
(in the root directory of the driver package:)
errors occur:
make[1]: Entering directory '/home/robot/peak-linux-driver-8.10.0/driver'
Info: /lib/modules/4.13.0-36-generic/misc exists.
Info: Left current 'pcan'-entry in /etc/modprobe.d/pcan.conf untouched.
Info: Copied 45-pcan.rules to /etc/udev/rules.d.
Info: mainline drivers removed and blacklisted in
/etc/modprobe.d/blacklist-peak.conf
make[1]: Leaving directory '/home/robot/peak-linux-driver-8.10.0/driver'
make[1]: Entering directory '/home/robot/peak-linux-driver-8.10.0/lib'
mkdir -p /usr/lib
cp -d lib/* /usr/lib
cp: cannot stat 'lib/*': No such file or directory
Makefile:182: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/robot/peak-linux-driver-8.10.0/lib'
Makefile:90: recipe for target 'install' failed
make: *** [install] Error 2
It seems that 'lib/*' can not be recognized. So I change the Makefile path as
'~/peak-linux-driver-8.10.0/lib/*' also
make[1]: *** [install] Error 1
error occurs.
I didnot know why. For a purge kernel with out Xenomai, the driver fails too.
Please, help me to solve the problem. Thank you.
$ make –C driver NET=NETDEV_SUPPORT DNG=NO_DONGLE_SUPPORT
make is done without errors, but when I try to install with
$ sudo make install
(in the root directory of the driver package:)
errors occur:
make[1]: Entering directory '/home/robot/peak-linux-driver-8.10.0/driver'
Info: /lib/modules/4.13.0-36-generic/misc exists.
Info: Left current 'pcan'-entry in /etc/modprobe.d/pcan.conf untouched.
Info: Copied 45-pcan.rules to /etc/udev/rules.d.
Info: mainline drivers removed and blacklisted in
/etc/modprobe.d/blacklist-peak.conf
make[1]: Leaving directory '/home/robot/peak-linux-driver-8.10.0/driver'
make[1]: Entering directory '/home/robot/peak-linux-driver-8.10.0/lib'
mkdir -p /usr/lib
cp -d lib/* /usr/lib
cp: cannot stat 'lib/*': No such file or directory
Makefile:182: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/robot/peak-linux-driver-8.10.0/lib'
Makefile:90: recipe for target 'install' failed
make: *** [install] Error 2
It seems that 'lib/*' can not be recognized. So I change the Makefile path as
'~/peak-linux-driver-8.10.0/lib/*' also
make[1]: *** [install] Error 1
error occurs.
I didnot know why. For a purge kernel with out Xenomai, the driver fails too.
Please, help me to solve the problem. Thank you.
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Sorry, the first picture
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Hi,
Difficult to answer to 4 posts that are mixing Linux OS and/or linux-can drivers...
AFAIU, you've got problems with:
- RT-socket-CAN which is not related to the pcan driver
- when you use the pcan driver, you've got problems to build it in RT mode but non in non-RT, right?
- in non-RT, you haven't got problem to build the driver but to install it.
- then you post a picture that displays an error with RT-socket-CAN (again).
So? From which point do we start? What do you want to do? What kind of application do you need to write? RT-Socket-CAN doesn't export the same API at all than the pcan driver!
Regards,
Difficult to answer to 4 posts that are mixing Linux OS and/or linux-can drivers...
AFAIU, you've got problems with:
- RT-socket-CAN which is not related to the pcan driver
- when you use the pcan driver, you've got problems to build it in RT mode but non in non-RT, right?
- in non-RT, you haven't got problem to build the driver but to install it.
- then you post a picture that displays an error with RT-socket-CAN (again).
So? From which point do we start? What do you want to do? What kind of application do you need to write? RT-Socket-CAN doesn't export the same API at all than the pcan driver!
Regards,
— Stéphane
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Thank you, Stéphane:
Acutally, we want to use the miniPCIe PEAK-CAN device in Xenomai3.0.5. That is the first post want to be solved.
RTCAN device is failed to register when disable the shared interrupt in Xenomai core features.
If we enable the shared interrupt option, RTCAN can be registered sucefully. But It fails to send the data.
In this case, we did use the drivers accompanied with the xenomai3.0.5 kernal.
Regards.
Acutally, we want to use the miniPCIe PEAK-CAN device in Xenomai3.0.5. That is the first post want to be solved.
RTCAN device is failed to register when disable the shared interrupt in Xenomai core features.
If we enable the shared interrupt option, RTCAN can be registered sucefully. But It fails to send the data.
In this case, we did use the drivers accompanied with the xenomai3.0.5 kernal.
Regards.
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
*******- RT-socket-CAN which is not related to the pcan driver******
In the first post, we want to use RT-socket-CAN under xenomai, which is integrated in xenomai kernal. But it fails to send/receive datas. Testing steps are listed in post 1. We have enable the shared interrupts, since disable the shared interrupts leading to the registration error.
*******- when you use the pcan driver, you've got problems to build it in RT mode but non in non-RT, right?*****
Since it fails to send/receive the datas, I try to use the pcan driver to replace that integrated in xenomai kernal. That is post 2 we did. We have follwed the steps listed in the document, i.e., make RT=XENOMAI3, but it fails to compile. (environment: linux 4.9.38+ xenomai3.0.5)
*******- in non-RT, you haven't got problem to build the driver but to install it.*****
Yes. Since we meet problems for RT driver compiling, then I replaced the linux kernel with 4.13.0 with no xenomai for the non-RT compiling, just for a test. I know that if we want to use the Socket-can in linux kernel, we should compile the pcan driver with the NetDev option. But it fails to install, that is post 3.
*******- then you post a picture that displays an error with RT-socket-CAN (again).
Yes, this is what we want to solve. Directly use the PEAK-CAN driver integrated in xenomai kernel. Compiling the pcan driver with XENOMAI3 is just a trial for solve that problem. But we failed to compile.
------------------------------------------------------------------------------------------------------------------------------------------------------
So, actually, we just want to use the RT-socket-CAN in xenomai kernel. If the following problems can be solved:
rtcan device registered successfully. Then I use the commands to do the tests:
· cat /proc/rtcan/devices —— it displays the rtcan0 & rtcan1
· sudo /usr/xenomai/sbin/rtcanconfig rtcan0 -b 1000000 -c none start -v —— starts rtcan0
· sudo ./rtcansend rtcan0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v —— send the data to another Can device
(send data was failed, the slave device can not receive any data)
· sudo /usr/xenomai/sbin/rtcanconfig rtcan1 -b 1000000 -c none start -v —— starts rtcan1
· sudo ./rtcanrecv rtcan1 —— receive the data from another Can device
(receive nothing)
--------------------------------------------------------------------------------------------------------------------------------------------------------
This phenomenon is like the following link:
viewtopic.php?t=1909
But we can not solve the problems with the suggestions on this link.
Regards.
In the first post, we want to use RT-socket-CAN under xenomai, which is integrated in xenomai kernal. But it fails to send/receive datas. Testing steps are listed in post 1. We have enable the shared interrupts, since disable the shared interrupts leading to the registration error.
*******- when you use the pcan driver, you've got problems to build it in RT mode but non in non-RT, right?*****
Since it fails to send/receive the datas, I try to use the pcan driver to replace that integrated in xenomai kernal. That is post 2 we did. We have follwed the steps listed in the document, i.e., make RT=XENOMAI3, but it fails to compile. (environment: linux 4.9.38+ xenomai3.0.5)
*******- in non-RT, you haven't got problem to build the driver but to install it.*****
Yes. Since we meet problems for RT driver compiling, then I replaced the linux kernel with 4.13.0 with no xenomai for the non-RT compiling, just for a test. I know that if we want to use the Socket-can in linux kernel, we should compile the pcan driver with the NetDev option. But it fails to install, that is post 3.
*******- then you post a picture that displays an error with RT-socket-CAN (again).
Yes, this is what we want to solve. Directly use the PEAK-CAN driver integrated in xenomai kernel. Compiling the pcan driver with XENOMAI3 is just a trial for solve that problem. But we failed to compile.
------------------------------------------------------------------------------------------------------------------------------------------------------
So, actually, we just want to use the RT-socket-CAN in xenomai kernel. If the following problems can be solved:
rtcan device registered successfully. Then I use the commands to do the tests:
· cat /proc/rtcan/devices —— it displays the rtcan0 & rtcan1
· sudo /usr/xenomai/sbin/rtcanconfig rtcan0 -b 1000000 -c none start -v —— starts rtcan0
· sudo ./rtcansend rtcan0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v —— send the data to another Can device
(send data was failed, the slave device can not receive any data)
· sudo /usr/xenomai/sbin/rtcanconfig rtcan1 -b 1000000 -c none start -v —— starts rtcan1
· sudo ./rtcanrecv rtcan1 —— receive the data from another Can device
(receive nothing)
--------------------------------------------------------------------------------------------------------------------------------------------------------
This phenomenon is like the following link:
viewtopic.php?t=1909
But we can not solve the problems with the suggestions on this link.
Regards.
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Hi,
Ok. So let's concentrate to the "failure to send/receive data" with RT-socket-CAN. FYI we are not the author of this driver so we won't be able to give a lot of support about this thread.
Enabling the shared interrupts is the starting point.
Then, don't forget to specify the ID of the CAN frame you want to send (FYI see the "-i" option of rtcansend).
Regards,
Ok. So let's concentrate to the "failure to send/receive data" with RT-socket-CAN. FYI we are not the author of this driver so we won't be able to give a lot of support about this thread.
Enabling the shared interrupts is the starting point.
Then, don't forget to specify the ID of the CAN frame you want to send (FYI see the "-i" option of rtcansend).
Regards,
— Stéphane
-
- Posts: 13
- Joined: Mon 30. Mar 2020, 06:39
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Thank you,
So if we should enable the shared interrupt ?
To the 'rtcansend' & 'rtcanrecv' command, we have tested with the specified CAN ID.
For the first call of 'rtcansend' command, with the instructioin
./rtcansend rtcan0 -i x 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v
data seems to send sucessfully, but for the second call of 'rtcansend', the program are stuck in the send function.
We donnot have the a clue what is the problem. We think the shared interrupt leading this failure.
Regards.
So if we should enable the shared interrupt ?
To the 'rtcansend' & 'rtcanrecv' command, we have tested with the specified CAN ID.
For the first call of 'rtcansend' command, with the instructioin
./rtcansend rtcan0 -i x 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v
data seems to send sucessfully, but for the second call of 'rtcansend', the program are stuck in the send function.
We donnot have the a clue what is the problem. We think the shared interrupt leading this failure.
Regards.
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PEAK-CAN miniPCIe devices failed on Xenomai 3.0.5
Hi,
Yep! You MUST enable interrupt sharing in your Linux Kernel Xenomai configuration:
For example, when running the xeno_peak_pci driver over a 2x CAN PCIe card, with interrupt sharing enabled:
Tests over the two CAN ports connected to the same CAN bus :
and:
Regards,
Yep! You MUST enable interrupt sharing in your Linux Kernel Xenomai configuration:
Code: Select all
$ grep CONFIG_XENO_OPT_SHIRQ /boot/config-`uname -r`
CONFIG_XENO_OPT_SHIRQ=y
Code: Select all
$ dmesg | grep PEAK
[ 19.815215] PEAK-PCI-CAN: initializing device 001c:0003
[ 19.815224] PEAK-PCI-CAN 0000:0a:00.0: enabling device (0100 -> 0102)
[ 19.820370] PEAK-PCI-CAN: base_addr=00000000341a11fb conf_addr=00000000b80e1f2e irq=27
[ 19.820394] PEAK-PCI-CAN: base_addr=0000000063164574 conf_addr=00000000b80e1f2e irq=27
Code: Select all
$ sudo rtcanconfig rtcan0 -b 500000 start
$ sudo rtcanconfig rtcan1 -b 500000 start
$ while :; do sudo rtcansend rtcan0 -i 1 0x01 0X02 0x03 0x04 0x05 0x06 0x07 0x08; sleep 0.1; done
Code: Select all
$ sudo rtcanrecv rtcan1
#0: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#1: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#2: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#3: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#4: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#5: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#6: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#7: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#8: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#9: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#10: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#11: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#12: (2) <0x001> [8] 01 02 03 04 05 06 07 08
#13: (2) <0x001> [8] 01 02 03 04 05 06 07 08
— Stéphane