boards/seeed/xiao_esp32c3/doc/index.html · boards/seeed/xiao_esp32c3/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · Seeed · ESP32-C3

XIAO ESP32C3

ESP32-C3 Wi-Fi/BLE와 4 MB flash, USB-C, battery charger, U.FL을 standard XIAO form factor에 담은 RISC-V IoT board입니다.

Official pathboards/seeed/xiao_esp32c3/doc/index.html
Source fileboards/seeed/xiao_esp32c3/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

지원 controller 9개, binary blob 설치, 보안/OTA 없는 simple boot, MCUboot sysbuild와 domain tree, USB monitor, Espressif OpenOCD override를 설명합니다.

SoC

ESP32-C3 · RISC-V

Wireless

Wi-Fi · BLE

Boot

Simple boot · MCUboot · sysbuild

Debug

USB UART · OpenOCD ESP32

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 5C5E77083A84B36D33DDB9F5E56EBA9E79752DDE7FF30863EEE203CD632F93C4
.. _xiao_esp32c3:

XIAO ESP32C3
############

Overview
********

Seeed Studio XIAO ESP32C3 is an IoT mini development board based on the
Espressif ESP32-C3 WiFi/Bluetooth dual-mode chip.

For more details see the `Seeed Studio XIAO ESP32C3`_ wiki page.

.. figure:: ../../../../../../../boards/seeed/xiao_esp32c3/doc/img/xiao_esp32c.jpg
   :align: center
   :alt: XIAO ESP32C3

   XIAO ESP32C3

Hardware
********

This board is based on the ESP32-C3 with 4MB of flash, WiFi and BLE support. It
has an USB-C port for programming and debugging, integrated battery charging
and an U.FL external antenna connector. It is based on a standard XIAO 14 pin
pinout.

Supported Features
==================

The XIAO ESP32C3 board configuration supports the following hardware features:

+-----------+------------+------------------+
| Interface | Controller | Driver/Component |
+===========+============+==================+
| PMP       | on-chip    | arch/riscv       |
+-----------+------------+------------------+
| INTMTRX   | on-chip    | intc_esp32c3     |
+-----------+------------+------------------+
| PINMUX    | on-chip    | pinctrl_esp32    |
+-----------+------------+------------------+
| USB UART  | on-chip    | serial_esp32_usb |
+-----------+------------+------------------+
| GPIO      | on-chip    | gpio_esp32       |
+-----------+------------+------------------+
| UART      | on-chip    | uart_esp32       |
+-----------+------------+------------------+
| I2C       | on-chip    | i2c_esp32        |
+-----------+------------+------------------+
| SPI       | on-chip    | spi_esp32_spim   |
+-----------+------------+------------------+
| TWAI      | on-chip    | can_esp32_twai   |
+-----------+------------+------------------+

Connections and IOs
===================

The board uses a standard XIAO pinout, the default pin mapping is the following:

.. figure:: ../../../../../../../boards/seeed/xiao_esp32c3/doc/img/xiao_esp32c3_pinout.jpg
   :align: center
   :alt: XIAO ESP32C3 Pinout

   XIAO ESP32C3 Pinout

Prerequisites
=============

Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
below to retrieve those files.

.. code-block:: console

   west blobs fetch hal_espressif

.. note::

   It is recommended running the command above after :file:`west update`.

Building & Flashing
*******************

Simple boot
===========

The board could be loaded using the single binary image, without 2nd stage bootloader.
It is the default option when building the application without additional configuration.

.. note::

   Simple boot does not provide any security features nor OTA updates.

MCUboot bootloader
==================

User may choose to use MCUboot bootloader instead. In that case the bootloader
must be build (and flash) at least once.

There are two options to be used when building an application:

1. Sysbuild
2. Manual build

.. note::

   User can select the MCUboot bootloader by adding the following line
   to the board default configuration file.

   .. code:: cfg

      CONFIG_BOOTLOADER_MCUBOOT=y

Sysbuild
========

The sysbuild makes possible to build and flash all necessary images needed to
bootstrap the board with the ESP32 SoC.

To build the sample application using sysbuild use the command:

.. zephyr-app-commands::
   :tool: west
   :app: samples/hello_world
   :board: xiao_esp32c3
   :goals: build
   :west-args: --sysbuild
   :compact:

By default, the ESP32 sysbuild creates bootloader (MCUboot) and application
images. But it can be configured to create other kind of images.

Build directory structure created by Sysbuild is different from traditional
Zephyr build. Output is structured by the domain subdirectories:

.. code-block::

  build/
  ├── hello_world
  │   └── zephyr
  │       ├── zephyr.elf
  │       └── zephyr.bin
  ├── mcuboot
  │    └── zephyr
  │       ├── zephyr.elf
  │       └── zephyr.bin
  └── domains.yaml

.. note::

   With ``--sysbuild`` option the bootloader will be re-build and re-flash
   every time the pristine build is used.

For more information about the system build please read the :ref:`sysbuild` documentation.

Manual build
============

During the development cycle, it is intended to build & flash as quickly possible.
For that reason, images can be build one at a time using traditional build.

The instructions following are relevant for both manual build and sysbuild.
The only difference is the structure of the build directory.

.. note::

   Remember that bootloader (MCUboot) needs to be flash at least once.

For the :code:`Hello, world!` application, follow the instructions below.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: xiao_esp32c3
   :goals: build flash

Since the Zephyr console is by default on the `usb_serial` device, we use
the espressif monitor to view.

.. code-block:: console

   $ west espressif monitor

