boards/espressif/esp32c3_devkitm/doc/index.html · boards/espressif/esp32c3_devkitm/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · Espressif RISC-V

ESP32-C3-DevKitM

160MHz single-core RISC-V와 Wi-Fi·Bluetooth 5를 결합한 cost-effective connected-device SoC 보드입니다.

Official pathboards/espressif/esp32c3_devkitm/doc/index.html
Source fileboards/espressif/esp32c3_devkitm/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

ESP32-C3는 160MHz 32-bit RISC-V core, 400KB RAM, Wi-Fi, Bluetooth 5/mesh와 hardware cryptography를 제공합니다.

CPU

RISC-V · 160MHz

Memory

400KB RAM

Radio

Wi-Fi · BT 5 LE

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 C0A0B46A20782128C745E9D46CFE66E80543C32135209CE3A7A5B51C8AF53224
.. _esp32c3_devkitm:

ESP32-C3
########

Overview
********

ESP32-C3 is a single-core Wi-Fi and Bluetooth 5 (LE) microcontroller SoC,
based on the open-source RISC-V architecture. It strikes the right balance of power,
I/O capabilities and security, thus offering the optimal cost-effective
solution for connected devices.
The availability of Wi-Fi and Bluetooth 5 (LE) connectivity not only makes the device configuration easy,
but it also facilitates a variety of use-cases based on dual connectivity. [1]_

The features include the following:

- 32-bit core RISC-V microcontroller with a maximum clock speed of 160 MHz
- 400 KB of internal RAM
- 802.11b/g/n/e/i
- A Bluetooth LE subsystem that supports features of Bluetooth 5 and Bluetooth Mesh
- Various peripherals:

  - 12-bit ADC with up to 6 channels
  - TWAI compatible with CAN bus 2.0
  - Temperature sensor
  - 3x SPI
  - 1x I2S
  - 1x I2C
  - 2x UART
  - LED PWM with up to 6 channels

- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES)

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

Current Zephyr's ESP32-C3-Devkitm board supports the following features:

+------------+------------+-------------------------------------+
| Interface  | Controller | Driver/Component                    |
+============+============+=====================================+
| UART       | on-chip    | serial port                         |
+------------+------------+-------------------------------------+
| GPIO       | on-chip    | gpio                                |
+------------+------------+-------------------------------------+
| PINMUX     | on-chip    | pinmux                              |
+------------+------------+-------------------------------------+
| USB-JTAG   | on-chip    | hardware interface                  |
+------------+------------+-------------------------------------+
| SPI Master | on-chip    | spi                                 |
+------------+------------+-------------------------------------+
| Timers     | on-chip    | counter                             |
+------------+------------+-------------------------------------+
| Watchdog   | on-chip    | watchdog                            |
+------------+------------+-------------------------------------+
| TRNG       | on-chip    | entropy                             |
+------------+------------+-------------------------------------+
| LEDC       | on-chip    | pwm                                 |
+------------+------------+-------------------------------------+
| SPI DMA    | on-chip    | spi                                 |
+------------+------------+-------------------------------------+
| TWAI       | on-chip    | can                                 |
+------------+------------+-------------------------------------+
| USB-CDC    | on-chip    | serial                              |
+------------+------------+-------------------------------------+
| ADC        | on-chip    | adc                                 |
+------------+------------+-------------------------------------+
| Wi-Fi      | on-chip    |                                     |
+------------+------------+-------------------------------------+
| Bluetooth  | on-chip    |                                     |
+------------+------------+-------------------------------------+

System requirements
*******************

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: esp32c3_devkitm
   :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.

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: esp32c3_devkitm
   :goals: build

The usual ``flash`` target will work with the ``esp32c3_devkitm`` board
configuration. Here is an example for the :ref:`hello_world`
application.

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

Open the serial monitor using the following command:

.. code-block:: shell

   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! esp32c3_devkitm

Debugging
*********

As with much custom hardware, the ESP32-C3 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: esp32c3_devkitm
   :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: esp32c3_devkitm
   :goals: debug

.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases

References
**********

.. [1] https://www.espressif.com/en/products/socs/esp32-c3
.. _ESP32C3 Devkitm User Guide: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html
.. _ESP32C3 Technical Reference Manual: https://espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf
.. _ESP32C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf

