Driver can not to run on Xenomai

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
chunsheng
Posts: 4
Joined: Sat 27. Aug 2016, 10:26

Driver can not to run on Xenomai

Post by chunsheng » Sat 27. Aug 2016, 10:41

I need to start the PCAN-miniPCIe on Xenomai. So I install the Xenomai-2.6.5(under the Linux Kernel-3.18.20),
and enable 'RT-Socket-CAN','Philips SJA1000 CAN controller','PEAK PCI Card'.
But without success.
Who can give me some helps?
Thanks.

dmesg
======================================================================
[ 6.445321] ledtrig-cpu: registered to indicate activity on CPUs
[ 6.445564] RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development Team
[ 6.445584] RTCAN SJA1000 driver initialized
[ 6.445613] PEAK-PCI-CAN: initializing device 001c:0008
[ 6.450708] PEAK-PCI-CAN: base_addr=f8068000 conf_addr=f805e000 irq=18
[ 6.450733] rtcan: registered rtcan0
[ 6.450748] PEAK-PCI-CAN: base_addr=f806a400 conf_addr=f805e000 irq=18
[ 6.450760] ERROR -16: IRQ 18 is busy, check shared interrupt support!
[ 6.450770] ERROR -16 while trying to register SJA1000 device!

[ 6.450782] Removing PEAK-PCI SJA1000 device rtcan0
[ 6.450786] Unregistering SJA1000 device rtcan0
[ 6.450797] RTCAN: unregistered rtcan0
[ 6.450813] PEAK-PCI-CAN: probe of 0000:07:00.0 failed with error -16
[ 6.450845] ERROR! No devices specified! Use mem=<port1>[,...] irq=<irq1>[,...]
[ 6.451003] TCP: cubic registered
[ 6.451310] NET: Registered protocol family 10
[ 6.451761] NET: Registered protocol family 17
[ 6.451783] Key type dns_resolver registered


cat /proc/interrupts
==================================================================
CPU0 CPU1
0: 42 0 IO-APIC-edge timer
1: 537 111 IO-APIC-edge i8042
3: 2 2 IO-APIC-edge
4: 2 2 IO-APIC-edge
8: 0 1 IO-APIC-edge rtc0
9: 2 1 IO-APIC-fasteoi acpi
12: 3 1 IO-APIC-edge i8042
14: 5713 3980 IO-APIC-edge ata_piix
15: 0 0 IO-APIC-edge ata_piix
19: 6997 118 IO-APIC 19-fasteoi ata_piix, ath9k
24: 0 0 PCI-MSI-edge PCIe PME
25: 0 0 PCI-MSI-edge PCIe PME
26: 0 0 PCI-MSI-edge PCIe PME
27: 0 0 PCI-MSI-edge PCIe PME
28: 0 0 PCI-MSI-edge PCIe PME
48: 62 656 PCI-MSI-edge eth0
49: 1470 702 PCI-MSI-edge i915
NMI: 16 15 Non-maskable interrupts
LOC: 16336 17709 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 16 15 Performance monitoring interrupts
IWI: 0 0 IRQ work interrupts
RTR: 0 0 APIC ICR read retries
RES: 2121 2233 Rescheduling interrupts
CAL: 356 174 Function call interrupts
TLB: 328 343 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 2 2 Machine check polls
HYP: 0 0 Hypervisor callback interrupts
ERR: 0
MIS: 0
Last edited by chunsheng on Sun 28. Aug 2016, 11:03, edited 1 time in total.

chunsheng
Posts: 4
Joined: Sat 27. Aug 2016, 10:26

Re: Driver can not to run on Xenomai

Post by chunsheng » Sun 28. Aug 2016, 11:01

Today, I update the Xenomai to Xenomai-3.0.2.but still no success.

I can see the two rtcan.
geng@geng-G-Series-CPU:~$ cat /proc/rtcan/devices
Name___________ _Baudrate State___ TX_Counter RX_Counter ____Errors
rtcan0 undefined stopped 0 0 0
rtcan1 undefined stopped 0 0 0

And start the rtcan.
geng@geng-G-Series-CPU:~$ sudo /usr/xenomai/sbin/rtcanconfig rtcan0 -b 1000000 -c none start -v
geng@geng-G-Series-CPU:~$ sudo /usr/xenomai/sbin/rtcanconfig rtcan1 -b 1000000 -c none start -v
geng@geng-G-Series-CPU:~$ cat /proc/rtcan/devices
Name___________ _Baudrate State___ TX_Counter RX_Counter ____Errors
rtcan0 1000000 active 0 0 0
rtcan1 1000000 active 0 0 0

