junh-ki / dias_kuksa

Pieces of connectivity implementation with Eclipse KUKSA for DIAS.
https://dias-kuksa-doc.readthedocs.io/en/latest/
GNU General Public License v3.0
4 stars 3 forks source link

2-Channel CAN shield HW configuration #5

Closed junh-ki closed 3 years ago

junh-ki commented 4 years ago

Setting Up

RaspPi Setup $ sudo apt-get install can-utils $ git clone https://github.com/seeed-Studio/pi-hats $ cd pi-hats/CAN-HAT $ sudo ./install.sh $ sudo reboot

$ dmesg | grep spi

[ 3.725586] mcp25xxfd spi0.0 can0: MCP2517 successfully initialized. [ 3.757376] mcp25xxfd spi1.0 can1: MCP2517 successfully initialized.

Linux Setup $ sudo apt-get install can-utils

PEAK-USB--------------------120ohm--------------------CAN wire--------------------120ohm--------------------RaspPi

Tutorial A - FD off

  1. (Linux) $ sudo ip link set can0 up type can bitrate 1000000 restart-ms 1000 fd off

  2. (RaspPi) $ sudo ip link set can0 up type can bitrate 1000000 restart-ms 1000 fd off

  3. (RaspPi) $ candump can0

  4. (Linux) $ cangen can0 -g 500

Tutorial B - FD on

  1. (Linux) $ sudo ip link set can0 down $ sudo ip link set can0 up type can bitrate 1000000 dbitrate 2000000 restart-ms 1000 fd on

  2. (RaspPi) $ sudo ip link set can0 down $ sudo ip link set can0 up type can bitrate 1000000 dbitrate 2000000 restart-ms 1000 fd on

  3. (RaspPi) $ candump can0

  4. (Linux) $ cangen can0 -g 500 -f