Skip to content

Commit 2aa7cb5

Browse files
uLipeMaureenHelm
authored andcommitted
samples: drivers: video: add arduino nicla vision
As supported board to the video capture sample. Signed-off-by: Felipe Neves <[email protected]>
1 parent 591b7d3 commit 2aa7cb5

File tree

5 files changed

+48
-1
lines changed

5 files changed

+48
-1
lines changed

samples/drivers/video/capture/README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Supported camera modules on some i.MX RT boards can be found below.
2424
- :ref:`mimxrt1170_evk`
2525
- `OV5640 camera module`_
2626

27+
Also :ref:`arduino_nicla_vision_board` can be used in this sample as capture device, in that case
28+
The user can transfer the captured frames through on board USB.
29+
2730
Wiring
2831
******
2932

@@ -35,6 +38,8 @@ On :ref:`mimxrt1170_evk`, the OV5640 camera module should be plugged into the
3538
J2 camera connector. A USB cable should be connected from a host to the micro
3639
USB debug connector (J11) in order to get console output via the daplink interface.
3740

41+
For :ref:`arduino_nicla_vision_board` there is no extra wiring required.
42+
3843
Building and Running
3944
********************
4045

@@ -56,6 +61,14 @@ For :ref:`mimxrt1170_evk`, build this sample application with the following comm
5661
:goals: build
5762
:compact:
5863

64+
For :ref:`arduino_nicla_vision_board`, build this sample application with the following commands:
65+
66+
.. zephyr-app-commands::
67+
:zephyr-app: samples/drivers/video/capture
68+
:board: arduino_nicla_vision/stm32h747xx/m7
69+
:goals: build
70+
:compact:
71+
5972
For testing purpose without the need of any real video capture and/or display hardwares,
6073
a video software pattern generator is supported by the above build commands without
6174
specifying the shields.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=1
2+
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=160000
3+
CONFIG_DMA=y
4+
5+
# Arduino Nicla Vision has easy access to the USB console
6+
# So use it to check the log messages
7+
CONFIG_USB_DEVICE_STACK=y
8+
CONFIG_USB_WORKQUEUE_STACK_SIZE=8192
9+
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
10+
CONFIG_MAIN_STACK_SIZE=4096
11+
12+
CONFIG_SERIAL=y
13+
CONFIG_CONSOLE=y
14+
CONFIG_UART_CONSOLE=y
15+
CONFIG_UART_LINE_CTRL=y
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2024 Felipe Neves
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/ {
7+
chosen {
8+
zephyr,console = &cdc_acm_uart0;
9+
zephyr,shell-uart = &cdc_acm_uart0;
10+
};
11+
};
12+
13+
zephyr_udc0: &usbotg_hs {
14+
status = "okay";
15+
cdc_acm_uart0: cdc_acm_uart0 {
16+
compatible = "zephyr,cdc-acm-uart";
17+
};
18+
};

samples/drivers/video/capture/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tests:
2020
- "size"
2121
- "timestamp"
2222
platform_allow:
23+
- arduino_nicla_vision/stm32h747xx/m7
2324
- mimxrt1064_evk
2425
- mimxrt1170_evk/mimxrt1176/cm7
2526
- mm_swiftio

samples/drivers/video/capture/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static inline void video_display_frame(const struct device *const display_dev,
7575

7676
int main(void)
7777
{
78-
struct video_buffer *buffers[2], *vbuf;
78+
struct video_buffer *buffers[CONFIG_VIDEO_BUFFER_POOL_NUM_MAX], *vbuf;
7979
struct video_format fmt;
8080
struct video_caps caps;
8181
unsigned int frame = 0;

0 commit comments

Comments
 (0)