BBB board has two CAN bus, can0 is enabled by default. For NezaRobot, one CAN bus is enough. It is used to communicate to ez430 board to send out motor control command.
Oscillator of BBB CAN bus clock used is 20MHz, but I can't find the same frequency oscillator, before I have one board from other project which oscillator is 12.288MHz, no matter what register to configure, it is very difficult to match with 20MHz, communication sometimes is lost, finally I found one 24MHz oscillator from my old video card. Then configure CAN bus register, both are exactly matched.
#enable CAN device
echo BB-DCAN1 > /sys/devices/bone_capemgr.9/slots
#configure bitrate to be 300Kbps
./canconfig can0 bitrate 300000
ifconfig can0 up