Part 1
요약·해설
ESP32-DEVKITC-WROOM은 160/240MHz Xtensa LX6, 520KB SRAM, Wi-Fi, Bluetooth와 다양한 peripheral을 갖춘 저전력 개발 보드입니다. Zephyr는 두 core의 AMP와 OpenAMP data exchange도 지원합니다.

Xtensa LX6 · dual core
520KB SRAM
802.11 · BT 4.2 · BLE
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
1A7B854CDC16BDAE7D6128225A97B5EEDC896EF7622F3E288FEA00BB14D2B940
.. _esp32_devkitc_wroom:
ESP32-DEVKITC-WROOM
###################
Overview
********
ESP32-DEVKITC-WROOM is a series of low cost, low power system on a chip microcontrollers
with integrated Wi-Fi & dual-mode Bluetooth. The ESP32 series employs a
Tensilica Xtensa LX6 microprocessor in both dual-core and single-core
variations. ESP32-WROOM is created and developed by Espressif Systems, a
Shanghai-based Chinese company, and is manufactured by TSMC using their 40nm
process. [1]_
The features include the following:
- Dual core Xtensa microprocessor (LX6), running at 160 or 240MHz
- 520KB of SRAM
- 802.11b/g/n/e/i
- Bluetooth v4.2 BR/EDR and BLE
- Various peripherals:
- 12-bit ADC with up to 18 channels
- 2x 8-bit DACs
- 10x touch sensors
- Temperature sensor
- 4x SPI
- 2x I2S
- 2x I2C
- 3x UART
- SD/SDIO/MMC host
- Slave (SDIO/SPI)
- Ethernet MAC
- CAN bus 2.0
- IR (RX/TX)
- Motor PWM
- LED PWM with up to 16 channels
- Hall effect sensor
- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES)
- 5uA deep sleep current
.. figure:: ../../../../../../../boards/espressif/esp32_devkitc_wroom/doc/img/esp32_devkitc_wroom.jpg
:align: center
:alt: ESP32-DEVKITC-WROOM
ESP32-DevKitC-WROOM-32D DK
Asymmetric Multiprocessing (AMP)
********************************
ESP32-DEVKITC-WROOM allows 2 different applications to be executed in ESP32 SoC. Due to its dual-core architecture, each core can be enabled to execute customized tasks in stand-alone mode
and/or exchanging data over OpenAMP framework. See :ref:`ipc_samples` folder as code reference.
Supported Features
==================
Current Zephyr's ESP32-WROOM 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 |
+------------+------------+-------------------------------------+
| MCPWM | on-chip | pwm |
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| TWAI | on-chip | can |
+------------+------------+-------------------------------------+
| ADC | on-chip | adc |
+------------+------------+-------------------------------------+
| DAC | on-chip | dac |
+------------+------------+-------------------------------------+
| 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: esp_wrover_kit
: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: esp32_devkitc_wroom/esp32/procpu
:goals: build
The usual ``flash`` target will work with the ``esp32_devkitc_wroom`` board
configuration. Here is an example for the :ref:`hello_world`
application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_devkitc_wroom/esp32/procpu
: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! esp32_devkitc_wroom
Debugging
*********
ESP32-DEVKITC-WROOM support on OpenOCD is available upstream as of version 0.12.0.
Download and install OpenOCD from `OpenOCD`_.
On the ESP-WROOM-32 DevKitC board, the JTAG pins are not run to a
standard connector (e.g. ARM 20-pin) and need to be manually connected
to the external programmer (e.g. a Flyswatter2):
+------------+-----------+
| ESP32 pin | JTAG pin |
+============+===========+
| 3V3 | VTRef |
+------------+-----------+
| EN | nTRST |
+------------+-----------+
| IO14 | TMS |
+------------+-----------+
| IO12 | TDI |
+------------+-----------+
| GND | GND |
+------------+-----------+
| IO13 | TCK |
+------------+-----------+
| IO15 | TDO |
+------------+-----------+
Further documentation can be obtained from the SoC vendor in `JTAG debugging
for ESP32`_.
Here is an example for building the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: esp32_devkitc_wroom/esp32/procpu
:goals: build flash
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: esp32_devkitc_wroom/esp32/procpu
:goals: debug
Note on Debugging with GDB Stub
===============================
GDB stub is enabled on ESP32.
* When adding breakpoints, please use hardware breakpoints with command
``hbreak``. Command ``break`` uses software breakpoints which requires
modifying memory content to insert break/trap instructions.
This does not work as the code is on flash which cannot be randomly
accessed for modification.
.. _`JTAG debugging for ESP32`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/index.html
.. _`OpenOCD`: https://github.com/openocd-org/openocd
References
**********
.. [1] https://en.wikipedia.org/wiki/ESP32
.. _ESP32 Technical Reference Manual: https://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
.. _Hardware Reference: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/index.html
Part 3
한국어 전문 번역
개요
ESP32-DEVKITC-WROOM는 Wi-Fi와 dual-mode Bluetooth를 통합한 저비용·저전력 system-on-chip microcontroller 계열입니다. ESP32 series는 dual-core와 single-core 변형 모두에서 Tensilica Xtensa LX6 microprocessor를 사용합니다. ESP32-WROOM는 Shanghai에 기반을 둔 중국 회사 Espressif Systems가 만들고 개발했으며, TSMC의 40nm process로 제조됩니다.
주요 기능은 다음과 같습니다.
- 160MHz 또는 240MHz로 동작하는 dual-core Xtensa LX6 microprocessor
- 520KB SRAM
- 802.11b/g/n/e/i
- Bluetooth v4.2 BR/EDR 및 BLE
- 다양한 peripheral:
- 최대 18 channel의 12-bit ADC
- 8-bit DAC 2개
- touch sensor 10개
- temperature sensor
- SPI 4개
- I2S 2개
- I2C 2개
- UART 3개
- SD/SDIO/MMC host
- slave(SDIO/SPI)
- Ethernet MAC
- CAN bus 2.0
- IR(RX/TX)
- motor PWM
- 최대 16 channel의 LED PWM
- Hall effect sensor
- cryptographic hardware acceleration(RNG, ECC, RSA, SHA-2, AES)
- 5uA deep-sleep current

