Installation and Driver Startup
Folder Structure
| Folder/File Name | Description |
|---|---|
| 01_drv | Directory containing the SocketCAN driver itself |
| 02_sample | Directory containing sample scripts |
| ReadMe.txt | Original source file of this manual |
Installation Procedure
Build the Driver (First Time Only)
- Copy the
01_drvdirectory to your Linux PC. - Move to
01_drvin the terminal and run themakecommand (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.
- Grant execution permission to the
mpdrv_runfile.
chmod +x mpdrv_run
- Load the driver.
./mpdrv_run load
- Start both channels
can0andcan1(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.
- Start the SocketCAN kernel driver.
sudo modprobe can
- Load the device driver library.
sudo modprobe can_div
- Load the MicroPeckerX driver.
sudo insmod ./MpxDrv.ko
- Set the CAN/CAN FD protocol for can0.
sudo ip link set can0 mtu 16
The setting values are as follows.
| Protocol | Setting value |
|---|---|
| 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
This driver supports 2 channels, so start can1 in the same way.
- Set the CAN/CAN FD protocol 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 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.