🛠 Brancher une caméra CSI (OV5647) sur un CM3
Objectives
Use the CM3's MIPI CSI interface for a camera. Unlike a standard Pi 3, the CM3 exposes TWO CSI connectors on the SODIMM: one 4-lane and one 2-lane (up to 1 Gbit/s per lane, datasheet RP-008161-DS §2.2). The firmware only supports known sensors (OV5647 from the v1 camera, IMX219 from the v2 camera): third-party MIPI sensors do not work without specific porting.
Hardware
- CM3 on CMIO3, Raspberry Pi OS booted
- Raspberry Pi Camera v1 (OV5647) or v2 (IMX219) + CSI ribbon cable
- The ribbon cable is plugged with the keying aligned to the CSI1 connector on the CMIO3 (silk marking on the board)
Complete code
# 1. Activer la caméra dans /boot/firmware/config.txt :
sudo tee -a /boot/firmware/config.txt <<'EOF'
start_x=1
camera_auto_detect=1
EOF
sudo reboot
# 2. Vérifier que le firmware a détecté le capteur
vcgencmd get_camera # attendu : supported=1 detected=1
# 3. Capturer une image
sudo apt install -y libraspberrypi-bin
raspistill -o test.jpg -t 1000 -w 1920 -h 1080
ls -lh test.jpg
Expected verification
vcgencmd get_camera returns supported=1 detected=1 and raspistill produces a JPEG image of approximately 1920x1080. The camera LED lights up during capture. On a recent system using libcamera, the v2 camera is also visible via libcamera-still -o test.jpg.
Common errors
- CSI ribbon cable installed backwards (keying misaligned): permanent
detected=0, no damage but no detection. start_x=1forgotten: the VideoCore IV GPU controller is not initialized for the camera.- Expecting a third-party camera (OV13850, etc.) to work: only firmware-known sensors work on CSI — this is a documented limitation of the closed-source stack.
- Confusing the two CSI connectors: on the CMIO3, the main 4-lane connector provides full resolution; the second one (2-lane) is intended for a secondary camera (see the dual-camera tutorial).
- Removing the ribbon cable while powered on: the CSI bus is not hot-pluggable, power off first.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash