This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X CAN 速度小于10k,无法发送数据



hi:

我使用的SDK是sdk-processor-03.02,使用了CAN0和CAN1,在dts文件中启用后,在linux下面,使用

root@am335x-evm:~# canconfig can1 bitrate 20000 ctrlmode triple-sampling on
can1 bitrate: 20000, sample-point: 0.875
can1 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]
root@am335x-evm:~# canconfig can0 bitrate 20000 ctrlmode triple-sampling on
can0 bitrate: 20000, sample-point: 0.875
can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]
root@am335x-evm:~# canconfig can0 start
[ 50.903121] c_can_platform 481cc000.can can0: setting BTR=1c3b BRPE=0000
can0 state: ERROR-ACTIVE
root@am335x-evm:~# canconfig can1 start
[ 56.105140] c_can_platform 481d0000.can can1: setting BTR=1c3b BRPE=0000
can1 state: ERROR-ACTIVE

root@am335x-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1
root@am335x-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1

root@am335x-evm:~# candump can1
interface = can1, family = 29, type = 3, proto = 1
<0x010> [8] 11 22 33 44 55 66 77 88
<0x010> [8] 11 22 33 44 55 66 77 88
^C
root@am335x-evm:~# candump can0
interface = can0, family = 29, type = 3, proto = 1
<0x010> [8] 11 22 33 44 55 66 77 88

在速度为20K的情况下可以正常接收数据。

以下是10k的配置,没有数据,示波器测试也没有波形。

root@am335x-evm:~# canconfig can0 bitrate 10000 ctrlmode triple-sampling on
can0 bitrate: 10000, sample-point: 0.875
can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]
root@am335x-evm:~# canconfig can1 bitrate 10000 ctrlmode triple-sampling on
can1 bitrate: 10000, sample-point: 0.875
can1 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]
root@am335x-evm:~# canconfig can0 start
[ 909.184909] c_can_platform 481cc000.can can0: setting BTR=1c37 BRPE=0001
can0 state: ERROR-ACTIVE
root@am335x-evm:~# canconfig can1 start
[ 913.222162] c_can_platform 481d0000.can can1: setting BTR=1c37 BRPE=0001
can1 state: ERROR-ACTIVE
root@am335x-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1
root@am335x-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1
root@am335x-evm:~# cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
interface = can0, family = 29, type = 3, proto = 1

使用candump命令,没有任何数据,请教是怎么回事?

  • 看一下代码,会不会是速率太低了 PLL参数无法配置成功?

  • Denny 你好:

        我看了下代码,添加了一些 调试信息,然后启动后用devmem2读取了BTR的寄存器,调试信息中没有提示有速度设置错误,BTR寄存器的值和设置的也是一样的,我想请教下您指的PLL参数无法配置成功是什么意思,PLL参数在哪里配置的?还有我用的是SDK-PROCESSOR-03.02版本的,这个版本的CAN是否支持10K以下的速度?

       PS:loopback测试正常,但是示波器无法测量到波形。

  • denny你好:

         之前的回复好像没发出来,请问您说的PLL参数无法配置成功是什么意思?AM335X不支持10K以下的速度吗?如果我想用到10K以下的速度该如何修改?

    10K的速度,我调试了下驱动,关于寄存器的配置没有问题,用devmem2读取出来的寄存器数和驱动中写入的值是一样的。为什么就不能工作呢?10k的速度,loopback成功,但是示波器测量不到数据

  • 请参考下这个帖子,问题类似:

    http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/126338.aspx

    看起来应该是can transiver的限制。