After the board has automatically reset and booted, you should see the following
message in the monitor:

.. code-block:: console

   ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
   Hello World! xiao_esp32c3

Debugging
*********

As with much custom hardware, the ESP32 modules require patches to
OpenOCD that are not upstreamed yet. Espressif maintains their own fork of
the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_

The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the
``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>``
parameter when building.

Here is an example for building the :ref:`hello_world` application.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: xiao_esp32c3
   :goals: build flash
   :gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>

You can debug an application in the usual way. Here is an example for the :ref:`hello_world` application.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: xiao_esp32c3
   :goals: debug

References
**********

.. target-notes::

.. _`Seeed Studio XIAO ESP32C3`: https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started
.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

Part 3

한국어 전문 번역

개요

Seeed Studio XIAO ESP32C3는 Espressif ESP32-C3 Wi-Fi/Bluetooth dual-mode chip 기반 IoT mini development board입니다. 자세한 내용은 Seeed Studio XIAO ESP32C3 Wiki를 참고합니다.

XIAO ESP32C3
XIAO ESP32C3

하드웨어

ESP32-C3와 4 MB flash를 기반으로 Wi-Fi와 BLE를 지원합니다. Programming과 debugging용 USB-C port, integrated battery charging, U.FL external antenna connector를 갖추며 standard XIAO 14-pin pinout을 사용합니다.

지원 기능

XIAO ESP32C3 board configuration은 다음 hardware 기능을 지원합니다.

InterfaceControllerDriver / Component
PMPon-chiparch/riscv
INTMTRXon-chipintc_esp32c3
PINMUXon-chippinctrl_esp32
USB UARTon-chipserial_esp32_usb
GPIOon-chipgpio_esp32
UARTon-chipuart_esp32
I2Con-chipi2c_esp32
SPIon-chipspi_esp32_spim
TWAIon-chipcan_esp32_twai

연결과 I/O

Board는 standard XIAO pinout을 사용합니다. 기본 pin mapping은 다음 그림과 같습니다.

XIAO ESP32C3 pinout
XIAO ESP32C3 pinout

선행 조건

Espressif HAL이 Wi-Fi와 Bluetooth를 동작시키려면 binary blob이 필요합니다. 다음 명령으로 해당 file을 가져옵니다.

west blobs fetch hal_espressif

west update를 실행한 뒤 위 명령을 실행하는 것이 권장됩니다.

Build와 flash

Simple boot

2nd-stage bootloader 없이 single binary image를 board에 적재할 수 있습니다. 추가 configuration 없이 application을 build할 때의 기본 option입니다.

MCUboot bootloader

대신 MCUboot bootloader를 선택할 수 있습니다. 이 경우 bootloader를 최소 한 번 build하고 flash해야 합니다. Application build 방법은 sysbuild와 manual build 두 가지입니다.

Board default configuration file에 다음 line을 추가해 MCUboot를 선택할 수 있습니다.

CONFIG_BOOTLOADER_MCUBOOT=y

Sysbuild

Sysbuild를 사용하면 ESP32 SoC board를 bootstrap하는 데 필요한 모든 image를 함께 build하고 flash할 수 있습니다. Sample application은 다음처럼 build합니다.

west build --sysbuild -b xiao_esp32c3 samples/hello_world

기본 ESP32 sysbuild는 bootloader(MCUboot)와 application image를 만들지만 다른 종류의 image를 만들도록 설정할 수도 있습니다.

Sysbuild가 생성하는 build directory는 전통적인 Zephyr build와 다르며 domain subdirectory 단위로 구성됩니다.

build/
├── hello_world
│   └── zephyr
│       ├── zephyr.elf
│       └── zephyr.bin
├── mcuboot
│   └── zephyr
│       ├── zephyr.elf
│       └── zephyr.bin
└── domains.yaml

--sysbuild option을 사용하면 pristine build를 할 때마다 bootloader도 다시 build하고 flash합니다.

Manual build

Development cycle에서는 가능한 빨리 build하고 flash해야 하므로 전통적인 build로 image를 하나씩 만들 수 있습니다. 이후 지침은 manual build와 sysbuild 모두에 적용되며 차이는 build directory 구조뿐입니다.

MCUboot bootloader는 최소 한 번 flash해야 합니다.

Hello, world! application은 다음과 같이 build하고 flash합니다.

west build -b xiao_esp32c3 samples/hello_world
west flash

Zephyr console은 기본적으로 usb_serial device에 있으므로 Espressif monitor로 확인합니다.

$ west espressif monitor

Board가 자동 reset하고 boot하면 monitor에 다음과 비슷한 message가 나타납니다.

***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
Hello World! xiao_esp32c3

Debugging

여러 custom hardware와 마찬가지로 ESP32 module에는 아직 upstream되지 않은 OpenOCD patch가 필요합니다. Espressif가 자체 fork를 유지하며 OpenOCD ESP32 release에서 받을 수 있습니다.

Zephyr SDK는 기본적으로 bundled OpenOCD를 사용합니다. Build할 때 -DOPENOCD=<path/to/bin/openocd>와 -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts> parameter를 추가하면 이를 override할 수 있습니다.

Custom OpenOCD로 hello_world를 build하고 flash하는 예입니다.

west build -b xiao_esp32c3 samples/hello_world --   -DOPENOCD=<path/to/bin/openocd>   -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>
west flash

일반적인 방식으로 application을 debug할 수 있습니다.

west debug

참고 자료

Seeed Studio XIAO ESP32C3 · OpenOCD ESP32

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.