Hi,
I am currently trying to get CAN setup on the beagle bone black. However, not able to receive any CAN frames when I do candump can0. Our current configuration setup is:
Have an CAN transceiver's RX and TX lines hooked up to the RX(P9_26) and TX(P9_24) pins on the Beagle bone black and the CANH and CANL lines hooked up to one of our custom CAN nodes which is always outputting CAN frames. We made sure that this node is sending out CAN frames and it is so we have data on the CAN bus the beagle bone isnt able to pick up the CAN frames.
So first for the configuration:
Have written the device overlay to set the correct pin muxing. This is the device overlay used :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/dts-v1/; /plugin/; / { compatible = "ti,beaglebone", "ti,beaglebone-black"; /* identification */ part-number = "dcan1pinmux"; fragment@0 { target = <&am33xx_pinmux>; __overlay__ { dcan1_pins_s0: dcan1_pins_s0 { pinctrl-single,pins = < 0x180 0x12 /* d_can1_tx, SLEWCTRL_FAST | INPUT_PULLUP | MODE2 */ 0x184 0x32 /* d_can1_rx, SLEWCTRL_FAST | RECV_ENABLE | INPUT_PULLUP | MODE2 */ >; }; }; }; fragment@1 { target = <&dcan1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&dcan1_pins_s0>; }; }; }; |
Then compiled the overlay with the command: dtc -O dtb -o BB-DCAN1-00A0.dtbo -b 0 -@ BB-DCAN1-00A0.dts
and did the following steps after
1) sudo cp BB-DCAN1-00A0.dtbo /lib/firmware
2) echo BB-DCAN1 > /sys/devices/bone_capemgr.*/slots
3)
sudo modprobe can sudo modprobe can-dev sudo modprobe can-raw
|
4) Then cloned the latest can-utils () Then ran make and make install
5) Then these commands:
sudo
ip link
set
can0 up
type
can bitrate 125000
sudo
ifconfig
can0 up