Skip to content

video: introduction of STM32 DCMIPP driver #89407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/shields/st_b_cams_imx_mb1854/boards/stm32n6570_dk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pRAA"
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=2592
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=1944
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pRAA"
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=2592
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=1944
36 changes: 35 additions & 1 deletion boards/st/stm32n6570_dk/stm32n6570_dk_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
#include "zephyr/dt-bindings/display/panel.h"
#include <zephyr/dt-bindings/flash_controller/xspi.h>
#include <zephyr/dt-bindings/gpio/raspberrypi-csi-22pins-connector.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/video/video-interfaces.h>
#include "arduino_r3_connector.dtsi"
Expand Down Expand Up @@ -54,6 +55,15 @@
label = "User LD2";
};
};

csi_22pins_connector: connector_csi_22pins {
compatible = "raspberrypi,csi-22pins-connector";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <CSI_22PINS_IO0 0 &gpioc 8 0>,
<CSI_22PINS_IO1 0 &gpiod 2 0>;
};
};

&i2c2 {
Expand Down Expand Up @@ -160,6 +170,18 @@
status = "okay";
};

&ic17 {
pll-src = <1>;
ic-div = <4>;
status = "okay";
};

&ic18 {
pll-src = <1>;
ic-div = <60>;
status = "okay";
};

&perck {
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
status = "okay";
Expand Down Expand Up @@ -196,7 +218,7 @@
status = "okay";
};

&i2c1 {
csi_22pins_i2c: &i2c1 {
clocks = <&rcc STM32_CLOCK(APB1, 21)>,
<&rcc STM32_SRC_CKPER I2C1_SEL(1)>;
pinctrl-0 = <&i2c1_scl_ph9 &i2c1_sda_pc1>;
Expand Down Expand Up @@ -393,3 +415,15 @@ zephyr_udc0: &usbotg_hs1 {
def-back-color-green = <0xFF>;
def-back-color-blue = <0xFF>;
};

csi_22pins_interface: &dcmipp {
ports {
port@0 {
csi_22pins_ep_in: endpoint { };
};

port@1 {
csi_22pins_capture_port: endpoint@1 { };
};
};
};
1 change: 1 addition & 0 deletions drivers/video/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ zephyr_library_sources_ifdef(CONFIG_VIDEO_EMUL_IMAGER video_emul_imager.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_EMUL_RX video_emul_rx.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_IMX335 imx335.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_ST_MIPID02 video_st_mipid02.c)
zephyr_library_sources_ifdef(CONFIG_VIDEO_STM32_DCMIPP video_stm32_dcmipp.c)

zephyr_linker_sources(DATA_SECTIONS video.ld)
2 changes: 2 additions & 0 deletions drivers/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ source "drivers/video/Kconfig.imx335"

source "drivers/video/Kconfig.st_mipid02"

source "drivers/video/Kconfig.stm32_dcmipp"

endif # VIDEO
36 changes: 36 additions & 0 deletions drivers/video/Kconfig.stm32_dcmipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# STM32 DCMIPP driver configuration options

# Copyright (c) 2025 STMicroelectronics.
# SPDX-License-Identifier: Apache-2.0

config VIDEO_STM32_DCMIPP
bool "STM32 Digital Camera Memory Interface Pixel Processor (DCMIPP) driver"
default y
depends on DT_HAS_ST_STM32_DCMIPP_ENABLED
select USE_STM32_HAL_DCMIPP
select USE_STM32_HAL_RIF if SOC_SERIES_STM32N6X
help
Enable driver for STM32 Digital Camera Memory Interface Pixel Processor
(DCMIPP) peripheral

if VIDEO_STM32_DCMIPP

config VIDEO_STM32_DCMIPP_SENSOR_WIDTH
int "Width of the sensor frame"
default 2592
help
Width of the sensor video frame.

config VIDEO_STM32_DCMIPP_SENSOR_HEIGHT
int "Height of the sensor frame"
default 1944
help
Height of the sensor video frame.

config VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT
string "Pixel format of the sensor frame"
default "RG12"
help
Pixel format of the sensor video frame.

endif
Loading
Loading