I.MX6 Android can-utils 移植
/*******************************************************************
* 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::: error: 'N_SLCAN' undeclared (first use in this function)
/home/myzr/myandroid/packages/apps/can-utils/slcan_attach.c::: 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
make: Leaving directory `/home/myzr/myandroid' 三、查看N_SLCAN情况:
. 直接查看:
myzr@myzr:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R
configure.ac:AC_CHECK_DECL(N_SLCAN,,
configure.ac: [AC_DEFINE([N_SLCAN], [], [N_SLCAN])]
slcan_attach.c: int ldisc = N_SLCAN;
slcand.c: int ldisc = N_SLCAN;
. 执行autogen.sh再查看:
myzr@myzr:~/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:: installing `config/autoconf/config.guess'
configure.ac:: installing `config/autoconf/config.sub'
configure.ac:: installing `config/autoconf/install-sh'
configure.ac:: installing `config/autoconf/missing'
GNUmakefile.am:: Libtool library used but `LIBTOOL' is undefined
GNUmakefile.am:: The usual way to define `LIBTOOL' is to add `LT_INIT'
GNUmakefile.am:: to `configure.ac' and run `aclocal' and `autoconf' again.
GNUmakefile.am:: If `LT_INIT' is in `configure.ac', make sure
GNUmakefile.am:: its definition is in aclocal's search path.
GNUmakefile.am: installing `config/autoconf/depcomp'
autoreconf: automake failed with exit status:
myzr@myzr:~/myandroid/packages/apps/can-utils$ grep N_SLCAN * -R
autom4te.cache/output.:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"
autom4te.cache/output.:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :
autom4te.cache/output.:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h
autom4te.cache/output.:ac_fn_c_check_decl "$LINENO" "N_SLCAN" "ac_cv_have_decl_N_SLCAN" "$ac_includes_default"
autom4te.cache/output.:if test "x$ac_cv_have_decl_N_SLCAN" = xyes; then :
autom4te.cache/output.:$as_echo "@%:@define N_SLCAN 17" >>confdefs.h
autom4te.cache/traces.:m4trace:configure.ac:: -- m4_pattern_allow([^N_SLCAN$])
autom4te.cache/traces.:m4trace:configure.ac:: -- AC_DEFINE_TRACE_LITERAL([N_SLCAN])
autom4te.cache/traces.:m4trace:configure.ac:: -- m4_pattern_allow([^N_SLCAN$])
autom4te.cache/traces.:m4trace:configure.ac:: -- AH_OUTPUT([N_SLCAN], [/* N_SLCAN */
autom4te.cache/traces.:@%:@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], [], [N_SLCAN])]
slcan_attach.c: int ldisc = N_SLCAN;
slcand.c: int ldisc = N_SLCAN;
myzr@myzr:~/myandroid/packages/apps/can-utils$ 四、解决办法:
slcan_attach.c slcand.c 中添加 #define N_SLCAN 17 宏定义。 五、测试命令:
root@android:/data/local # ./cangen cangen: generate CAN frames Usage: cangen [options] <CAN interface>
Options: -g <ms> (gap in milli seconds - default: 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 .
CAN IDs and data content are given and expected in hexadecimal values. Examples:
cangen vcan0 -g -I 42A -L -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 (fixed CAN data payload and length)
cangen vcan0 -g -i -x (full load test ignoring -ENOBUFS)
cangen vcan0 -g -p -x (full load test with polling, 10ms timeout)
cangen vcan0 (my favourite default :) root@android:/data/local #
I.MX6 Android can-utils 移植的更多相关文章
- I.MX6 Android frameworks services 文件架构
/******************************************************************************* * I.MX6 Android fra ...
- I.MX6 Android netperf
/***************************************************************************** * I.MX6 Android netpe ...
- I.MX6 Android U-blox miniPCI 4G porting
/************************************************************************** * I.MX6 Android U-blox m ...
- I.MX6 Android iperf3 porting failed
/***************************************************************************** * I.MX6 Android iperf ...
- I.MX6 Android i2c-tools porting
/************************************************************************** * I.MX6 Android i2c-tool ...
- I.MX6 Android 移除 Settings wifi功能
/********************************************************************* * I.MX6 Android 移除 Settings w ...
- I.MX6 Android USB Touch eGTouchA.ini文件存放
/******************************************************************** * I.MX6 Android USB Touch eGTo ...
- I.MX6 android BatteryService jni hacking
/**************************************************************************** * I.MX6 android Batter ...
- I.MX6 AW-NB177NF WIFI 驱动移植问题
/******************************************************************************** * I.MX6 AW-NB177NF ...
随机推荐
- Laya 项目解耦
Manager解耦业务逻辑 Data解耦数据逻辑 View-UI解耦页面逻辑 ModuleController解耦通信逻辑
- nginx1.6.3
Nginx1.6.3安装配置 安装时关闭防火墙和selinuxservice iptables stopsed -i "s/selinux=enabled/selinux=disable/g ...
- HDU 5245
题目大意: 每次随机选择两个点,便把这两个点之间形成的子矩阵上的每一个方块涂色,问随机选择k次,整个m*n的矩阵中有多少个小方块被涂上了颜色 这道题不难,但自己智商实在捉急,一直想不出来... 因为这 ...
- ZOJ 2588 求割边问题
题目链接:http://vjudge.net/problem/viewProblem.action?id=14877 题目大意: 要尽可能多的烧毁桥,另外还要保证图的连通性,问哪些桥是绝对不能烧毁的 ...
- linux awk常用命令【转载】
简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再 ...
- hashlib-sha摘要算法模块
摘要:hashlib: 摘要算法的模块 用处: 1.查看某两个文件是否完全一致 "abcdefggg" "abcdefhhg" 2.加密认证 把密码加密后写入文 ...
- Xcode waring: no rule to process file *** 警告提示
在编译程序的时候,Xcode给出了警告:warning: no rule to process file *** 类似的警告, 解决方法: 在[build Phases] -> [Compile ...
- 动态规划:Ignatius and the Princess IV
#include<stdio.h> #include<string.h> #include<math.h> int main() { _int64 n,a; whi ...
- P1427 小鱼的数字游戏 洛谷
https://www.luogu.org/problem/show?pid=1427 题目描述 小鱼最近被要求参加一个数字游戏,要求它把看到的一串数字(长度不一定,以0结束,最多不超过100个,数字 ...
- eclipse设置每次提交代码忽略target、.settings、.svn、.project文件