Skip to main content

Raspberry Pi 4 CM Bookworm

Prepare SD card

  • Device: Raspberry Pi 4 (Models B, 400, and compute Modules 4, 4S)
  • OS: Raspberry Pi OS (64-bit) (tested with release 2025-05-13)

Connect CSI2 camera

image-1750012137831.jpg

In this picture camera is connected to cam1 port.

OS Prepare

Login to your Raspberry device and update it first.

sudo apt update
sudo apt upgrade -y

IMX462

Camera 462x-CSI-M12x

Setup camera

Edit config file:

sudo nano /boot/firmware/config.txt
# camera_auto_detect=1 --- Find camera_auto_detect=1 and comment it out.

# Paste these lines at the end of the config file
dtoverlay=imx462,cam1,clock-frequency=37125000
camera_auto_detect=0

Reboot

Test camera

Check if camera is detected

libcamera-hello --list-cameras

Available cameras
-----------------
0 : imx462 [1920x1080 12-bit RGGB] (/base/soc/i2c0mux/i2c@0/imx290@1a)
    Modes: 'SRGGB10_CSI2P' : 1280x720 [60.00 fps - (320, 180)/1280x720 crop]
                             1920x1080 [60.00 fps - (0, 0)/1920x1080 crop]
           'SRGGB12_CSI2P' : 1280x720 [60.00 fps - (320, 180)/1280x720 crop]
                             1920x1080 [60.00 fps - (0, 0)/1920x1080 crop]

Capture picture to /tmp/test.jpg

libcamera-jpeg -o /tmp/test.jpg -n

[0:04:03.062321913] [1710]  INFO Camera camera_manager.cpp:326 libcamera v0.5.0+59-d83ff0a4
[0:04:03.107442902] [1713]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:04:03.108303290] [1713]  WARN CameraSensor camera_sensor_legacy.cpp:501 'imx462 0-001a': No sensor delays found in static properties. Assuming unverified defaults.
[0:04:03.109060881] [1713]  INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@0/imx290@1a to Unicam device /dev/media1 and ISP device /dev/media2
[0:04:03.109105270] [1713]  INFO RPI pipeline_base.cpp:1121 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Mode selection for 960:540:12:P
    SRGGB10_CSI2P,1280x720/0 - Score: 1125
    SRGGB10_CSI2P,1920x1080/0 - Score: 1375
    SRGGB12_CSI2P,1280x720/0 - Score: 125
    SRGGB12_CSI2P,1920x1080/0 - Score: 375
Stream configuration adjusted
[0:04:03.110893565] [1710]  INFO Camera camera.cpp:1205 configuring streams: (0) 960x540-YUV420 (1) 1280x720-SRGGB12_CSI2P
[0:04:03.111358953] [1713]  INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@0/imx290@1a - Selected sensor format: 1280x720-SRGGB12_1X12 - Selected unicam format: 1280x720-pRCC
Mode selection for 1920:1080:12:P
    SRGGB10_CSI2P,1280x720/0 - Score: 3000
    SRGGB10_CSI2P,1920x1080/0 - Score: 1000
    SRGGB12_CSI2P,1280x720/0 - Score: 2000
    SRGGB12_CSI2P,1920x1080/0 - Score: 0
Stream configuration adjusted
[0:04:08.370889477] [1710]  INFO Camera camera.cpp:1205 configuring streams: (0) 1920x1080-YUV420 (1) 1920x1080-SRGGB12_CSI2P
[0:04:08.374117010] [1713]  INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@0/imx290@1a - Selected sensor format: 1920x1080-SRGGB12_1X12 - Selected unicam format: 1920x1080-pRCC
Still capture image received