s3c6410 Can Bus
Kernel:2.6.29Soc:s3c6410
Can:mcp2515
Can driver:SocketCan
Can utils :cansend/canreceive/candump
现象:bus off
debug:
# ./ip link set can0 type can bitrate 125000 triple-sampl
ing on
# ifconfig can0 up
mcp251x_read_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_write_bits
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
mcp251x spi0.0: CNF: 0x03 0xf5 0x01
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
# ./cansend can0 111#1122334455667788
mcp251x_hw_tx
mcp251x_hw_tx_frame
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
mcp251x_write_bits
mcp251x_spi_trans
mcp251x_read_reg
mcp251x_spi_trans
mcp251x_write_reg
mcp251x_spi_trans
can state bus off
can_bus_off
mcp251x spi0.0: bus-off
mcp251x_write_reg
mcp251x_spi_trans
现在的问题 板子上面的can没有连接其他can设备,是否需要两块板子来测试?从debug看,数据没有发出去,是否是can没有检测到其他节点情况下,发不出去? 可以了.
用socketcan接口,很好用.
收发器电源没有打开. CAN数据是需要回应用的,如果没有回应在CAN控制器上状态是显示没有发送成功 哦,可以参考一下飞凌的CAN模块 飞凌的can 代码,搞的很乱, can driver也有bug. 像6410这种一般用于HMI设备的芯片,我觉得还是别直接搞CAN网络,做CAN的应用层协议效果可能更差,不如单独用个单片机处理CAN协议,开个内存范围,让6410用集成的外设(比如UART)访问会更简单。
页:
[1]