boards/luatos/esp32c3_luatos_core/doc/index.html · boards/luatos/esp32c3_luatos_core/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · LuatOS · RISC-V · ESP32-C3

ESP32C3 LuatOS Core

CH343 UART와 native USB 두 version을 제공하는 RISC-V ESP32-C3 board입니다.

Official pathboards/luatos/esp32c3_luatos_core/doc/index.html
Source fileboards/luatos/esp32c3_luatos_core/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

두 USB hardware variant, 15개 지원 interface와 Espressif OpenOCD fork를 사용한 debug를 다룹니다.

ESP32-C3 LuatOS Core
ESP32-C3 LuatOS Core
Core

RISC-V · 160MHz single core

Memory

400KB internal RAM

USB variants

CH343 UART · native ESP32 USB

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 64A03864B1C4E2046D1FB2572FCB01AC9FDD5D3BA55B96316B193DD8B2EC4483
.. _esp32c3_luatos_core:

ESP32C3_LUATOS_CORE
###################

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)

There are two version hardware of this board. The difference between them is the ch343 chip.

1. USB-C connect to UART over CH343 chip(esp32c3_luatos_core)

.. image:: ../../../../../../../boards/luatos/esp32c3_luatos_core/doc/img/esp32c3_luatos_core.jpg
     :align: center
     :alt: esp32c3_luatos_core

2. USB-C connect to esp32 chip directly(esp32c3_luatos_core/esp32c3/usb)

.. image:: ../../../../../../../boards/luatos/esp32c3_luatos_core/doc/img/esp32c3_luatos_core_usb.jpg
     :align: center
     :alt: esp32c3_luatos_core/esp32c3/usb

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

Current Zephyr's ESP32C3_LUATOS_CORE 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    |                                     |
+------------+------------+-------------------------------------+

.. image:: ../../../../../../../boards/luatos/esp32c3_luatos_core/doc/img/esp32c3_luatos_core_pinfunc.jpg
     :align: center
     :alt: esp32c3_luatos_core_pinfunc

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

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

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: esp32c3_luatos_core
   :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_luatos_core

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_luatos_core
   :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_luatos_core
   :goals: debug

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

References
**********

.. [1] https://www.espressif.com/en/products/socs/esp32-c3
.. _ESP32C3 Core Website: https://wiki.luatos.com/chips/esp32c3/board.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입니다. 전력, I/O와 security의 균형을 맞춰 connected device에 cost-effective solution을 제공합니다. Wi-Fi와 Bluetooth 5(LE)의 dual connectivity는 device configuration과 다양한 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

이 board에는 CH343 chip 차이에 따른 두 hardware version이 있습니다.

1. CH343 UART version

USB-C가 CH343 chip을 통해 UART에 연결되며 board target은 esp32c3_luatos_core입니다.

esp32c3_luatos_core
esp32c3_luatos_core

2. Native USB version

USB-C가 ESP32 chip에 직접 연결되며 board target은 esp32c3_luatos_core/esp32c3/usb입니다.

esp32c3_luatos_core/esp32c3/usb
esp32c3_luatos_core/esp32c3/usb

지원 기능

현재 Zephyr의 ESP32C3_LUATOS_CORE board는 다음 기능을 지원합니다.

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
esp32c3_luatos_core_pinfunc
ESP32-C3 LuatOS Core pin function

System requirements

Prerequisites

Espressif HAL이 동작하려면 WiFi와 Bluetooth binary blob이 필요합니다. 다음 명령으로 해당 파일을 가져옵니다.

west blobs fetch hal_espressif

Building과 Flashing

Simple boot

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

MCUboot bootloader

대신 MCUboot bootloader를 선택할 수 있습니다. 이 경우 bootloader를 적어도 한 번 build하고 flash해야 합니다. Application은 Sysbuild 또는 Manual build 방식으로 만들 수 있습니다.

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

CONFIG_BOOTLOADER_MCUBOOT=y

Sysbuild

Sysbuild는 ESP32 SoC로 board를 bootstrap하는 데 필요한 모든 image를 함께 build하고 flash할 수 있게 합니다.

west build -b esp32c3_luatos_core --sysbuild samples/hello_world

기본적으로 ESP32 sysbuild는 bootloader(MCUboot) image와 application image를 만들지만 다른 image 종류로 구성할 수도 있습니다. Build output은 전통적인 Zephyr build와 달리 domain subdirectory로 나뉩니다.

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

자세한 내용은 Zephyr Sysbuild 문서를 참고하십시오.

Manual build

Development cycle에서는 전통적인 build로 image를 한 번에 하나씩 빠르게 만들 수 있습니다. 아래 절차는 manual build와 sysbuild 모두에 적용되며 차이는 build directory 구조뿐입니다. MCUboot는 적어도 한 번 flash해야 합니다.

west build -b esp32c3_luatos_core samples/hello_world

esp32c3_luatos_core board configuration에서는 일반적인 flash target이 동작합니다.

west build -b esp32c3_luatos_core samples/hello_world
west flash

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

west espressif monitor

Board가 자동으로 reset되고 boot하면 monitor에 다음 message가 표시되어야 합니다.

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

Debugging

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

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

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

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

west build -b esp32c3_luatos_core samples/hello_world
west debug

참고 자료

Source

출처

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