iMX6DL sabreSD的开发板的Flexcan不能工作(已解决)

2020-02-21 21:03发布

本帖最后由 FSL_TICS_ZJJ 于 2014-5-7 10:24 编辑

第一次用 iMX6 的处理器,第一次用 Linux ,才开始学习。
基本情况:
host:ubuntu 12.04 LTS,安装 NFS和TFTP服务;
采用LTIB编译的内核镜像,用的是 L3.0.35-4.1.0-130816;
开发板:FSL原厂的SabreSD,处理器是 IMX6DL;
用 TFTP 的方式加载 kernel ,用 NFS 方式加载 ROOTFS,启动正常;
正常调试:  
已经通过访问字符设备的方式 使用串口收发正常;
使用套接字的方式访问以太网接口,收发正常;

通过LTIB,配置内核,添加了与CAN 有关的驱动模块,编译,
添加 libsocketcan 和 canutils,并且 ./ltib -p libsocketcan.spec -f 以及 ./ltib -p canutils.spec -f
目前存在的问题:回环模式能发不能收,正常模式发送就会导致 BUS-OFF

目前发现问题如下:
(1)  Chip scan failed
(2) 启动过程中注册的flexcan.1 ,而不是正常的 flexCAN.0 ,我采用 cansend can0 ,发送应该就会错误,但不知道如何纠正。
root@freescale ~$ dmesg | grep can
Chip scan failed
vcan: Virtual CAN interface driver
flexcan netdevice driver
flexcan imx6q-flexcan.1: device registered (reg_base=ea9a8000, irq=143)
can: controller area network core (rev 20090105 abi 8)
can: raw protocol (rev 20090105)
can: broadcast manager protocol (rev 20090105 t)
flexcan imx6q-flexcan.1: writing ctrl=0x0e312005
flexcan imx6q-flexcan.1: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x0e312005
flexcan imx6q-flexcan.1: flexcan_chip_start: writing mcr=0x7de2020f
flexcan imx6q-flexcan.1: flexcan_chip_start: writing ctrl=0x0e31ec55
flexcan imx6q-flexcan.1: flexcan_chip_start: reading mcr=0x6de2020f ctrl=0x0e31ec55

第一次用linux 和imx6。可能问题比较初级,还请大家赐教一二。谢谢啦
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
18条回答
leoyang
2020-02-23 09:16
[结贴]
问题解答了,感谢 FSL 的工程师的帮助。
照抄一下在 FSL community 的解答:
In your kernel, you only enabled one hardware CAN device successfully. It is hardware interface CAN1, since there is only one CAN device, the hardware CAN1 will be registered as linux device "can0".

I think you had modified some kernel code, which caused hardware CAN0 driver can't be loaded successfully.

In Freescale default BSP, with boot parameter "can0", the kernel will register two CAN devices, hardware device CAN0 was registered first, it will be linux device "can0"; hardware device CAN1 was registered second, then it will be linux device "can1".
Without the boot parameter "can0", the hardware CAN0 will not be registered, so only hardware device CAN1 was registered, it will be linux device "can0".

In another works, althought your command "ip link set can0 up type can bitrate 125000" accessed the "can0" device, the hardware interface CAN1 was used.

一周热门 更多>