can not receive can message from CAN bus dcan1 TJA1050 but everything works well when loopback mode

412 views
Skip to first unread message

官大天

unread,
Jun 22, 2017, 2:50:25 AM6/22/17
to BeagleBoard

I use a TJA1050 module to expand My beaglebone black.The two picture up is my circuit. I use two resistors(10K and 4.7K) to convert 5V to 3.3V.

Now,the problem is that when I set can0 up , It could only run on lookback mode, I can get CAN message use (candump can0). It doesn't work on other mode. I can get nothing.

I work with this reference (https://docs.google.com/document/d/1sgurQ-7gLyn7g-Kg983NRM0aDkYEqHqy9dmrieX_RUM/edit#)

 

DCAN1_RX

P9_24

serial in from CAN bus

-27 - +40V common-mode voltage on bus

DCAN1_TX

P9_26

serial out to CAN bus

3V max driver differential output voltage

pin used.
I use USB-CAN adapter to test.

I get this from DCAN1_RX pin. So I think the wiring of CAN bus is fine.


I think there is noly two possibilities. Frist there is some thing wrong with my work. And The second , My BBB is broken.

There is more info below.




debian@beaglebone:~$ sudo ip link set can0 type can bitrate 50000 loopback on
debian@beaglebone:~$ ip -details link show can0
5: can0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can <LOOPBACK> state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
 bitrate 50000 sample-point 0.875 
 tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
 c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
 clock 24000000
debian@beaglebone:~$ sudo ifconfig can0 up
debian@beaglebone:~$ ip -details link show can0
5: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
 bitrate 50000 sample-point 0.875 
 tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
 c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
 clock 24000000

debian@beaglebone:~$ candump can0
  can0  123   [8]  00 01 02 03 04 05 06 07
  can0  123   [8]  00 01 02 03 04 05 06 07
  can0  123   [8]  00 01 02 03 04 05 06 08
  can0  123   [8]  00 01 02 03 04 05 06 08
debian@beaglebone:~$ ifconfig
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:208 


spacel...@gmail.com

unread,
Aug 19, 2018, 3:49:29 PM8/19/18
to BeagleBoard

                              U must have forgot to initialize the can interface. u can check if u initialized them with the following command......
            cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins      OR this command
Reply all
Reply to author
Forward
0 new messages