Compile the peak-linux-driver-8.10.0 with RTAI-5.2 for PCAN-miniPCIe.

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
kevinjz2010
Posts: 8
Joined: Wed 17. Feb 2016, 15:28

Compile the peak-linux-driver-8.10.0 with RTAI-5.2 for PCAN-miniPCIe.

Post by kevinjz2010 » Sat 21. Mar 2020, 06:17

Hi, please offer me some help.
Our products use the PCAN-miniPCIe under linux-4.19.89 and xenomai3.1, the peak linux driver version is 8.10.0, compiled with xeno. But it may freeze randomly after 1 hour, 3 hours, 24 hours and so on, without any abnormal logs. It makes me crazy.
So i try to use RTAI-5.2 to test it.

Compile command:$make rtai KERNEL_LOCATION=/opt/rt-kernel/linux-4.14.111 PCIEC=PCIEC_SUPPORT DNG=NO_DONGLE_SUPPORT ISA=NO_ISA_SUPPORT

Here is the error:

Code: Select all

make[1]: Entering directory '/home/zhuodao/Original/peak-linux-driver-8.10.0/driver'
make RT=RTAI
make[2]: Entering directory '/home/zhuodao/Original/peak-linux-driver-8.10.0/driver'
***
*** Making the RTAI 5.x version of the pcan driver
***
*** Host OS Release=Ubuntu v16.04
*** Host machine kernel version=4.14.111-rtai-5-2
*** Driver kernel version=4.14.111-rtai-5-2 (4.14.111)
*** Path to kernel sources=/opt/rt-kernel/linux-4.14.111
*** use KBUILD=yes
*** gcc version=5.4.0
***
make -C /opt/rt-kernel/linux-4.14.111  EXTRA_CFLAGS="-I/home/zhuodao/Original/peak-linux-driver-8.10.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DNO_USB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DNO_ISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DRTAI -U_FORTIFY_SOURCE -I. -I/usr/realtime/include -ffast-math -mhard-float  -Wno-date-time" V=0 modules SUBDIRS=/home/zhuodao/Original/peak-linux-driver-8.10.0/driver
make[3]: Entering directory '/opt/rt-kernel/linux-4.14.111'
  CC [M]  /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.o
In file included from ./include/linux/i2c.h:33:0,
                 from /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.h:98,
                 from /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_pci.h:31,
                 from /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.c:100:
./include/linux/rtmutex.h:74:0: warning: "rt_mutex_init" redefined
 # define rt_mutex_init(mutex)   __rt_mutex_init(mutex, NULL, NULL)
 ^
In file included from /usr/realtime/include/rtai_schedcore.h:45:0,
                 from /usr/realtime/include/rtdm/rtdm_driver.h:36,
                 from /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_common.h:230,
                 from /home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.c:36:
/usr/realtime/include/rtai_sem.h:243:0: note: this is the location of the previous definition
 #define rt_mutex_init(mtx)             rt_typed_sem_init(mtx, 1, RES_SEM)
 ^
./include/linux/rtmutex.h:107:13: error: conflicting types for ‘rt_sem_delete’
 extern void rt_mutex_destroy(struct rt_mutex *lock);
             ^
/usr/realtime/include/rtai_sem.h:116:23: note: previous declaration of ‘rt_sem_delete’ was here
 RTAI_SYSCALL_MODE int rt_sem_delete(SEM *sem);
                       ^
./include/linux/rtmutex.h:113:13: error: conflicting types for ‘rt_sem_wait’
 extern void rt_mutex_lock(struct rt_mutex *lock);
             ^
/usr/realtime/include/rtai_sem.h:138:23: note: previous declaration of ‘rt_sem_wait’ was here
 RTAI_SYSCALL_MODE int rt_sem_wait(SEM *sem);
                       ^
./include/linux/rtmutex.h:121:12: error: conflicting types for ‘rt_sem_wait_if’
 extern int rt_mutex_trylock(struct rt_mutex *lock);
            ^
/usr/realtime/include/rtai_sem.h:140:23: note: previous declaration of ‘rt_sem_wait_if’ was here
 RTAI_SYSCALL_MODE int rt_sem_wait_if(SEM *sem);
                       ^
./include/linux/rtmutex.h:123:13: error: conflicting types for ‘rt_sem_signal’
 extern void rt_mutex_unlock(struct rt_mutex *lock);
             ^
/usr/realtime/include/rtai_sem.h:134:23: note: previous declaration of ‘rt_sem_signal’ was here
 RTAI_SYSCALL_MODE int rt_sem_signal(SEM *sem);
                       ^
scripts/Makefile.build:326: recipe for target '/home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.o' failed
make[4]: *** [/home/zhuodao/Original/peak-linux-driver-8.10.0/driver/src/pcan_main.o] Error 1
Makefile:1535: recipe for target '_module_/home/zhuodao/Original/peak-linux-driver-8.10.0/driver' failed
make[3]: *** [_module_/home/zhuodao/Original/peak-linux-driver-8.10.0/driver] Error 2
make[3]: Leaving directory '/opt/rt-kernel/linux-4.14.111'
Makefile:508: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/zhuodao/Original/peak-linux-driver-8.10.0/driver'
Makefile:765: recipe for target 'rtai' failed
make[1]: *** [rtai] Error 2
make[1]: Leaving directory '/home/zhuodao/Original/peak-linux-driver-8.10.0/driver'
Makefile:99: recipe for target 'rtai' failed
make: *** [rtai] Error 2
Then i checked the driver source, in the driver/src/pcan_main.h, the PCIEC_SUPPORT need the <linux/i2c.h>, and the i2c need the rt_mutex in linux.

How to correct this error? Please help me.
:D :D Thank you!

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

Re: Compile the peak-linux-driver-8.10.0 with RTAI-5.2 for PCAN-miniPCIe.

Post by S.Grosjean » Mon 23. Mar 2020, 10:20

Hi,

Since you don't use any of our PCAN-ExpressCard/PCAN-ExpressCARD 34, why do you need PCIEC_SUPPORT?

Please do rebuild the driver but without PCIEC=PCIEC_SUPPORT (there is no RT full support for these kinds cards).

Regards,
— Stéphane

kevinjz2010
Posts: 8
Joined: Wed 17. Feb 2016, 15:28

Re: Compile the peak-linux-driver-8.10.0 with RTAI-5.2 for PCAN-miniPCIe.

Post by kevinjz2010 » Fri 27. Mar 2020, 09:02

Sorry, it was my fault.
Thank you.

Post Reply