Using the DCMI Camera Interface

The STM32MP1-BSB board provides the DCMI connector for cameras. This Application Notes describe how to attach such a camera to the board and obtain a video from the camera using the STM32MP1 BSP software.

The Waveshare OV5640 Camera Board (A) or (C) is used to demonstrate the camera support. For the camera software and manuals refer to:

The Waveshare OV5640 Camera Board (A) or (C) must be attached to connector P13 of the STM32MP1-BSB as follows:

  • Use a 18 Position Ribbon Cable Assembly Socket to Socket with 2.54mm pitch 2row connectors:

    • Samtec HCSD-09-D-08.00-01-T or similar is acceptable

  • Make the cable as short as possible, no more than 1 cm length:

adapter.jpg
image-20240417-093042.png

Test the camera interface as below:

  1. Boot the system to the shell prompt.

  2. Verify that the camera is detected on the I2C bus at address 0x3c:

    root@stm32mp15-bsb:~# i2cdetect -y 2 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
  3. Verify that the Linux video stack is configured properly:

    root@stm32mp15-bsb:~# v4l2-ctl --list-devices STM32 Camera Memory Interface (platform:dcmi): /dev/video0
  4. Verify that the camera is able to stream (interrupt with ^C):

    root@stm32mp15-som:~# v4l2-ctl --set-fmt-video=width=320,height=240,pixelformat=RGBP root@stm32mp15-som:~# v4l2-ctl -d /dev/video0 --stream-mmap <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.02 fps <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.02 fps <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.02 fps <<<<<<<<<<<<
  5. Attach an HDMI display to the system as described in Using the MIPI DSI Interface. Stream the video to the display (interrupt with ^C) using the following command: