我用imx6q-SD的开发板,然后跑linux3.14的内核。打算跑一下can总线,在配置中都将相对应的勾选上。
然后在DTS文件中加上如下信息
&flexcan1{
pinctl-names ="default"; pinctrl-0 = <&pinctrl_flexcan1_1>; status = "okay }
pinctrl_flexcan1_1:flexcan1grp-1{ fsl,pins = < MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000 MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x80000000 >; };
编译后启动得到这样的信息: root@imx6qsabresd:~# dmesg | grep can [ 1.324931] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled [ 1.375581] 2090000.can supply xceiver not found, using dummy regulator [ 1.381635] flexcan 2090000.can: device registered (reg_base=c0a88000, irq=142) [ 4.441142] can: controller area network core (rev 20120528 abi 9) [ 4.449269] can: raw protocol (rev 20120528) [ 4.452243] can: broadcast manager protocol (rev 20120528 t) [ 4.456630] can: netlink gateway (rev 20130117) max_hops=1 root@imx6qsabresd:~#
有个错误,我感觉应该是我的DTS文件写的有问题,但是又找不到问题在哪里?各位有做过的帮我一起看看呗。
随后一番操作如下
root@imx6qsabresd:~# ip link set can0 up type can bitrate 125000 flexcan 2090000.can can0: writing ctrl=0x0e312005 root@imx6qsabresd:~# ifconfig can0 up root@imx6qsabresd:~# ifconfig can0 can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 UP RUNNING NOARP MTU:16 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:142 最后 cansend can0 112#11223344
然后我用示波器看芯片的TX引脚,果然没有丝毫的反应。检测不到任何东西,自己捣鼓了一整天,毫无进展,有人也遇到过这样的情况吗? 谢谢各位了! |