ECE497 CAN Cape
Embedded Linux Class by Mark A. Yoder
Team members: David Mehl and Sabeeh Khan
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!
00 Executive Summary 00 Installation Instructions 00 User Instructions 00 Highlights 00 Theory of Operation 00 Work Breakdown 00 Future Work 00 Conclusions 00 Demo 00 Late Comments: I'm looking forward to seeing this. Score: 10/100
Accessing your vehicle's CAN bus can be a dangerous endeavor. Reading the bus is typically not a problem, however sending messages can disrupt the operation of the vehicle, cause trouble codes, and potentially lead to undesired operation of the vehicle, up to and including moving under its own discretion. Needless to say, this can FATALLY INJURE YOU, so be careful. We are not responsible for any outcomes that the use of the provided hardware design or software may cause. There is no warranty.
Our project combines a cape circuit board design with the necessary software to configure the Beaglebone Black in order to view the messages on a CAN bus using the can-utils package. The use of jumpers allows for the cape to be adaptable to different situations (such as CAN development, sniffing a vehicle bus, evaluating CAN transceivers, etc) by allowing the user to select whether or not to use a terminating resistor, 3.3V or 5V for the transceiver chip Vcc, and if they would like an OBD-II signal ground to be connected to the ground pour of the board.
The second revision of the circuit board has been tested and is fully functioning as expected, and the configuration script is setting up the pins properly. We were able to read the CAN messages off of a homemade CAN bus built out of two dsPIC33EV256GM102 microcontrollers, and we were able to read the CAN messages off of a 2012 Mazda CX-5. We have used a couple different CAN transceivers and achieved success with both.
This CAN cape will be an excellent tool for anyone wishing to look at CAN communication traffic on a bus or attempting to explore CAN system development. It will be flexible enough to meet almost all CAN development needs with only minor adjustments required to the setup steps to achieve different functionality (active bus participant vs. spy, setting bitrate, etc).
This project includes a printed circuit board. The project files can be found in the Github repository. The schematic symbols and part footprints are also found in the repo. See the below Installation Instructions and Hardware Instructions for information on how to use the included files.
The installation of this project is relatively simple. First, begin by cloning the github repository:
beagle$ git clone https://github.com/SabeehKhan18/Beaglebone-CAN-Cape.git
Be sure you have disabled the HDMI in /boot/uEnv.txt by uncommenting:
If you had not previously done the above, you will need to reboot after uncommenting the line.
Next, run the installation script included in the repo. The installation script installs the linux package 'can-utils' on the beaglebone. This package has the software necessary to make sense of the messages on the bus and provides a display interface:
beagle$ cd Beaglebone-CAN-cape/ beagle$ ./install.sh
Then, be sure you are operating as root, and then source the setup script. This will configure the pin muxes for dcan1, which operates on P9_24 and P9_26. It also uses P8_13 to control the CAN transceiver STANDBY pin. Then it sets up the interface can1. You must provide the bitrate of the CAN bus as an argument, replacing 'BITRATE' in the command below. If you are developing your own network, you should know this value as you should have selected it. If you are attempting to sniff a production vehicle, your best bet is to start with 500000, which is representative of 500 kbps. If this doesn't work, try a google search to see if you can find the bitrate:
beagle$ source setup.sh BITRATE
After the above steps complete successfully, the can1 interface should be up and running. You can confirm this by running:
You should see an interface 'can1' and, if you have connected to a bus and have entered the correct bitrate, you should see an RX count above 0.
To use the board and schematic files included in this repository, you will need to install EAGLE by Cadsoft. The freeware version is enough to open and edit this board. Simply copy the CAN-Cape directory to your EAGLE project directory, or change your EAGLE project directory to this repo on your machine. You will also need to include a library in your project, which is found in the Eagle-Libraries directory. You can find an EAGLE download here:
The board can be printed by sending gerber files to a PCB fab company. I used the Sparkfun DRU and CAM processor in order to check the board and generate the gerber files. They can be found here:
A list of components can be found in PartsList.ods. Feel free to modify the hardware design to accomodate any components you would like to use.
If you have a can1 interface up and running, you now have a couple of can-utils you can use to view the messages. The first is:
beagle$ candump can1
This will dump all of the received CAN messages to the terminal. However, this is very hard to read and is really only useful to determine if the bus is actually running.
If you want a more organized view, then cansniffer is your best bet. Run:
beagle$ cansniffer can1 -c
The cansniffer utility will display the messages received in the terminal as well, but it isn't a scrolling list. When a message is received, and a previous message with that ID has already been received, the new data overwrites the old data. Further, the -c flag causes any differences in the data received from one message to the next to be highlighted in red.
Here is where you brag about what your project can do.
Include a YouTube demo.
Theory of Operation
Give a high level overview of the structure of your software. Are you using GStreamer? Show a diagram of the pipeline. Are you running multiple tasks? Show what they do and how they interact.
Create PCB Footprints: Sabeeh and David
Create Schematic: David
Create PCB Layout: David
Explore Device Tree Overlays: Sabeeh
Create Setup Script: Sabeeh
Verify First Revision PCB: Sabeeh and David
Verify Second Revision PCB: Sabeeh and David
Verify Overall Functionality: Sabeeh and David
Enhance User Interface: Time permitting, target date 11/10/16
Suggest addition things that could be done with this project.
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
Embedded Linux Class by Mark A. Yoder