Used the rtcan0 to receive,and rtcan1 to send,but no success.(Correct cable connection)
cd /usr/src/xenomai-3.0.2/utils/can
sudo ./rtcanrecv rtcan0 (The program has been waiting for data)

geng@geng-G-Series-CPU:/usr/src/xenomai-3.0.2/utils/can$ sudo ./rtcansend rtcan1 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 -v
interface rtcan1
s=3, ifr_name=rtcan1
<0x001> [8] 01 02 03 04 05 06 07 08
Cleaning up...

geng@geng-G-Series-CPU:/usr/src/xenomai-3.0.2/utils/can$ cat /proc/rtcan/devices
Name___________ _Baudrate State___ TX_Counter RX_Counter ____Errors
rtcan0 1000000 active 0 0 0
rtcan1 1000000 active 1 0 0

geng@geng-G-Series-CPU:/usr/src/xenomai-3.0.2/utils/can$ cat /proc/rtcan/sockets
Name___________ Filter ErrMask RX_Timeout_ns TX_Timeout_ns RX_BufFull TX_Lo
rtcan0 1 0x00000 infinite infinite 0 0



I suspect that the IRQ maybe have a problem.
geng@geng-G-Series-CPU:/usr/src/xenomai-3.0.2/utils/can$ cat /proc/interrupts
===============================================
CPU0 CPU1
0: 42 0 IO-APIC-edge timer
1: 4 697 IO-APIC-edge i8042
8: 1 0 IO-APIC-edge rtc0
9: 2 1 IO-APIC-fasteoi acpi
12: 1 3 IO-APIC-edge i8042
14: 0 0 IO-APIC-edge ata_piix
15: 5162 5287 IO-APIC-edge ata_piix
16: 0 0 IO-APIC 16-fasteoi uhci_hcd:usb3
18: 0 1 IO-APIC 18-fasteoi ehci_hcd:usb1, uhci_hcd:usb8
19: 2420 71 IO-APIC 19-fasteoi ata_piix, uhci_hcd:usb5, uhci_hcd:usb7, ath9k
21: 140 350 IO-APIC 21-fasteoi uhci_hcd:usb4
23: 275 106 IO-APIC 23-fasteoi ehci_hcd:usb2, uhci_hcd:usb6
24: 0 0 PCI-MSI-edge PCIe PME
25: 0 0 PCI-MSI-edge PCIe PME
26: 0 0 PCI-MSI-edge PCIe PME
27: 0 0 PCI-MSI-edge PCIe PME
28: 0 0 PCI-MSI-edge PCIe PME
48: 63 287 PCI-MSI-edge eth2
49: 2749 62 PCI-MSI-edge i915
NMI: 27 20 Non-maskable interrupts
LOC: 17298 18108 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 27 20 Performance monitoring interrupts
IWI: 0 0 IRQ work interrupts
RTR: 0 0 APIC ICR read retries
RES: 2683 2948 Rescheduling interrupts
CAL: 171 275 Function call interrupts
TLB: 367 303 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 1 1 Machine check polls
HYP: 0 0 Hypervisor callback interrupts
ERR: 0
MIS: 0

dmes
======================================
[ 6.347583] RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development Team
[ 6.347645] RTCAN SJA1000 driver initialized
[ 6.347677] PEAK-PCI-CAN: initializing device 001c:0008
[ 6.352763] PEAK-PCI-CAN: base_addr=f80c0000 conf_addr=f80be000 irq=18
[ 6.352790] rtcan: registered rtcan0
[ 6.352803] PEAK-PCI-CAN: base_addr=f80c2400 conf_addr=f80be000 irq=18
[ 6.352824] rtcan: registered rtcan1

