ip: either "dev" is duplicate, or "type" is garbage
Driver installation
- Nothing has to be done for the APF51Dev, the APF28Dev and the APF6Dev.
- For the APF27DevFull:
$ make linux-menuconfig
Networking support --->
<M> CAN bus subsystem support --->
--- CAN bus subsystem support
<M> Raw CAN Protocol (raw access with CAN-ID filtering)
<M> Broadcast Manager CAN Protocol (with content filtering)
CAN Device Drivers --->
<M> Virtual Local CAN Interface (vcan)
<M> Platform CAN drivers with Netlink support
[*] CAN bit-timing calculation
<M> Microchip 251x series SPI CAN Controller
$ make linux
$ make
- Reflash kernel and rootfs
Usage
- Load all the needed drivers:
# modprobe can
# modprobe can-dev
# modprobe can-raw
| APF27 & APF51 | APF6 | 
|---|---|
| # modprobe mcp251x | # modprobe flexcan | 
- Set the bitrate before all operations
Example: Set the bitrate of the can0 interface to 125kbps:
# ip link set can0 up type can bitrate 125000
|  | Note: An error occurs when you try to set the bitrate with an old Linux kernel. | 
- If the following error occurs when you do the last instruction :
ip: either "dev" is duplicate, or "type" is garbage
check that this command:
# which ip
return this message:
/sbin/ip
and not this one :
/bin/ip
If the binary is installed in /bin instead of /sbin, the executable file is a link to busybox and the command to set the bitrate doesn't work on busybox, so try the following instructions:
$ make busybox-clean
$ make busybox-dirclean
$ make menuconfig
Package Selection for the target --->
Networking applications --->
[*] iproute2
$ make
Then, reflash your rootfs.
Quick test
- Once the driver is installed and the bitrate is set, the CAN interface has to be started like a standard net interface:
# ifconfig can0 up
- and can be stopped like that:
# ifconfig can0 down
- The socketCAN version can be retrieved this way:
# cat /proc/net/can/version
- The socketCAN statistics can be retrieved this way:
# cat /proc/net/can/stats
Userspace tools
Several tools are provided by socketCAN:
- candump: dump traffic on a CAN network
The following command shows the received message from the CAN bus
candump can0
- cansend: simple command line tool to send CAN-frames via CAN_RAW sockets
exemple : The following command sends 3 bytes on the bus (0x1E, 0x10, 0x10) with the identifier 500.
cansend can0 500#1E.10.10
You can send a remote request message
cansend can0 500#R
The information with the identifier 500 will be available on the bus when the device receive the remote request message
- cangen: CAN frames generator for testing purpose
- canplayer: send CAN frames from a file to a CAN interface
These tools can be compiled and installed on the target by means of the Buildroot menuconfig:
$ make menuconfig
Package Selection for the target --->
Networking --->
[*] Socket CAN
$ make
then, reflash your rootfs.
ip: either "dev" is duplicate, or "type" is garbage的更多相关文章
- nginx: [warn] duplicate MIME type "text/html"错误
		检查配置文件时提示:nginx: [warn] duplicate MIME type "text/html" in /home/web/nginx/inc/gzip.conf:9 ... 
- niginx:duplicate MIME type "text/html" in nginx.conf 错误(转载)
		把nginx升级到最新以后,发现用原来的配置启动的时候会提示: duplicate MIME type "text/html" in /usr/local/nginx/conf/n ... 
- VS2010编译以前版本工程时 ERROR CVT1100:duplicate resource,type:MANIFEST解决办法
		1.将 Resource Files 里面的 *.exe.manifest 文件删除 2.右键选择 *.rc 文件,选择 view code,查找并删除所有引用 *.exe.manifest 文件的代 ... 
- iproute2交叉编译
		测试zynq+ramdisk平台时发现自带的busybox无法通过ip命令配置can接口,执行can配置命令 ip link set can0 type can bitrate 会出现以下报错: ip ... 
- Check类之duplicate declaration checking/Class name generation/Type Checking
		1.duplicate declaration checking /** Check that variable does not hide variable with same name in * ... 
- Neutron 理解(5):Neutron 是如何向 Nova 虚机分配固定IP地址的 (How Neutron Allocates Fixed IPs to Nova Instance)
		学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ... 
- docker学习笔记一:基本安装和设置容器静态ip
		docker是一个lxc升级版的容器类虚拟环境,具有快速部署,灵活,易迁移的虚拟机模式,现在各大公司已经开始广泛使用为了自己方便学习linux,需要多台虚拟机环境,但是vmware开启多台虚拟机时需要 ... 
- MySQL: ON DUPLICATE KEY UPDATE 用法 避免重复插入数据
		INSERT INTO osc_visit_stats(stat_date,type,id,view_count) VALUES (?,?,?,?) ON DUPLICATEKEY UPDATE vi ... 
- 动态IP解析
		本文介绍两种方便获取主机动态IP的方式(DDNS,IP报告网页),并给出相应的代码实现. shell脚本获取本机IP,执行上传操作和更新DNS操作.定期执行通过crontab或者systemd等服务. ... 
随机推荐
- cannot resolve symbol AppCompatActivity 心得
			新建Active 默认用的AppCompatActivity竟然报错cannot resolve symbol AppCompatActivity,网上找了半天,最后在朋友的帮助下解决,记录下 一.导 ... 
- powershell 远程重启/关闭服务器
			powershell 远程重启/关闭服务器 #启动winrm PS C:\Windows\system32> winrm quickconfig -q #设置信任主机 PS C:\Windows ... 
- HDU 1710 Binary Tree Traversals(二叉树)
			题目地址:HDU 1710 已知二叉树先序和中序求后序. #include <stdio.h> #include <string.h> int a[1001], cnt; ty ... 
- Android Activity的生命周期的几个方法介绍
			onCreate():创建Activity调用,用于Activity的初始化,还有个Bundle类型的参数,可以访问以前存储的状态. onStart():Activity在屏幕上对用户可见时调用 on ... 
- .NET反编译之manager,base.AutoScaleMode修复
			使用反编译软件导出项目时,出现警告:设计器无法处理第X 行的代码:this.AutoScaleMode = AutoScaleMode.Font;方法"InitializeComponent ... 
- html5图像、图片处理【转】
			本文主题 情人节在网上看到国外JS牛人利用HTML5技术实现的一朵玫瑰花,深切的感受到HTML5技术的强大.本着学习的态度看了一下那朵玫瑰花的源代码,其中用到的HTML5技术是canvas标签,于是灵 ... 
- Matlab interpgui
			function interpgui(arg1,arg2) %INTERPGUI Behavior of interpolating functions. % Demonstrates interpo ... 
- 40、JDBC相关概念介绍
			1.1.数据库驱动 这里的驱动的概念和平时听到的那种驱动的概念是一样的,比如平时购买的声卡,网卡直接插到计算机上面是不能用的,必须要安装相应的驱动程序之后才能够使用声卡和网卡,同样道理,我们安装好数据 ... 
- Android体系架构详解
			Andriod是什么? 首先,就像Android开源和兼容性技术负责人Dan Morrill在Android开发手册兼容性部分所解释的,“Android并不是传统的Linux风格的一个规范或分发版本, ... 
- PHP LDAP class for Active Directory
			A class for PHP to talk to Active Directory through LDAP.http://sourceforge.net/projects/adldap/ 
