-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
boards: shields: add suport for st_b_cams_omv_mb1683 #76143
Open
CharlesDias
wants to merge
1
commit into
zephyrproject-rtos:main
Choose a base branch
from
CharlesDias:st_b_cams_omv_mb1683
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+234
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_ST_B_CAMS_OMV_MB1683 | ||
|
||
# Enable the STM32 DCMI driver as the camera interface requires it. | ||
config VIDEO_STM32_DCMI | ||
default y | ||
|
||
endif # SHIELD_ST_B_CAMS_OMV_MB1683 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_ST_B_CAMS_OMV_MB1683 | ||
def_bool $(shields_list_contains,st_b_cams_omv_mb1683) |
47 changes: 47 additions & 0 deletions
47
boards/shields/st_b_cams_omv_mb1683/boards/stm32h7b3i_dk.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
&i2c4 { | ||
pinctrl-0 = <&i2c4_scl_pd12 &i2c4_sda_pd13>; | ||
pinctrl-names = "default"; | ||
status = "okay"; | ||
clock-frequency = <I2C_BITRATE_FAST>; | ||
|
||
ov5640: ov5640@3c { | ||
compatible = "ovti,ov5640"; | ||
reg = <0x3c>; | ||
status = "okay"; | ||
reset-gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; | ||
powerdown-gpios = <&gpioa 7 GPIO_ACTIVE_HIGH>; | ||
|
||
port { | ||
ov5640_ep_out: endpoint { | ||
remote-endpoint-label = "dcmi_ep_in"; | ||
bus-type = <VIDEO_BUS_TYPE_PARALLEL>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
&dcmi { | ||
pinctrl-0 = <&dcmi_hsync_pa4 &dcmi_pixclk_pa6 &dcmi_vsync_pb7 | ||
&dcmi_d0_pc6 &dcmi_d1_pc7 &dcmi_d2_pg10 &dcmi_d3_pc9 | ||
&dcmi_d4_pc11 &dcmi_d5_pd3 &dcmi_d6_pb8 &dcmi_d7_pb9>; | ||
pinctrl-names = "default"; | ||
|
||
dmas = <&dma1 0 75 (STM32_DMA_PERIPH_TO_MEMORY | STM32_DMA_PERIPH_NO_INC | | ||
STM32_DMA_MEM_INC | STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_32BITS | | ||
STM32_DMA_PRIORITY_HIGH) STM32_DMA_FIFO_1_4>; | ||
}; | ||
|
||
&dma1 { | ||
status = "okay"; | ||
}; | ||
|
||
&dmamux1 { | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
.. _st_b_cams_omv_mb1683: | ||
|
||
ST B-CAMS-OMV-MB1683 | ||
#################### | ||
|
||
Overview | ||
******** | ||
|
||
The camera module bundle (B-CAMS-OMV) provides extension connectors | ||
for the MB1379 STMicroelectronics camera module daughterboard or | ||
third-party modules like OpenMV and Waveshare modules. It can be used | ||
with the STM32 boards featuring a 1 x 30 pin ZIF connector for the | ||
connection of multiple cameras to implement computer vision on STM32 | ||
microcontrollers easily. | ||
|
||
The camera module bundle is compatible with all STM32 Discovery kits and | ||
Evaluation boards featuring a ZIF connector, such as the STM32H747I-DISCO, | ||
STM32H7B3I-DK, and 32L4R9IDISCOVERY Discovery kits. | ||
|
||
.. figure:: st_b_cams_omv.webp | ||
:width: 600px | ||
:align: center | ||
:alt: B-CAMS-OMV-MB1683 | ||
|
||
B-CAMS-OMV MB1683 Image (Credit: STMicroelectronics.) | ||
|
||
Waveshare camera board connector CN4 | ||
************************************* | ||
|
||
+------------+-----------------+------------+--------------+ | ||
| Pin number | Description | Pin number | Description | | ||
+============+=================+============+==============+ | ||
| 1 | GND | 2 | VCAM | | ||
+------------+-----------------+------------+--------------+ | ||
| 3 | I2C_SDA | 4 | I2C_SCL | | ||
+------------+-----------------+------------+--------------+ | ||
| 5 | DCMI_HSYNC | 6 | DCMI_VSYNC | | ||
+------------+-----------------+------------+--------------+ | ||
| 7 | Camera_CLK | 8 | DCMI_PIXCLK | | ||
+------------+-----------------+------------+--------------+ | ||
| 9 | DCMI_D6 | 10 | DCMI_D7 | | ||
+------------+-----------------+------------+--------------+ | ||
| 11 | DCMI_D4 | 12 | DCMI_D5 | | ||
+------------+-----------------+------------+--------------+ | ||
| 13 | DCMI_D2 | 14 | DCMI_D3 | | ||
+------------+-----------------+------------+--------------+ | ||
| 15 | DCMI_D0 | 16 | DCMI_D1 | | ||
+------------+-----------------+------------+--------------+ | ||
| 17 | PWR_EN / LED1 | 18 | RESET# | | ||
+------------+-----------------+------------+--------------+ | ||
|
||
ZIF connector CN5 | ||
***************** | ||
|
||
+------------+--------------+------------+--------------+ | ||
| Pin number | Description | Pin number | Description | | ||
+============+==============+============+==============+ | ||
| 1 | 3V3 | 16 | DCMI_PIXCK | | ||
+------------+--------------+------------+--------------+ | ||
| 2 | GND | 17 | GND | | ||
+------------+--------------+------------+--------------+ | ||
| 3 | I2C_SCL | 18 | SPI_MISO | | ||
+------------+--------------+------------+--------------+ | ||
| 4 | I2C_SDA | 19 | SPI_CS | | ||
+------------+--------------+------------+--------------+ | ||
| 5 | RESET# | 20 | DCMI_D7 | | ||
+------------+--------------+------------+--------------+ | ||
| 6 | PWR_EN / LED1| 21 | DCMI_D6 | | ||
+------------+--------------+------------+--------------+ | ||
| 7 | SHUTTER | 22 | DCMI_D5 | | ||
+------------+--------------+------------+--------------+ | ||
| 8 | GND | 23 | DCMI_D4 | | ||
+------------+--------------+------------+--------------+ | ||
| 9 | PULLDOWN / LED2 | 24 | DCMI_D3 | | ||
+------------+--------------+------------+--------------+ | ||
| 10 | Camera_CLK | 25 | DCMI_D2 | | ||
+------------+--------------+------------+--------------+ | ||
| 11 | 3V3 | 26 | DCMI_D1 | | ||
+------------+--------------+------------+--------------+ | ||
| 12 | DCMI_VSYNC | 27 | DCMI_D0 | | ||
+------------+--------------+------------+--------------+ | ||
| 13 | 5V (RSU) | 28 | SPI_MOSI | | ||
+------------+--------------+------------+--------------+ | ||
| 14 | DCMI_HSYNC | 29 | SPI_CLK | | ||
+------------+--------------+------------+--------------+ | ||
| 15 | GND | 30 | GND | | ||
+------------+--------------+------------+--------------+ | ||
|
||
Requirements | ||
************ | ||
|
||
Your board needs to have a ``dcmi`` device tree label to work with this shield. | ||
|
||
Usage | ||
***** | ||
|
||
The shield can be used in any application by setting ``SHIELD`` to | ||
``_st_b_cams_omv_mb1683`` and adding the necessary device tree properties. | ||
|
||
Set ``--shield "_st_b_cams_omv_mb1683"`` when you invoke ``west build``. For example: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/drivers/video/capture_to_lvgl | ||
:board: stm32h7b3i_dk | ||
:shield: st_b_cams_omv_mb1683 | ||
:goals: build | ||
|
||
References | ||
********** | ||
|
||
- `Product page <https://www.st.com/en/evaluation-tools/b-cams-omv.html>`_ | ||
|
||
- `Databrief <https://www.st.com/resource/en/data_brief/b-cams-omv.pdf>`_ | ||
|
||
- `User manual <https://www.st.com/resource/en/user_manual/um2779-camera-module-bundle-for-stm32-boards-stmicroelectronics.pdf>`_ |
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
boards/shields/st_b_cams_omv_mb1683/st_b_cams_omv_mb1683.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/video/video-interfaces.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you don't need to include |
||
|
||
/ { | ||
chosen { | ||
zephyr,camera = &dcmi; | ||
}; | ||
}; | ||
|
||
&dcmi { | ||
status = "okay"; | ||
sensor = <&ov5640>; | ||
|
||
bus-width = <8>; | ||
hsync-active = <0>; | ||
vsync-active = <0>; | ||
pixelclk-active = <1>; | ||
capture-rate = <1>; | ||
|
||
port { | ||
dcmi_ep_in: endpoint { | ||
remote-endpoint-label = "ov5640_ep_out"; | ||
}; | ||
}; | ||
}; |
13 changes: 13 additions & 0 deletions
13
samples/drivers/video/capture_to_lvgl/boards/stm32h7b3i_dk.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
CONFIG_LOG_BUFFER_SIZE=2048 | ||
|
||
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need, the default value is 2 |
||
|
||
CONFIG_VIDEO_WIDTH=480 | ||
CONFIG_VIDEO_HEIGHT=272 | ||
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=262144 |
13 changes: 13 additions & 0 deletions
13
samples/drivers/video/capture_to_lvgl/boards/stm32h7b3i_dk.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2024 Charles Dias <charlesdias.cd@outlook.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
/delete-node/ &sram1; | ||
/delete-node/ &sram2; | ||
|
||
&sram0 { | ||
reg = <0x24000000 DT_SIZE_K(1024)>; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot to include
video-interfaces.h
?