BBB Wireless CAN1

Hi,
I am trying getting CAN bus to work on BBB Wireless for two days without any success. I am using a SN65HVD230D transciever and CAN1. I am following the procedure described by Canbus Python Debian 8.x – Thomas Wedemeyer. Here’s the output of uname -a:
Linux beaglebone 4.19.94-ti-r64 #1buster SMP PREEMPT Fri May 21 23:57:28 UTC 2021 armv7l GNU/Linux

cat /ID.txt:
BeagleBoard.org Debian Buster IoT Image 2020-04-06

The commands used to enable CAN1 are:
sudo config-pin p9.24 can
sudo config-pin p9.26 can
sudo ip link set can1 up type can bitrate 500000 restart-ms 100

I connect another device to the bus and start generating frames. When I do candump can1, nothing happens. Here’s the output of ip -det link show dev can1:

debian@beaglebone:~$ ip -det link show dev can1
3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-PASSIVE (berr-counter tx 0 rx 127) restart-ms 100
bitrate 500000 sample-point 0.875
tq 125 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 24000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

can1: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 2 bytes 16 (16.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 44

I have tested pins 24 and 26 and they toggle when used as GPIO; i also tested can1 in loopback mode, which works. I am lost here and can’t find what I am doing wrong; please help.

Thanks

Do you have at least one termination resistor across CAN_H and CAN_L? CAN communications cannot work without that. The bit rate must be the same for both too.

John Dammeyer

image001.jpg

Yes, I have a termination resistor (I’ve checked with two resistors also). The bit rate is the same.

With the scope I can see the other device transmitting on lines CANH and CANL; I can also see that the transciever has activity on the Rx pin, which is connected to p9.24.

I’ve used socketCAN with the BBB following direcitons similar to this page.

Have you by chance a second CAN device that you can use to monitor packets? I use a CANUSB from Lawicel, for example, as a method of ensuring that I’m working with a healthy CAN bus. I then bring in the Pi or BBB to sniff messages first before I worry about sending. My cape for the Beagle is a LogicSupply unit. I’ll plug it back in and see if I can get communications going. Because the sockets in Lazarus doesn’t support the socketCAN connection I’ve not yet used that with a Lazarus CANopen monitor program I wrote. It’s on the do list but currently project #42.

Does lsmod show a can module loaded?