diff --git a/boards/seeed/xiao_esp32s3/Kconfig b/boards/seeed/xiao_esp32s3/Kconfig index 9261164bb3f51..361a4f5fc84d7 100644 --- a/boards/seeed/xiao_esp32s3/Kconfig +++ b/boards/seeed/xiao_esp32s3/Kconfig @@ -3,5 +3,5 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD int - default 4096 if BOARD_XIAO_ESP32S3_ESP32S3_PROCPU + default 4096 if BOARD_XIAO_ESP32S3_ESP32S3_PROCPU || BOARD_XIAO_ESP32S3_ESP32S3_PROCPU_SENSE default 256 if BOARD_XIAO_ESP32S3_ESP32S3_APPCPU diff --git a/boards/seeed/xiao_esp32s3/Kconfig.xiao_esp32s3 b/boards/seeed/xiao_esp32s3/Kconfig.xiao_esp32s3 index cbe0701475034..212d510c344bd 100644 --- a/boards/seeed/xiao_esp32s3/Kconfig.xiao_esp32s3 +++ b/boards/seeed/xiao_esp32s3/Kconfig.xiao_esp32s3 @@ -5,5 +5,5 @@ config BOARD_XIAO_ESP32S3 select SOC_ESP32S3_WROOM_N8R8 - select SOC_ESP32S3_PROCPU if BOARD_XIAO_ESP32S3_ESP32S3_PROCPU + select SOC_ESP32S3_PROCPU if BOARD_XIAO_ESP32S3_ESP32S3_PROCPU || BOARD_XIAO_ESP32S3_ESP32S3_PROCPU_SENSE select SOC_ESP32S3_APPCPU if BOARD_XIAO_ESP32S3_ESP32S3_APPCPU diff --git a/boards/seeed/xiao_esp32s3/board.yml b/boards/seeed/xiao_esp32s3/board.yml index c3eb3a0204dd1..1d3c200f65758 100644 --- a/boards/seeed/xiao_esp32s3/board.yml +++ b/boards/seeed/xiao_esp32s3/board.yml @@ -4,3 +4,6 @@ board: vendor: seeed socs: - name: esp32s3 + variants: + - name: 'sense' + cpucluster: 'procpu' diff --git a/boards/seeed/xiao_esp32s3/doc/img/xiao-esp32s3-sense.png b/boards/seeed/xiao_esp32s3/doc/img/xiao-esp32s3-sense.png new file mode 100644 index 0000000000000..90e0824a13e03 Binary files /dev/null and b/boards/seeed/xiao_esp32s3/doc/img/xiao-esp32s3-sense.png differ diff --git a/boards/seeed/xiao_esp32s3/doc/index.rst b/boards/seeed/xiao_esp32s3/doc/index.rst index 0da45987f3515..6ce906d3bde59 100644 --- a/boards/seeed/xiao_esp32s3/doc/index.rst +++ b/boards/seeed/xiao_esp32s3/doc/index.rst @@ -1,13 +1,28 @@ -.. zephyr:board:: xiao_esp32s3 +.. _xiao_esp32s3: + +XIAO ESP32S3/XIAO ESP32S3 Sense +############################### Overview ******** -Seeed Studio XIAO ESP32S3 is an IoT mini development board based on the +Seeed Studio XIAO ESP32S3 and XIAO ESP32S3 Sense are IoT mini development boards based on the Espressif ESP32-S3 WiFi/Bluetooth dual-mode chip. For more details see the `Seeed Studio XIAO ESP32S3`_ wiki page. +.. figure:: img/xiao_esp32s3.jpg + :align: center + :alt: XIAO ESP32S3 + + XIAO ESP32S3 + +.. figure:: img/xiao-esp32s3-sense.png + :align: center + :alt: XIAO ESP32S3 Sense + + XIAO ESP32S3 Sense + Hardware ******** @@ -21,6 +36,8 @@ and Bluetooth® Low Energy (Bluetooth LE). It consists of high-performance dual- (Xtensa® 32-bit LX7), a low power coprocessor, a Wi-Fi baseband, a Bluetooth LE baseband, RF module, and numerous peripherals. +Additionally, Sense variant integrates a OV2640 camera sensor, microphone and sdcard slot. + Supported Features ================== @@ -57,6 +74,8 @@ Current Zephyr's XIAO ESP32S3 board supports the following features: +------------+------------+-------------------------------------+ | GDMA | on-chip | dma | +------------+------------+-------------------------------------+ +| LCD_CAM | on-chip | lcd_cam | ++------------+------------+-------------------------------------+ Connections and IOs =================== @@ -67,7 +86,7 @@ The board uses a standard XIAO pinout, the default pin mapping is the following: :align: center :alt: XIAO ESP32S3 Pinout - XIAO ESP32S3 Pinout + XIAO ESP32S3 and XIAO ESP32S3 Sense Pinout Prerequisites ------------- @@ -174,19 +193,41 @@ The only difference is the structure of the build directory. Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32s3/procpu - :goals: build +.. tabs:: + + .. group-tab:: XIAO ESP32S3 + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu + :goals: build + + .. group-tab:: XIAO ESP32S3 Sense + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu/sense + :goals: build The usual ``flash`` target will work with the ``xiao_esp32s3`` board configuration. Here is an example for the :zephyr:code-sample:`hello_world` application. -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32s3/procpu - :goals: flash +.. tabs:: + + .. group-tab:: XIAO ESP32S3 + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu + :goals: flash + + .. group-tab:: XIAO ESP32S3 Sense + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu/sense + :goals: flash Open the serial monitor using the following command: @@ -213,17 +254,39 @@ Further documentation can be obtained from the SoC vendor in `JTAG debugging for Here is an example for building the :zephyr:code-sample:`hello_world` application. -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu - :goals: build flash +.. tabs:: + + .. group-tab:: XIAO ESP32S3 + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu + :goals: debug + + .. group-tab:: XIAO ESP32S3 Sense + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu/sense + :goals: debug You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application. -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: xiao_esp32s3/esp32/procpu - :goals: debug +.. tabs:: + + .. group-tab:: XIAO ESP32S3 + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu + :goals: debug + + .. group-tab:: XIAO ESP32S3 Sense + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: xiao_esp32s3/esp32/procpu/sense + :goals: debug References ********** diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3-pinctrl.dtsi b/boards/seeed/xiao_esp32s3/xiao_esp32s3-pinctrl.dtsi index 27097b6bb260b..3159a39611bc5 100644 --- a/boards/seeed/xiao_esp32s3/xiao_esp32s3-pinctrl.dtsi +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3-pinctrl.dtsi @@ -41,6 +41,38 @@ }; }; + i2c1_default: i2c1_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; + + lcd_cam_default: lcd_cam_default { + group1 { + pinmux = ; + output-enable; + }; + group2 { + pinmux = , + , + , + , + , + , + , + , + , + , + ; + input-enable; + bias-disable; + }; + }; + twai_default: twai_default { group1 { pinmux = , diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts index 2c1349b735c4c..2a68af1ee1878 100644 --- a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu.dts @@ -5,130 +5,9 @@ */ /dts-v1/; - -#include -#include "xiao_esp32s3-pinctrl.dtsi" -#include "seeed_xiao_connector.dtsi" +#include "xiao_esp32s3_procpu_common.dtsi" / { model = "Seeed Xiao ESP32S3 PROCPU"; compatible = "seeed,xiao-esp32s3"; - - chosen { - zephyr,sram = &sram0; - zephyr,console = &usb_serial; - zephyr,shell-uart = &usb_serial; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_partition; - zephyr,bt-hci = &esp32_bt_hci; - }; - - aliases { - i2c-0 = &i2c0; - watchdog0 = &wdt0; - led0 = &led0; - }; - - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; - label = "BUILTIN LED"; - }; - }; - -}; - -&usb_serial { - status = "okay"; -}; - -&uart0 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart0_default>; - pinctrl-names = "default"; -}; - -&i2c0 { - status = "okay"; - clock-frequency = ; - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; -}; - -&trng0 { - status = "okay"; -}; - -&spi2 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - pinctrl-0 = <&spim2_default>; - pinctrl-names = "default"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&wdt0 { - status = "okay"; -}; - -&twai { - pinctrl-0 = <&twai_default>; - pinctrl-names = "default"; -}; - -&timer0 { - status = "okay"; -}; - -&timer1 { - status = "okay"; -}; - -&flash0 { - status = "okay"; - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0x0000F000>; - read-only; - }; - - slot0_partition: partition@10000 { - label = "image-0"; - reg = <0x00010000 0x00100000>; - }; - - slot1_partition: partition@110000 { - label = "image-1"; - reg = <0x00110000 0x00100000>; - }; - - scratch_partition: partition@210000 { - label = "image-scratch"; - reg = <0x00210000 0x00040000>; - }; - - storage_partition: partition@250000 { - label = "storage"; - reg = <0x00250000 0x00006000>; - }; - }; -}; - -&esp32_bt_hci { - status = "okay"; }; diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_common.dtsi b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_common.dtsi new file mode 100644 index 0000000000000..8a99ef2c694f5 --- /dev/null +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_common.dtsi @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2023 Seeed Studio inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "xiao_esp32s3-pinctrl.dtsi" +#include "seeed_xiao_connector.dtsi" + +/ { + chosen { + zephyr,sram = &sram0; + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + }; + + aliases { + i2c-0 = &i2c0; + watchdog0 = &wdt0; + led0 = &led0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + label = "BUILTIN LED"; + }; + }; + +}; + +&usb_serial { + status = "okay"; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&trng0 { + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&twai { + pinctrl-0 = <&twai_default>; + pinctrl-names = "default"; +}; + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&flash0 { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x0000F000>; + read-only; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 0x00100000>; + }; + + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x00110000 0x00100000>; + }; + + scratch_partition: partition@210000 { + label = "image-scratch"; + reg = <0x00210000 0x00040000>; + }; + + storage_partition: partition@250000 { + label = "storage"; + reg = <0x00250000 0x00006000>; + }; + }; +}; + +&esp32_bt_hci { + status = "okay"; +}; diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts new file mode 100644 index 0000000000000..1fc6f2560d7fa --- /dev/null +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.dts @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Seeed Studio inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include "xiao_esp32s3_procpu_common.dtsi" + +/ { + model = "Seeed Xiao ESP32S3 PROCPU Sense"; + compatible = "seeed,xiao-esp32s3"; + + chosen { + zephyr,camera = &lcd_cam; + }; +}; + +&i2c1 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c1_default>; + pinctrl-names = "default"; + + ov2640: ov2640@30 { + compatible = "ovti,ov2640"; + reg = <0x30>; + status = "okay"; + clock-rate-control = <0x80>; + port { + ov2640_ep_out: endpoint { + remote-endpoint-label = "dvp_ep_in"; + }; + }; + }; +}; + +&dma { + status = "okay"; +}; + +&lcd_cam { + status = "okay"; + cam-clk = <10000000>; + pinctrl-0 = <&lcd_cam_default>; + pinctrl-names = "default"; + source = <&ov2640>; + dmas = <&dma 2>; + dma-names = "rx"; + port { + dvp_ep_in: endpoint { + remote-endpoint-label = "ov2640_ep_out"; + }; + }; +}; + +&spi2 { + status = "okay"; + cs-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + + sdcard: sdcard@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <20000000>; + }; +}; diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.yaml b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.yaml new file mode 100644 index 0000000000000..91521bcd7d633 --- /dev/null +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense.yaml @@ -0,0 +1,22 @@ +identifier: xiao_esp32s3/esp32s3/procpu/sense +name: XIAO ESP32S3 Sense PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - can + - counter + - watchdog + - entropy + - pwm + - dma +testing: + ignore_tags: + - net + - bluetooth +vendor: seeed diff --git a/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense_defconfig b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense_defconfig new file mode 100644 index 0000000000000..6539bd42e5947 --- /dev/null +++ b/boards/seeed/xiao_esp32s3/xiao_esp32s3_procpu_sense_defconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y