Installation and Driver Startup
Folder Structure
| Folder / File | Description |
|---|---|
| 01_drv | Directory containing the SocketCAN driver. |
| 02_sample | Directory containing sample scripts. |
| ReadMe.txt | Source file for this manual. |
Installation Procedure
Build the Driver (First Time Only)
- Copy the
01_drvdirectory to your Linux PC. - Open a terminal, move to
01_drv, and run themakecommand (GCC required).
cd 01_drv
make
A binary for the currently running kernel will be generated.
Starting the MicroPeckerX SocketCAN Driver
Quick Start
mpdrv_run is a script that consolidates the steps required to start the MicroPeckerX SocketCAN driver.
Use it to launch the driver easily.
- Grant execute permission to the
mpdrv_runfile.
chmod +x mpdrv_run
- Load the driver.
./mpdrv_run load
- Start both the can0 and can1 channels (start both even if you only use one).
./mpdrv_run start can0
./mpdrv_run start can1
Step-by-Step Startup
This section explains how to start the MicroPeckerX SocketCAN driver manually.
- Load the SocketCAN kernel driver.
sudo modprobe can
- Load the library for the device driver.
sudo modprobe can_div
- Load the MicroPeckerX driver.
sudo insmod ./MpxDrv.ko
- Configure the CAN / CAN FD protocol settings for can0.
sudo ip link set can0 mtu 16
The configuration values are as follows.
| Protocol | Setting |
|---|---|
| CAN | mtu 16 |
| CAN FD | mtu 72 |
- Bring up the can0 network interface at 500 kbps.
sudo ip link set can0 up type can bitrate 500000
The driver supports two channels, so start can1 in the same way.
- Configure the CAN / CAN FD protocol settings for can1.
sudo ip link set can1 mtu 16
- Bring up the can1 network interface at 500 kbps.
sudo ip link set can1 up type can bitrate 500000
This completes the startup procedure for the MicroPeckerX SocketCAN driver.
tip
Please also refer to the following YouTube video for installation instructions.
MicroPeckerX SocketCAN Driver Quick Start Guide (candump)
The video shows an older version. The latest release supports two channels, so please start both can0 and can1.