Asymmetric Multiprocessing(AMP)
ESP32-DEVKITC-WROOM에서는 ESP32 SoC에서 서로 다른 application 2개를 실행할 수 있습니다. Dual-core architecture 덕분에 각 core를 활성화해 독립 실행 mode에서 맞춤 task를 수행하게 하거나 OpenAMP framework를 통해 data를 교환하게 할 수 있습니다. Code reference는 ipc_samples folder를 참조하십시오.
지원 기능
현재 Zephyr의 ESP32-WROOM board가 지원하는 기능은 다음과 같습니다.
| 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 |
| MCPWM | on-chip | pwm |
| PCNT | on-chip | qdec |
| SPI DMA | on-chip | spi |
| TWAI | on-chip | can |
| ADC | on-chip | adc |
| DAC | on-chip | dac |
| Wi-Fi | on-chip | |
| Bluetooth | on-chip |
시스템 요구 사항
사전 준비
Espressif HAL이 동작하려면 Wi-Fi와 Bluetooth binary blob이 필요합니다. 다음 명령으로 해당 file을 가져옵니다.
west blobs fetch hal_espressif
빌드와 플래시
Simple boot
2nd-stage bootloader 없이 single binary image로 board를 load할 수 있습니다. 별도 configuration 없이 application을 build할 때의 default option입니다.
MCUboot bootloader
대신 MCUboot bootloader를 선택할 수 있습니다. 이 경우 bootloader를 적어도 한 번 build하고 flash해야 합니다. Application build 방식은 sysbuild와 manual build 두 가지입니다.
Board default configuration file에 다음 line을 추가하면 MCUboot bootloader를 선택할 수 있습니다.
CONFIG_BOOTLOADER_MCUBOOT=y
Sysbuild
Sysbuild를 사용하면 ESP32 SoC board를 bootstrap하는 데 필요한 모든 image를 한꺼번에 build하고 flash할 수 있습니다. Sysbuild로 samples/hello_world를 build하는 명령은 다음과 같습니다.
west build --sysbuild -b esp_wrover_kit samples/hello_world
ESP32 sysbuild는 기본적으로 bootloader(MCUboot) image와 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
더 자세한 내용은 Zephyr의 sysbuild documentation을 참조하십시오.
Manual build
개발 중에는 가능한 한 빠르게 build하고 flash해야 하므로 전통적인 build 방식으로 image를 하나씩 만들 수 있습니다. 아래 지침은 manual build와 sysbuild 모두에 적용되며 차이는 build directory 구조뿐입니다.
일반적인 방법으로 application을 build하고 flash합니다. samples/hello_world를 build하는 예는 다음과 같습니다.
west build -b esp32_devkitc_wroom/esp32/procpu samples/hello_world
일반적인 flash target도 ESP32-DEVKITC-WROOM board configuration에서 동작합니다.
west build -b esp32_devkitc_wroom/esp32/procpu 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! esp32_devkitc_wroom
디버깅
ESP32-DEVKITC-WROOM의 OpenOCD support는 version 0.12.0부터 upstream에서 제공됩니다. OpenOCD를 내려받아 설치하십시오.
ESP-WROOM-32 DevKitC board의 JTAG pin은 ARM 20-pin 같은 standard connector에 연결되어 있지 않습니다. 따라서 Flyswatter2 같은 external programmer에 다음과 같이 직접 연결해야 합니다.
| ESP32 pin | JTAG pin |
|---|---|
| 3V3 | VTRef |
| EN | nTRST |
| IO14 | TMS |
| IO12 | TDI |
| GND | GND |
| IO13 | TCK |
| IO15 | TDO |
자세한 내용은 SoC vendor의 JTAG debugging for ESP32 문서를 참조하십시오.
hello_world application을 build하고 flash하는 예는 다음과 같습니다.
west build -b esp32_devkitc_wroom/esp32/procpu samples/hello_world
west flash
Application도 일반적인 방법으로 debug할 수 있습니다.
west build -b esp32_devkitc_wroom/esp32/procpu samples/hello_world
west debug
GDB Stub 디버깅 주의사항
ESP32에서는 GDB stub이 활성화되어 있습니다.
- Breakpoint를 추가할 때는
hbreak명령으로 hardware breakpoint를 사용하십시오.break명령은 break/trap instruction을 삽입하기 위해 memory 내용을 바꾸는 software breakpoint를 사용합니다. Code가 random-access modification이 불가능한 flash에 있으므로 이 방식은 동작하지 않습니다.
참고 자료
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.