6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi 4でkernelを更新してD435iを動かす

Last updated at Posted at 2020-02-16

概要

D435iを使うために、kernelに含まれていないモジュールが必要になり、kernelの更新作業をしたので作業ログを書いておく。

ほとんど以下のissueに書かれていた手順を利用した。

参考

IntelRealSense/librealsense, "Announcement: Raspberry Pi 4 Model B with two USB 3 ports now available" #4272

環境

  • Raspberry Pi 4 model B 4GB
  • Raspbian Buster
  • kernelのバージョン: 4.19.97-v7l+(更新前)→4.19.102-v7l+(更新後)

kernelの更新が必要な条件

D435iを抜き差ししたとき、dmesgで確認すると、hid-sensor-hubではなく、hid-generalが使用されている。

作業ログ

/bootのバックアップ

sudo cp -r /boot /boot.backup

kernelの更新

sudo apt-get install build-essential bison flex bc git libncurses-dev libssl-dev libprotobuf-dev cmake libusb-1.0-0-dev
git clone -b rpi-4.19.y https://github.com/raspberrypi/linux.git --depth 1 rpi-4.19.y
cd rpi-4.19.y
wget https://raw.githubusercontent.com/Delicode/librealsense/master/scripts/realsense_raspberry4.patch
patch -p1 < realsense_raspberry4.patch
make bcm2711_defconfig
make menuconfig # set HID_SENSOR_HUB, HID_SENSOR_ACCEL_3D, HID_SENSOR_GYRO_3D, USB_VIDEO_CLASS, VIDEO_V4L2
make ARCH=arm -j4 zImage modules dtbs
sudo make ARCH=arm modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/kernel7l.img

一度再起動して、

sudo modprobe videodev
sudo modprobe uvcvideo
sudo modprobe hid_sensor_accel_3d
sudo modprobe hid_sensor_gyro_3d

librealsenseのビルド・インストール

sudo apt install pkg-config freeglut3-dev libgtk-3-dev libglfw3-dev
git clone https://github.com/intelrealsense/librealsense
mkdir -p librealsense/build
cd librealsense/build
cmake ..
make -j4
sudo make install

udevの設定

sudo cp librealsense/config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

動作確認

dmesgでhid-generalではなく、hid-sensor-hubが使用されていることを確認した。
rs-enumerate-devicesrealsense-viewerで動作を確認した。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?