Connecting Beaglebone Black through CAN bus
Topics covering in this blog
- Connecting Beaglebone Black through CAN bus.
- One node running RTEMS.
- Other node running Linux.
Hardware connections for connecting two nodes through CAN bus
In Beaglebone Black, the controller does not have CAN transceivers. So here we use SN65HVD231DR in a breakout board CJMCU-230. We need two SN65HVD231DR CAN transceivers for each node.
Pin Connections
Receiving CAN messages in Linux
- Build and load the linux image to BeagleBone Black.
- Linux has a package CAN-utils, which has cansend, candump commands
$ sudo config-pin p9.24 can
$ sudo config-pin p9.26 can
$ sudo ifconfig can1 down
$ sudo ip link set can1 up type can bitrate 1000000
$ sudo ifconfig can1 up
$ candump can1
Sending CAN messages in RTEMS
- Get the repository(RTEMS source link) and checkout to commit ID: 7a9cc16d.
$ git checkout 7a9cc16d
- Configure and build the RTEMS source
- Load the image to BeagleBone Black
- The CAN test application runs, which sends CAN messages in the CAN bus.
In Linux, candump command prints the CAN message received in the CAN bus.