I.MX6 Android can-utils 移植

來源:互聯網
上載者:User

標籤:

/******************************************************************* *                  I.MX6 Android can-utils 移植 * 說明: *     由於最近要用到CAN,於是先移植一下can-tuils來看一下情況。 * *                                  2016-8-1 深圳 南山平山村 曾劍鋒 ******************************************************************/一、擷取源碼:    https://github.com/linux-can/can-utils二、錯誤現象:    target thumb C: slcan_attach <= /home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c    /home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c: In function ‘main‘:    /home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c:81:14: error: ‘N_SLCAN‘ undeclared (first use in this function)    /home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c:81:14: note: each undeclared identifier is reported only once for each function it appears in    make: *** [out/target/product/sabresd_6dq/obj/EXECUTABLES/slcan_attach_intermediates/slcan_attach.o] Error 1    make: Leaving directory `/home/myzr/myandroid‘三、查看N_SLCAN情況:    1. 直接查看:        [email protected]:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R        configure.ac:AC_CHECK_DECL(N_SLCAN,,        configure.ac:    [AC_DEFINE([N_SLCAN], [17], [N_SLCAN])]        slcan_attach.c:    int ldisc = N_SLCAN;        slcand.c:    int ldisc = N_SLCAN;    2. 執行autogen.sh再查看:        [email protected]:~/myandroid/packages/apps/can-utils$ ./autogen.sh         ----------        autoreconf        ----------        Can‘t exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 196.        Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196.        configure.ac:9: installing `config/autoconf/config.guess‘        configure.ac:9: installing `config/autoconf/config.sub‘        configure.ac:22: installing `config/autoconf/install-sh‘        configure.ac:22: installing `config/autoconf/missing‘        GNUmakefile.am:25: Libtool library used but `LIBTOOL‘ is undefined        GNUmakefile.am:25:   The usual way to define `LIBTOOL‘ is to add `LT_INIT‘        GNUmakefile.am:25:   to `configure.ac‘ and run `aclocal‘ and `autoconf‘ again.        GNUmakefile.am:25:   If `LT_INIT‘ is in `configure.ac‘, make sure        GNUmakefile.am:25:   its definition is in aclocal‘s search path.        GNUmakefile.am: installing `config/autoconf/depcomp‘        autoreconf: automake failed with exit status: 1        [email protected]:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R        autom4te.cache/output.1:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"        autom4te.cache/output.1:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :        autom4te.cache/output.1:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h        autom4te.cache/output.0:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"        autom4te.cache/output.0:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :        autom4te.cache/output.0:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h        autom4te.cache/traces.0:m4trace:configure.ac:86: -1- m4_pattern_allow([^N_SLCAN$])        autom4te.cache/traces.1:m4trace:configure.ac:86: -1- AC_DEFINE_TRACE_LITERAL([N_SLCAN])        autom4te.cache/traces.1:m4trace:configure.ac:86: -1- m4_pattern_allow([^N_SLCAN$])        autom4te.cache/traces.1:m4trace:configure.ac:86: -1- AH_OUTPUT([N_SLCAN], [/* N_SLCAN */        autom4te.cache/traces.1:@%:@undef N_SLCAN])        configure:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"        configure:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :        configure:$as_echo "#define N_SLCAN 17" >>confdefs.h        configure.ac:AC_CHECK_DECL(N_SLCAN,,        configure.ac:    [AC_DEFINE([N_SLCAN], [17], [N_SLCAN])]        slcan_attach.c:    int ldisc = N_SLCAN;        slcand.c:    int ldisc = N_SLCAN;        [email protected]:~/myandroid/packages/apps/can-utils$ 四、解決辦法:    slcan_attach.c slcand.c 中添加 #define N_SLCAN 17 宏定義。五、測試命令:    [email protected]:/data/local # ./cangen                                                cangen: generate CAN frames    Usage: cangen [options] <CAN interface>    Options: -g <ms>       (gap in milli seconds - default: 200 ms)             -e            (generate extended frame mode (EFF) CAN frames)             -f            (generate CAN FD CAN frames)             -b            (generate CAN FD CAN frames with bitrate switch (BRS))             -R            (send RTR frame)             -m            (mix -e -f -b -R frames)             -I <mode>     (CAN ID generation mode - see below)             -L <mode>     (CAN data length code (dlc) generation mode - see below)             -D <mode>     (CAN data (payload) generation mode - see below)             -p <timeout>  (poll on -ENOBUFS to write frames with <timeout> ms)             -n <count>    (terminate after <count> CAN frames - default infinite)             -i            (ignore -ENOBUFS return values on write() syscalls)             -x            (disable local loopback of generated CAN frames)             -v            (increment verbose level for printing sent CAN frames)    Generation modes:    ‘r‘        => random values (default)    ‘i‘        => increment values    <hexvalue> => fix value using <hexvalue>    When incrementing the CAN data the data length code minimum is set to 1.    CAN IDs and data content are given and expected in hexadecimal values.    Examples:    cangen vcan0 -g 4 -I 42A -L 1 -D i -v -v   (fixed CAN ID and length, inc. data)    cangen vcan0 -e -L i -v -v -v              (generate EFF frames, incr. length)    cangen vcan0 -D 11223344DEADBEEF -L 8      (fixed CAN data payload and length)    cangen vcan0 -g 0 -i -x                    (full load test ignoring -ENOBUFS)    cangen vcan0 -g 0 -p 10 -x                 (full load test with polling, 10ms timeout)    cangen vcan0                               (my favourite default :)    [email protected]:/data/local # 

 

I.MX6 Android can-utils 移植

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.