[ 6.352997] TCP: cubic registered
[ 6.353307] NET: Registered protocol family 10
[ 6.353775] NET: Registered protocol family 17
[ 6.353798] Key type dns_resolver registered
[ 6.354292] Using IPI No-Shortcut mode
[ 6.354615] Loading compiled-in X.509 certificates
[ 6.362256] Loaded X.509 cert 'Magrathea: Glacier signing key: 1902c21dd67788adf038483cd15f40ce2ef0a8fb'
[ 6.362287] registered taskstats version 1
[ 6.366200] Key type trusted registered
[ 6.372113] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
[ 6.373534] Key type encrypted registered
[ 6.373547] AppArmor: AppArmor sha1 policy hashing enabled
[ 6.373552] evm: HMAC attrs: 0x1
[ 6.375004] Magic number: 12:186:539
[ 6.375041] tty ttyS19: hash matches
[ 6.375144] rtc_cmos 00:01: setting system clock to 2016-08-28 15:32:57 UTC (1472398377)
[ 6.375236] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[ 6.375239] EDD information not available.
[ 6.375392] PM: Hibernation image not present or could not be loaded.
[ 6.630893] ata1: SATA link down (SStatus 0 SControl 300)
[ 6.634817] ata3: SATA link down (SStatus 0 SControl 300)
[ 6.634849] usb 1-4: new high-speed USB device number 2 using ehci-pci
[ 6.649133] ata4: SATA link down (SStatus 0 SControl 300)
[ 6.649398] [Xenomai] xnintr_vec_handler: IRQ18 not handled. Disabling IRQ line
[ 6.704026] usb 2-4: new high-speed USB device number 3 using ehci-pci

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Driver can not to run on Xenomai

Post by PEAK-Support » Sun 28. Aug 2016, 17:32

at the moment we support XENOMAI 2.x only
But it looks that you need to change your BIOS settings, to be sure taht the CAN Crad use a own IRQ, not a shared one.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

chunsheng
Posts: 4
Joined: Sat 27. Aug 2016, 10:26

Re: Driver can not to run on Xenomai

Post by chunsheng » Tue 30. Aug 2016, 04:22

U.Wilhelm wrote:at the moment we support XENOMAI 2.x only
But it looks that you need to change your BIOS settings, to be sure taht the CAN Crad use a own IRQ, not a shared one.
PCI devices are required to share interrupts.
So,there is no BIOS setting to change this, nor would one be feasible, especially a Mini-PCIe card which is behind several PCI bridges.

View interrupts usage:
18: 0 1 IO-APIC 18-fasteoi ehci_hcd:usb1, uhci_hcd:usb8

Then I disable the USB in the BIOS,the RTCAN receive/send has succeeded.
But all the USB is disable,does have other solutions?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Driver can not to run on Xenomai

Post by PEAK-Support » Tue 30. Aug 2016, 17:20

PCI devices are required to share interrupts.
So,there is no BIOS setting to change this, nor would one be feasible, especially a Mini-PCIe card which is behind several PCI bridges.

View interrupts usage:
18: 0 1 IO-APIC 18-fasteoi ehci_hcd:usb1, uhci_hcd:usb8

Then I disable the USB in the BIOS,the RTCAN receive/send has succeeded.
You need to enable CONFIG_XENO_OPT_SHIRQ if you want your RTDM drivers to share IRQs.
Please also read here But this have nothing to do with our CAN Hardware. And why sould a Device behind a PCI bridge not use a own INT?
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

chunsheng
Posts: 4
Joined: Sat 27. Aug 2016, 10:26

Re: Driver can not to run on Xenomai

Post by chunsheng » Wed 31. Aug 2016, 08:25

U.Wilhelm wrote:
PCI devices are required to share interrupts.
So,there is no BIOS setting to change this, nor would one be feasible, especially a Mini-PCIe card which is behind several PCI bridges.

View interrupts usage:
18: 0 1 IO-APIC 18-fasteoi ehci_hcd:usb1, uhci_hcd:usb8

Then I disable the USB in the BIOS,the RTCAN receive/send has succeeded.
You need to enable CONFIG_XENO_OPT_SHIRQ if you want your RTDM drivers to share IRQs.
Pleasealso read here But this have nothing to do with our CAN Hardware. And why sould a Device behind a PCI bridge not use a own INT?
Have a good news, I adjust the CAN board position,keep it have a own IRQ ,it can work properly.
==================================================================================
I just had a new test.Share an interrupt with other devices,it also succeeded.Look like only IRQ18 can not shared to used for it.This is a strange phenomenon.
Last edited by chunsheng on Wed 31. Aug 2016, 08:37, edited 1 time in total.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Driver can not to run on Xenomai

Post by PEAK-Support » Wed 31. Aug 2016, 08:37

This could also be a solution - using a different PCIe slot
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply