Hardware Solution to Guarantee Read-Only Access of a CAN Bus

Hardware Solution to Guarantee Read-Only Access of a CAN Bus

The CAN bus is a standard network allowing multiple devices to talk to each other. It’s widely used on vehicles (in fact, it's likely that your car has at least ten) as well as in the industrial automation world.

Recently were troubleshooting a strange issue which was causing one of the devices on the CAN bus to periodically do something that it wasn't commanded to do. By disconnecting other devices on the CAN bus, we were able to trace the issue back to the single device which was causing the trouble. 

The CAN bus device is meant only to monitor the particular bus and should never send any actual data to the bus. But how were we to confirm that this was actually happening?

CAN bus does not have any security scheme; so any device could send data to any other device and this could easily mess up the whole bus/protocol. Usually a CAN bus’ lack of security is not problem, sometimes it's even a benefit, if for example, you need to hack your own car. However, for this particular situation we needed to force the device to be “read-only.”

The ultimate solution needed to be implemented on the hardware-level.

Electrically a CAN bus is pretty simple. Usually there is a special driver chip to interface with the bus. We isolated part of the bus with two drivers, but connected RX pins only. Such an adapter, however, needed a power supply. We thought that maybe we could do so with diodes.

We added the diodes and it worked! See the schematic below for a before and after high-level overview of how to configure the diodes, and a terminating resistor, on the two lines of the CAN bus.



Learn more about DMC's custom software and hardware development.


There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

Enter the code shown above: