Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hcyang1012/8027db41cb2babcb88e4f8f2f7ba514d to your computer and use it in GitHub Desktop.
Save hcyang1012/8027db41cb2babcb88e4f8f2f7ba514d to your computer and use it in GitHub Desktop.
Beaglebone BlackConfiguration for DCAN1
/* Device Tree */
&dcan1{
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&dcan1_pins_s0>;
};
&am33xx_pinmux {
/* ... */
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 */\
>;
};
};
/* Start dcan1 */
$ git clone https://github.com/rhyttr/SocketCAN.git
$ sudo apt-get update
$ sudo apt-get install autoconf libtool make
$ cd SocketCAN/can-utils
$ ./autogen
$ ./configure
$ make
$ sudo make install
$ modprobe can
$ modprobe can-dev
$ modprobe can-raw
$ sudo ip link set can0 up type can bitrate 500000
$ sudo ifconfig can0 up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment