Skip to content

Commit da7c49b

Browse files
committed
boards: shields: add suport for st_b_cams_omv_mb1683
Add support for ST B-CAMS-OMV MB1683 shield. Signed-off-by: Charles Dias <[email protected]>
1 parent 94cd786 commit da7c49b

File tree

9 files changed

+330
-0
lines changed

9 files changed

+330
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Charles Dias <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ST_B_CAMS_OMV_MB1683
5+
def_bool $(shields_list_contains,st_b_cams_omv_mb1683)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2025 Charles Dias <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
&st_cam_i2c {
9+
pinctrl-0 = <&i2c4_scl_pd12 &i2c4_sda_pd13>;
10+
pinctrl-names = "default";
11+
status = "okay";
12+
clock-frequency = <I2C_BITRATE_FAST>;
13+
};
14+
15+
&st_cam_dvp {
16+
pinctrl-0 = <&dcmi_hsync_pa4 &dcmi_pixclk_pa6 &dcmi_vsync_pb7
17+
&dcmi_d0_pc6 &dcmi_d1_pc7 &dcmi_d2_pg10 &dcmi_d3_pc9
18+
&dcmi_d4_pc11 &dcmi_d5_pd3 &dcmi_d6_pb8 &dcmi_d7_pb9>;
19+
pinctrl-names = "default";
20+
21+
dmas = <&dma1 0 75 (STM32_DMA_PERIPH_TO_MEMORY | STM32_DMA_PERIPH_NO_INC |
22+
STM32_DMA_MEM_INC | STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_32BITS |
23+
STM32_DMA_PRIORITY_HIGH) STM32_DMA_FIFO_1_4>;
24+
};
25+
26+
&dma1 {
27+
status = "okay";
28+
};
29+
30+
&dmamux1 {
31+
status = "okay";
32+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
.. _st_b_cams_omv_mb1683:
2+
3+
ST B-CAMS-OMV-MB1683
4+
####################
5+
6+
Overview
7+
********
8+
9+
The camera module bundle (B-CAMS-OMV) provides extension connectors
10+
for the MB1379 STMicroelectronics camera module daughterboard or
11+
third-party modules like OpenMV and Waveshare modules. It can be used
12+
with the STM32 boards featuring a 1 x 30 pin ZIF connector for the
13+
connection of multiple cameras to implement computer vision on STM32
14+
microcontrollers easily.
15+
16+
The camera module bundle is compatible with all STM32 Discovery kits and
17+
Evaluation boards featuring a ZIF connector, such as the STM32H747I-DISCO,
18+
STM32H7B3I-DK, and 32L4R9IDISCOVERY Discovery kits.
19+
20+
.. figure:: st_b_cams_omv.webp
21+
:width: 600px
22+
:align: center
23+
:alt: B-CAMS-OMV-MB1683
24+
25+
B-CAMS-OMV MB1683 Image (Credit: STMicroelectronics.)
26+
27+
The camera signals go into the shield from one of the supported input
28+
connectors (CN1, CN2, CN4), and out of the shield towards Zephyr through
29+
the output 30-pin ZIF connector CN5.
30+
31+
Refer to the `User manual`_ for the pinout of CN1 and CN2.
32+
33+
Waveshare camera board connector CN4 (camera input)
34+
***************************************************
35+
36+
+------------+-----------------+------------+--------------+
37+
| Pin number | Description | Pin number | Description |
38+
+============+=================+============+==============+
39+
| 1 | GND | 2 | VCAM |
40+
+------------+-----------------+------------+--------------+
41+
| 3 | I2C_SDA | 4 | I2C_SCL |
42+
+------------+-----------------+------------+--------------+
43+
| 5 | DCMI_HSYNC | 6 | DCMI_VSYNC |
44+
+------------+-----------------+------------+--------------+
45+
| 7 | Camera_CLK | 8 | DCMI_PIXCLK |
46+
+------------+-----------------+------------+--------------+
47+
| 9 | DCMI_D6 | 10 | DCMI_D7 |
48+
+------------+-----------------+------------+--------------+
49+
| 11 | DCMI_D4 | 12 | DCMI_D5 |
50+
+------------+-----------------+------------+--------------+
51+
| 13 | DCMI_D2 | 14 | DCMI_D3 |
52+
+------------+-----------------+------------+--------------+
53+
| 15 | DCMI_D0 | 16 | DCMI_D1 |
54+
+------------+-----------------+------------+--------------+
55+
| 17 | PWR_EN / LED1 | 18 | RESET# |
56+
+------------+-----------------+------------+--------------+
57+
58+
ZIF connector CN5 (camera output)
59+
*********************************
60+
61+
+------------+-----------------+
62+
| Pin number | Description |
63+
+============+=================+
64+
| 1 | 3V3 |
65+
+------------+-----------------+
66+
| 2 | GND |
67+
+------------+-----------------+
68+
| 3 | I2C_SCL |
69+
+------------+-----------------+
70+
| 4 | I2C_SDA |
71+
+------------+-----------------+
72+
| 5 | RESET# |
73+
+------------+-----------------+
74+
| 6 | PWR_EN / LED1 |
75+
+------------+-----------------+
76+
| 7 | SHUTTER |
77+
+------------+-----------------+
78+
| 8 | GND |
79+
+------------+-----------------+
80+
| 9 | PULLDOWN / LED2 |
81+
+------------+-----------------+
82+
| 10 | Camera_CLK |
83+
+------------+-----------------+
84+
| 11 | 3V3 |
85+
+------------+-----------------+
86+
| 12 | DCMI_VSYNC |
87+
+------------+-----------------+
88+
| 13 | 5V (RSU) |
89+
+------------+-----------------+
90+
| 14 | DCMI_HSYNC |
91+
+------------+-----------------+
92+
| 15 | GND |
93+
+------------+-----------------+
94+
| 16 | DCMI_PIXCK |
95+
+------------+-----------------+
96+
| 17 | GND |
97+
+------------+-----------------+
98+
| 18 | SPI_MISO |
99+
+------------+-----------------+
100+
| 19 | SPI_CS |
101+
+------------+-----------------+
102+
| 20 | DCMI_D7 |
103+
+------------+-----------------+
104+
| 21 | DCMI_D6 |
105+
+------------+-----------------+
106+
| 22 | DCMI_D5 |
107+
+------------+-----------------+
108+
| 23 | DCMI_D4 |
109+
+------------+-----------------+
110+
| 24 | DCMI_D3 |
111+
+------------+-----------------+
112+
| 25 | DCMI_D2 |
113+
+------------+-----------------+
114+
| 26 | DCMI_D1 |
115+
+------------+-----------------+
116+
| 27 | DCMI_D0 |
117+
+------------+-----------------+
118+
| 28 | SPI_MOSI |
119+
+------------+-----------------+
120+
| 29 | SPI_CLK |
121+
+------------+-----------------+
122+
| 30 | GND |
123+
+------------+-----------------+
124+
125+
Requirements
126+
************
127+
128+
The camera module bundle is compatible with all STM32 Discovery kits and
129+
Evaluation boards featuring a ZIF connector, such as the STM32H747I-DISCO,
130+
STM32H7B3I-DK, and 32L4R9IDISCOVERY Discovery kits.
131+
132+
Usage
133+
*****
134+
135+
The shield can be used in any application by setting ``SHIELD`` to
136+
``_st_b_cams_omv_mb1683`` and adding the necessary device tree properties.
137+
138+
Set ``--shield "st_b_cams_omv_mb1683"`` when you invoke ``west build``. For example:
139+
140+
.. zephyr-app-commands::
141+
:zephyr-app: samples/drivers/video/capture_to_lvgl
142+
:board: stm32h7b3i_dk
143+
:shield: st_b_cams_omv_mb1683
144+
:goals: build
145+
146+
References
147+
**********
148+
149+
- `Product page <https://www.st.com/en/evaluation-tools/b-cams-omv.html>`_
150+
151+
- `Databrief <https://www.st.com/resource/en/data_brief/b-cams-omv.pdf>`_
152+
153+
- `User manual <https://www.st.com/resource/en/user_manual/um2779-camera-module-bundle-for-stm32-boards-stmicroelectronics.pdf>`_
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2025 Charles Dias <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#include <zephyr/dt-bindings/video/video-interfaces.h>
9+
10+
/ {
11+
chosen {
12+
zephyr,camera = &st_cam_dvp;
13+
};
14+
};
15+
16+
&st_cam_i2c {
17+
18+
ov5640: ov5640@3c {
19+
compatible = "ovti,ov5640";
20+
reg = <0x3c>;
21+
status = "okay";
22+
reset-gpios = <&dmci_camera_connector 5 GPIO_ACTIVE_LOW>;
23+
powerdown-gpios = <&dmci_camera_connector 6 GPIO_ACTIVE_HIGH>;
24+
25+
port {
26+
ov5640_ep_out: endpoint {
27+
remote-endpoint-label = "dcmi_ep_in";
28+
bus-type = <VIDEO_BUS_TYPE_PARALLEL>;
29+
};
30+
};
31+
};
32+
};
33+
34+
&st_cam_dvp {
35+
status = "okay";
36+
sensor = <&ov5640>;
37+
38+
bus-width = <8>;
39+
hsync-active = <0>;
40+
vsync-active = <0>;
41+
pixelclk-active = <1>;
42+
capture-rate = <1>;
43+
44+
port {
45+
dcmi_ep_in: endpoint {
46+
remote-endpoint-label = "ov5640_ep_out";
47+
};
48+
};
49+
};

boards/st/stm32h7b3i_dk/stm32h7b3i_dk.dts

+26
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,28 @@
7575
#phy-cells = <0>;
7676
};
7777

