现在的位置: 首页 > 综合 > 正文

QQ2440V3- MCP2515 CAN 模块驱动 (SPI0)

2013年05月14日 ⁄ 综合 ⁄ 共 1375字 ⁄ 字号 评论关闭

http://wenku.baidu.com/view/c4b2caeeaeaad1f346933f64.html

socketcan 一片中文blog:http://www.cnblogs.com/kubtu/archive/2010/12/24/1916143.html

http://www.4ucode.com/Study/Topic/1252620

/sys # ls bus/spi/drivers
mcp251x  spidev

 

/sys # ls bus/platform/devices/
alarmtimer         s3c2410-wdt        s3c2440-uart.2     s3c24xx_led.4
dm9000             s3c2440-i2c        s3c2440-usbgadget  s3c24xx_led.5
gpio-keys          s3c2440-nand       s3c24xx-adc        s3c24xx_uda134x.0
s3c2410-lcd        s3c2440-sdi        s3c24xx-iis        samsung-audio
s3c2410-ohci       s3c2440-ts         s3c24xx_led.1      snd-soc-dummy
s3c2410-rtc        s3c2440-uart.0     s3c24xx_led.2      uda134x-codec
s3c2410-spi.0      s3c2440-uart.1     s3c24xx_led.3
/sys # ls bus/platform/drivers
alarmtimer        s3c-rtc           s3c2412-lcd       samsung-ts
leds-gpio         s3c-sdi           s3c2440-uart      snd-soc-dummy
s3c-adc           s3c2410-lcd       s3c24xx-nand      soc-audio
s3c-hwmon         s3c2410-spi       s3c24xx-pwm       spi_s3c24xx_gpio
s3c-i2c           s3c2410-wdt       s3c24xx_led

 

/ # ls /sys/bus/spi/devices/
/ # ls /sys/bus/spi/drivers

确认是否加载can驱动成功

https://www.ridgerun.com/developer/wiki/index.php/How_to_configure_and_use_CAN_bus

如果if link报错,ip: either "dev" is duplicate, or "type" is garbage看下面

http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver

最新版busybox的ip还是不支持socketcan,所以要自己编译一个。

http://corp-dev.linuxfoundation.org/collaborate/workgroups/networking/iproute2下载iproute2,目前版本是2.6.35。

编译iproute2的时候有很多问题,安装了bison,flex,libdb4.7-dev还是死在tc目录,后来想想只要用它的ip,于是最终修改Makefile如下:

CC = /opt/arm-2010q1/bin/arm-none-linux-gnueabi-gcc
SUBDIRS=lib ip

make通过,把ip目录中的ip(elf文件)拷到目标板中运行:

 

抱歉!评论已关闭.