Part 3

한국어 전문 번역

개요

ESP32-C3는 open-source RISC-V architecture 기반의 single-core Wi-Fi 및 Bluetooth 5(LE) microcontroller SoC입니다. Power, I/O capability와 security의 균형을 맞춰 connected device용 cost-effective solution을 제공합니다. Wi-Fi와 Bluetooth 5(LE)를 함께 지원하므로 device configuration이 쉬워지고 dual connectivity 기반의 다양한 use case를 구현할 수 있습니다.

주요 기능은 다음과 같습니다.

  • 최대 160MHz로 동작하는 32-bit RISC-V microcontroller core
  • 400KB internal RAM
  • 802.11b/g/n/e/i
  • Bluetooth 5 기능과 Bluetooth Mesh를 지원하는 Bluetooth LE subsystem
  • 최대 6 channel의 12-bit ADC
  • CAN bus 2.0 compatible TWAI
  • temperature sensor
  • SPI 3개, I2S 1개, I2C 1개, UART 2개
  • 최대 6 channel의 LED PWM
  • cryptographic hardware acceleration(RNG, ECC, RSA, SHA-2, AES)

지원 기능

현재 Zephyr의 ESP32-C3-DevKitM board는 다음 interface와 driver를 지원합니다.

InterfaceControllerDriver/Component
UARTon-chipserial port
GPIOon-chipgpio
PINMUXon-chippinmux
USB-JTAGon-chiphardware interface
SPI Masteron-chipspi
Timerson-chipcounter
Watchdogon-chipwatchdog
TRNGon-chipentropy
LEDCon-chippwm
SPI DMAon-chipspi
TWAIon-chipcan
USB-CDCon-chipserial
ADCon-chipadc
Wi-Fion-chip
Bluetoothon-chip

시스템 요구 사항

사전 준비

Espressif HAL이 동작하려면 Wi-Fi와 Bluetooth binary blob이 필요합니다. 다음 명령으로 가져오며, west update 뒤 실행하는 것이 좋습니다.

west blobs fetch hal_espressif

빌드와 플래시

Simple boot

2nd-stage bootloader 없이 single binary image로 board를 load할 수 있습니다. 별도 configuration 없이 application을 build할 때의 default option입니다.

MCUboot bootloader

MCUboot를 선택할 수 있으며 bootloader를 적어도 한 번 build하고 flash해야 합니다. Application은 sysbuild 또는 manual build 방식으로 만들 수 있습니다.

CONFIG_BOOTLOADER_MCUBOOT=y

Sysbuild

Sysbuild는 ESP32-C3 board를 bootstrap하는 데 필요한 모든 image를 build하고 flash합니다.

west build --sysbuild -b esp32c3_devkitm samples/hello_world

기본적으로 bootloader(MCUboot)와 application image를 생성하지만 다른 image도 생성하도록 구성할 수 있습니다. Build output은 domain subdirectory별로 구성됩니다.

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

더 자세한 내용은 Zephyr의 sysbuild documentation을 참조하십시오.

Manual build

개발 중에는 빠른 iteration을 위해 전통적인 build 방식으로 image를 하나씩 만들 수 있습니다. 지침은 sysbuild와 같으며 build directory 구조만 다릅니다. MCUboot는 적어도 한 번 먼저 flash해야 합니다.

west build -b esp32c3_devkitm samples/hello_world
west flash

다음 명령으로 serial monitor를 엽니다.

west espressif monitor
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
Hello World! esp32c3_devkitm

디버깅

ESP32-C3 module에는 아직 upstream에 포함되지 않은 OpenOCD patch가 필요하며 Espressif가 자체 fork를 유지합니다. OpenOCD ESP32에서 custom OpenOCD를 받을 수 있습니다.

Zephyr SDK는 bundled OpenOCD를 기본 사용합니다. Build parameter로 custom binary와 script path를 지정하면 이 동작을 덮어쓸 수 있습니다.

-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>

hello_world를 custom OpenOCD로 build·flash하거나 debug하는 예는 다음과 같습니다.

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

참고 자료

Source

출처

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