cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
3,312 Views
Registered: ‎04-27-2017

Weird Signals from CAN Controller

I'm using the Zynq 7030 with a Poky Linux image and I'm trying to use the CAN controller inside the PS. The two signals of the controller are routed via EMIO to the pins U8 and U9. When I try to send a frame the controller outputs a weird signal that definitively is not a CAN signal. I measured the tx signal with an oscilloscope and the screenshots are attached to this post. 

 

The pins are connected to a CAN transceiver and there are no other nodes on the bus. The bitrate is set to 500,000 kbps but the strange signal seems to be 800µs long. The spikes in the screenshot are just impulses and not frames or so. After sending the first frame the controller goes to the bus-off state. This is normal as there are no other nodes and therefore no ACK. Below I have a snipped on how I activate the controller and send a frame.

 

 

root@yocto:~# ip -details link show can0
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state SLEEPING (berr-counter tx 0 rx 0) restart-ms 0 
          xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 999999990
root@yocto:~# ip link set can0 type can bitrate 500000
root@yocto:~# ip -details link show can0                                                                                                                                                                                                 
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state SLEEPING (berr-counter tx 0 rx 0) restart-ms 0 
          bitrate 499999 sample-point 0.875 
          tq 250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
          xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 999999990
root@yocto:~# ip link set can0 up                                                                                                                                                                                                        
root@yocto:~# ip -details link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 
          bitrate 499999 sample-point 0.875 
          tq 250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
          xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 999999990
root@yocto:~# cansend can0 404#09FA05
root@yocto:~# ip -details link show can0
2: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0 
          bitrate 499999 sample-point 0.875 
          tq 250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
          xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 999999990
root@yocto:~# dmesg | grep -i can
[    2.970070] CAN device driver interface
[    3.005079] can: controller area network core (rev 20120528 abi 9)
[    3.015691] can: raw protocol (rev 20120528)
[    3.020228] can: broadcast manager protocol (rev 20120528 t)
[    3.025820] can: netlink gateway (rev 20130117) max_hops=1
[  187.472969] xilinx_can e0008000.can can0: bitrate error 0.0%

 

 

Tags (2)
SCR03.PNG
SCR04.PNG
0 Kudos
5 Replies
Highlighted
Visitor
Visitor
2,959 Views
Registered: ‎10-14-2016

Re: Weird Signals from CAN Controller

did you find out how to solve this problem? I am facing a similar issue, except that I don't see any signals on my Rx or Tx.Capture.PNG

0 Kudos
Highlighted
Moderator
Moderator
2,936 Views
Registered: ‎07-31-2012

Re: Weird Signals from CAN Controller

Hi,

 

I have followed below link http://www.wiki.xilinx.com/Linux+CAN+driver and dint see any signal on RX or Tx.

 

regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Visitor
Visitor
2,779 Views
Registered: ‎04-27-2017

Re: Weird Signals from CAN Controller

Hi!

 

Sorry for not responding a long time. What first bugs me is that there is the SJA1000 driver listed in your output. Do you maybe have the CAN controller from opencores in your design? You can also activate the pull-up in your Rx pin and do a local loopback with your Tx line, something like 

loopback_rx = rx_pin & tx

This is should let your device listen itself, so it thinks it is properly connected to a transceiver, and ideally it should send a proper frame. Otherwise I suspect a driver problem. Your base registers for the can driver don't look correct or those are the mapped virtual addresses and not the physical addresses.

0 Kudos
Highlighted
2,392 Views
Registered: ‎02-25-2015

Re: Weird Signals from CAN Controller

Hello,

 

I have exactly the same problem, did you figured out what was the problem?

When I send some data from another device on the CAN bus, the status changes to ERROR-PASSIVE.

I tried to loop back externally TX to RX, it sends out continuosly error frames, and shows ERROR-PASSIVE status.

 

0 Kudos
Highlighted
2,376 Views
Registered: ‎02-25-2015

Re: Weird Signals from CAN Controller

Ok, it was a transceiver connection problem. If nobody answers on the bus that causes the error status.

0 Kudos