Skip to main content

Installation and Driver Startup

Folder Structure

Folder/File NameDescription
01_drvDirectory containing the SocketCAN driver itself
02_sampleDirectory containing sample scripts
ReadMe.txtOriginal source file of this manual

Installation Procedure

Build the Driver (First Time Only)

  1. Copy the 01_drv directory to your Linux PC.
  2. Move to 01_drv in the terminal and run the make command (GCC required).
cd 01_drv
make

A binary for the currently running kernel will be generated.

Starting the MicroPeckerX SocketCAN Driver

Driver Startup (Simple Method)

mpdrv_run is a script that combines the startup steps for the MicroPeckerX SocketCAN driver.
You can start the driver easily.

  1. Grant execution permission to the mpdrv_run file.
chmod +x mpdrv_run
  1. Load the driver.
./mpdrv_run load
  1. Start both channels can0 and can1 (both must be started even if one is unused).
./mpdrv_run start can0
./mpdrv_run start can1

Driver Startup (Step-by-Step Method)

Startup procedure for the MicroPeckerX SocketCAN driver.

  1. Start the SocketCAN kernel driver.
sudo modprobe can
  1. Load the device driver library.
sudo modprobe can_div
  1. Load the MicroPeckerX driver.
sudo insmod ./MpxDrv.ko
  1. Set the CAN/CAN FD protocol for can0.
sudo ip link set can0 mtu 16

The setting values are as follows.

ProtocolSetting value
CANmtu 16
CAN FDmtu 72
  1. Bring up the can0 network interface at 500 kbps.
sudo ip link set can0 up type can bitrate 500000

This driver supports 2 channels, so start can1 in the same way.

  1. Set the CAN/CAN FD protocol for can1.
sudo ip link set can1 mtu 16
  1. Bring up the can1 network interface at 500 kbps.
sudo ip link set can1 up type can bitrate 500000

This completes startup of the MicroPeckerX SocketCAN driver.

tip

Please also refer to the following video (YouTube) for installation.

MicroPeckerX SocketCAN Driver Quick Start Guide (candump)

The video is for an older version. The latest version supports 2 channels, so start both can0 and can1.