在raspberry pi 3上编译xenomai v2代码(使用xenomai v3编译内核v4.y)

时间:2017-05-02 05:47:37

标签: c linux raspberry-pi xenomai

在这里遇到一个特殊的问题。

我正在尝试在Raspberry PI 3(使用xenomai v3.0.3编译的Linux Kernel v4.1.21)上编译此代码https://github.com/severinson/VLC-driver 但是我遇到了多个编译器错误

make -C /lib/modules/4.1.21-xenomai+/build M=/home/pi/VLC-driver modules
make[1]: Entering directory '/home/pi/linux'
  CC [M]  /home/pi/VLC-driver/vlc_timer_handler.o
 /home/pi/VLC-driver/vlc_timer_handler.c:16:9: error: unknown type name ‘rtdm_task_t’
 rtdm_task_t rx_handler_task; 
 ^
 /home/pi/VLC-driver/vlc_timer_handler.c:66:1: error: unknown type name ‘rtdm_sem_t’
  rtdm_sem_t rx_sem;
  ^
 /home/pi/VLC-driver/vlc_timer_handler.c:67:1: error: unknown type name ‘rtdm_sem_t’
 rtdm_sem_t tx_sem;
  ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘send_bit’:
 /home/pi/VLC-driver/vlc_timer_handler.c:82:3: error: implicit declaration of function ‘rtdm_task_sleep_abs’ [-Werror=implicit-function-declaration]
    rtdm_task_sleep_abs(tx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
    ^
 /home/pi/VLC-driver/vlc_timer_handler.c:82:38: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
    rtdm_task_sleep_abs(tx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
                                       ^
 /home/pi/VLC-driver/vlc_timer_handler.c:82:38: note: each undeclared identifier is reported only once for each function it appears in
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘get_bit_early_late’:
 /home/pi/VLC-driver/vlc_timer_handler.c:117:25: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
                     RTDM_TIMERMODE_ABSOLUTE);
                     ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘get_bit’:
 /home/pi/VLC-driver/vlc_timer_handler.c:168:38: error: ‘RTDM_TIMERMODE_ABSOLUTE’ undeclared (first use in this function)
    rtdm_task_sleep_abs(rx_sleep_slot, RTDM_TIMERMODE_ABSOLUTE);
                                       ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘tx_send_ack’:
 /home/pi/VLC-driver/vlc_timer_handler.c:195:5: warning: this decimal constant is unsigned only in ISO C90
      send_bit(mask_bit((int) VLC_ACK, i));
      ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘rx_get_preamble’:
 /home/pi/VLC-driver/vlc_timer_handler.c:346:5: warning: this decimal constant is unsigned only in ISO C90
      if(rx_packet->current_preamble == (int) VLC_ACK){
      ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘rx_send_ack’:
 /home/pi/VLC-driver/vlc_timer_handler.c:424:5: warning: this decimal constant is unsigned only in ISO C90
      if(rx_packet->current_preamble == (int) VLC_ACK){
      ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘setup_timer_handler’:
 /home/pi/VLC-driver/vlc_timer_handler.c:468:3: error: implicit declaration of function ‘rtdm_sem_init’ [-Werror=implicit-function-declaration]
    rtdm_sem_init(&tx_sem, 1);
    ^
 /home/pi/VLC-driver/vlc_timer_handler.c:472:3: error: implicit declaration of function ‘rtdm_clock_read_monotonic’ [-Werror=implicit-function-declaration]
    rx_sleep_slot = rtdm_clock_read_monotonic();
    ^
 /home/pi/VLC-driver/vlc_timer_handler.c:481:3: error: implicit declaration of function ‘rtdm_task_init’ [-Werror=implicit-function-declaration]
    rtdm_task_init(&rx_handler_task, "VLC rx handler", rx_handler, 
    ^
 /home/pi/VLC-driver/vlc_timer_handler.c:482:24: error: ‘RTDM_TASK_HIGHEST_PRIORITY’ undeclared (first use in this function)
              NULL, RTDM_TASK_HIGHEST_PRIORITY, 0);
                    ^
 /home/pi/VLC-driver/vlc_timer_handler.c:492:3: error: implicit declaration of function ‘rtdm_task_destroy’ [-Werror=implicit-function-declaration]
    rtdm_task_destroy(&rx_handler_task);
    ^
 /home/pi/VLC-driver/vlc_timer_handler.c: In function ‘cleanup_timer_handler’:
 /home/pi/VLC-driver/vlc_timer_handler.c:502:3: error: implicit declaration of function ‘rtdm_sem_destroy’ [-Werror=implicit-function-declaration]
    rtdm_sem_destroy(&rx_sem);
    ^
 cc1: some warnings being treated as errors
 scripts/Makefile.build:258: recipe for target '/home/pi/VLC-driver/vlc_timer_handler.o' failed
 make[2]: *** [/home/pi/VLC-driver/vlc_timer_handler.o] Error 1
 Makefile:1384: recipe for target '_module_/home/pi/VLC-driver' failed
 make[1]: *** [_module_/home/pi/VLC-driver] Error 2
 make[1]: Leaving directory '/home/pi/linux'
 Makefile:15: recipe for target 'all' failed
 make: *** [all] Error 2

我能够在Raspberry PI上成功编译此代码(Linux Kernel 3.10.25 with xenomai v2.6.3)。我确实遇到了一些丢失的头文件问题,但没有任何东西无法使用CCFLAGS进行排序,并包括正确的标题位置。

之前还有一些其他编译器错误(缺少头文件),但我使用了它们 这个 EXTRA_CFLAGS =-I$(KERNEL_SRC)/include/xenomai -I$(KERNEL_SRC)/include/xenomai/native -I/home/pi/xenomai-3.0.3/include/trank -I/usr/include/arm-linux-gnueabihf -I/usr/xenomai/include/cobalt -I/usr/include -I/usr/xenomai/include -L/usr/xenomai/lib -lpthread_rt -lpthread -lrt

Makefile中的

但现在我收到编译器错误(见上文)

我希望我已经提供了足够的信息。任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

rtdm_task_t

中定义了rtdm/rtdm_driver.h

您是否有可能错过了未找到有关'rtdm_driver.h'的错误消息?

我看到有这样的错误消息,你通过修改??“修复”

建议回到原始代码,特别是Makefile中的原始代码,然后找出编译器没有看到所有必需的头文件的原因。