78+
dmci_camera_connector: connector_dcmi_camera {
79+
compatible = "st,stm32-dcmi-camera-fpu-330zh";
80+
#gpio-cells = <2>;
81+
gpio-map-mask = <0xffffffff 0xffffffc0>;
82+
gpio-map-pass-thru = <0 0x3f>;
83+
gpio-map = <3 0 &gpiod 12 0>, /* I2C4_SCL */
84+
<4 0 &gpiod 13 0>, /* I2C4_SDA */
85+
<5 0 &gpioa 0 0>, /* RESET# */
86+
<6 0 &gpioa 7 0>, /* PWDN_EN */
87+
<12 0 &gpiob 7 0>, /* DCMI_VSYNC */
88+
<14 0 &gpioa 4 0>, /* DCMI_HSYNC */
89+
<16 0 &gpioa 6 0>, /* DCMI_PIXCK */
90+
<20 0 &gpiob 9 0>, /* DCMI_D7 */
91+
<21 0 &gpiob 8 0>, /* DCMI_D6 */
92+
<22 0 &gpiod 3 0>, /* DCMI_D5 */
93+
<23 0 &gpioc 11 0>, /* DCMI_D4 */
94+
<24 0 &gpioc 9 0>, /* DCMI_D3 */
95+
<25 0 &gpiog 10 0>, /* DCMI_D2 */
96+
<26 0 &gpioc 7 0>, /* DCMI_D1 */
97+
<27 0 &gpioc 6 0>; /* DCMI_D0 */
98+
};
99+
78100
aliases {
79101
led0 = &blue_led;
80102
led1 = &red_led;
@@ -278,3 +300,7 @@
278300
};
279301
};
280302
};
303+
304+
st_cam_i2c: &i2c4 {};
305+
306+
st_cam_dvp: &dcmi {};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2025 Charles Dias
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
GPIO pins exposed on the 30-pin ZIF connector (CN5) of the B-CAMS-OMV.
6+
Connector layout:
7+
(1) 3V3
8+
(2) GND
9+
(3) I2C_SCL
10+
(4) I2C_SDA
11+
(5) RESET#
12+
(6) PWR_EN / LED1
13+
(7) SHUTTER
14+
(8) GND
15+
(9) PULLDOWN / LED2
16+
(10) Camera_CLK
17+
(11) 3V3
18+
(12) DCMI_VSYNC
19+
(13) 5V (RSU)
20+
(14) DCMI_HSYNC
21+
(15) GND
22+
(16) DCMI_PIXCK
23+
(17) GND
24+
(18) SPI_MISO
25+
(19) SPI_CS
26+
(20) DCMI_D7
27+
(21) DCMI_D6
28+
(22) DCMI_D5
29+
(23) DCMI_D4
30+
(24) DCMI_D3
31+
(25) DCMI_D2
32+
(26) DCMI_D1
33+
(27) DCMI_D0
34+
(28) SPI_MOSI
35+
(29) SPI_CLK
36+
(30) GND
37+
38+
compatible: "st,dcmi-camera-fpu-330zh"
39+
40+
include: [gpio-nexus.yaml, base.yaml]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (c) 2025 Charles Dias <[email protected]>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_LOG_BUFFER_SIZE=2048
8+
9+
CONFIG_VIDEO_WIDTH=480
10+
CONFIG_VIDEO_HEIGHT=272
11+
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=262144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2025 Charles Dias <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
/delete-node/ &sram1;
9+
/delete-node/ &sram2;
10+
11+
/* Increase the SRAM0 bank memory size to accommodate the VIDEO_BUFFER_POOL_SZ_MAX configuration. */
12+
&sram0 {
13+
reg = <0x24000000 DT_SIZE_K(1024)>;
14+
};

0 commit comments

Comments
 (0)