|
| 1 | +.. zephyr:board:: esp32h2_devkitm |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +ESP32-H2-DevKitM-1 is an entry-level development board based on the ESP32-H2-MINI-1 module, |
| 7 | +which integrates Bluetooth® Low Energy (LE) and IEEE 802.15.4 connectivity. It features |
| 8 | +the ESP32-H2 SoC — a 32-bit RISC-V core designed for low-power, secure wireless communication, |
| 9 | +supporting Bluetooth 5 (LE), Bluetooth Mesh, Thread, Matter, and Zigbee protocols. |
| 10 | +This module is ideal for a wide range of low-power IoT applications. |
| 11 | + |
| 12 | +Hardware |
| 13 | +******** |
| 14 | + |
| 15 | +ESP32-H2 combines IEEE 802.15.4 connectivity with Bluetooth 5 (LE). The SoC is powered by |
| 16 | +a single-core, 32-bit RISC-V microcontroller that can be clocked up to 96 MHz. The ESP32-H2 has |
| 17 | +been designed to ensure low power consumption and security for connected devices. ESP32-H2 has |
| 18 | +320 KB of SRAM with 16 KB of Cache, 128 KB of ROM, 4 KB LP of memory, and a built-in 2 MB or 4 MB |
| 19 | +SiP flash. It has 19 programmable GPIOs with support for ADC, SPI, UART, I2C, I2S, RMT, GDMA |
| 20 | +and LED PWM. |
| 21 | + |
| 22 | +Most of ESP32-H2-DevKitM-1's I/O pins are broken out to the pin headers on both sides for easy |
| 23 | +interfacing. Developers can either connect peripherals with jumper wires or mount the board |
| 24 | +on a breadboard. |
| 25 | + |
| 26 | +ESP32-H2 main features: |
| 27 | + |
| 28 | +- RISC-V 32-bit single-core microprocessor |
| 29 | +- 320 KB of internal RAM |
| 30 | +- 4 KB LP Memory |
| 31 | +- Bluetooth LE: Bluetooth 5.3 certified |
| 32 | +- IEEE 802.15.4 (Zigbee and Thread) |
| 33 | +- 19 programmable GPIOs |
| 34 | +- Numerous peripherals (details below) |
| 35 | + |
| 36 | +Digital interfaces: |
| 37 | + |
| 38 | +- 19x GPIOs |
| 39 | +- 2x UART |
| 40 | +- 2x I2C |
| 41 | +- 1x General-purpose SPI |
| 42 | +- 1x I2S |
| 43 | +- 1x Pulse counter |
| 44 | +- 1x USB Serial/JTAG controller |
| 45 | +- 1x TWAI® controller, compatible with ISO 11898-1 (CAN Specification 2.0) |
| 46 | +- 1x LED PWM controller, up to 6 channels |
| 47 | +- 1x Motor Control PWM (MCPWM) |
| 48 | +- 1x Remote Control peripheral (RMT), with up to 2 TX and 2 RX channels |
| 49 | +- 1x Parallel IO interface (PARLIO) |
| 50 | +- General DMA controller (GDMA), with 3 transmit channels and 3 receive channels |
| 51 | +- Event Task Matrix (ETM) |
| 52 | + |
| 53 | +Analog interfaces: |
| 54 | + |
| 55 | +- 1x 12-bit SAR ADCs, up to 5 channels |
| 56 | +- 1x Temperature sensor (die) |
| 57 | + |
| 58 | +Timers: |
| 59 | + |
| 60 | +- 1x 52-bit system timer |
| 61 | +- 2x 54-bit general-purpose timers |
| 62 | +- 3x Watchdog timers |
| 63 | + |
| 64 | +Low Power: |
| 65 | + |
| 66 | +- Four power modes designed for typical scenarios: Active, Modem-sleep, Light-sleep, Deep-sleep |
| 67 | + |
| 68 | +Security: |
| 69 | + |
| 70 | +- Secure boot |
| 71 | +- Flash encryption |
| 72 | +- 4-Kbit OTP, up to 1792 bits for users |
| 73 | +- Cryptographic hardware acceleration: (AES-128/256, ECC, HMAC, RSA, SHA, Digital signature, Hash) |
| 74 | +- Random number generator (RNG) |
| 75 | + |
| 76 | +For detailed information, check the datasheet at `ESP32-H2 Datasheet`_ or the Technical Reference |
| 77 | +Manual at `ESP32-H2 Technical Reference Manual`_. |
| 78 | + |
| 79 | +Supported Features |
| 80 | +================== |
| 81 | + |
| 82 | +.. zephyr:board-supported-hw:: |
| 83 | +
|
| 84 | +System requirements |
| 85 | +******************* |
| 86 | + |
| 87 | +Prerequisites |
| 88 | +============= |
| 89 | + |
| 90 | +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command |
| 91 | +below to retrieve those files. |
| 92 | + |
| 93 | +.. code-block:: console |
| 94 | +
|
| 95 | + west blobs fetch hal_espressif |
| 96 | +
|
| 97 | +.. note:: |
| 98 | + |
| 99 | + It is recommended running the command above after :file:`west update`. |
| 100 | + |
| 101 | +Building & Flashing |
| 102 | +******************* |
| 103 | + |
| 104 | +.. zephyr:board-supported-runners:: |
| 105 | +
|
| 106 | +Simple boot |
| 107 | +=========== |
| 108 | + |
| 109 | +The board could be loaded using the single binary image, without 2nd stage bootloader. |
| 110 | +It is the default option when building the application without additional configuration. |
| 111 | + |
| 112 | +.. note:: |
| 113 | + |
| 114 | + Simple boot does not provide any security features nor OTA updates. |
| 115 | + |
| 116 | +MCUboot bootloader |
| 117 | +================== |
| 118 | + |
| 119 | +User may choose to use MCUboot bootloader instead. In that case the bootloader |
| 120 | +must be built (and flashed) at least once. |
| 121 | + |
| 122 | +There are two options to be used when building an application: |
| 123 | + |
| 124 | +1. Sysbuild |
| 125 | +2. Manual build |
| 126 | + |
| 127 | +.. note:: |
| 128 | + |
| 129 | + User can select the MCUboot bootloader by adding the following line |
| 130 | + to the board default configuration file. |
| 131 | + |
| 132 | + .. code:: cfg |
| 133 | +
|
| 134 | + CONFIG_BOOTLOADER_MCUBOOT=y |
| 135 | +
|
| 136 | +Sysbuild |
| 137 | +======== |
| 138 | + |
| 139 | +The sysbuild makes possible to build and flash all necessary images needed to |
| 140 | +bootstrap the board with the EPS32-H2 SoC. |
| 141 | + |
| 142 | +To build the sample application using sysbuild use the command: |
| 143 | + |
| 144 | +.. zephyr-app-commands:: |
| 145 | + :tool: west |
| 146 | + :zephyr-app: samples/hello_world |
| 147 | + :board: esp32h2_devkitm |
| 148 | + :goals: build |
| 149 | + :west-args: --sysbuild |
| 150 | + :compact: |
| 151 | + |
| 152 | +By default, the ESP32-H2 sysbuild creates bootloader (MCUboot) and application |
| 153 | +images. But it can be configured to create other kind of images. |
| 154 | + |
| 155 | +Build directory structure created by sysbuild is different from traditional |
| 156 | +Zephyr build. Output is structured by the domain subdirectories: |
| 157 | + |
| 158 | +.. code-block:: |
| 159 | +
|
| 160 | + build/ |
| 161 | + ├── hello_world |
| 162 | + │ └── zephyr |
| 163 | + │ ├── zephyr.elf |
| 164 | + │ └── zephyr.bin |
| 165 | + ├── mcuboot |
| 166 | + │ └── zephyr |
| 167 | + │ ├── zephyr.elf |
| 168 | + │ └── zephyr.bin |
| 169 | + └── domains.yaml |
| 170 | +
|
| 171 | +.. note:: |
| 172 | + |
| 173 | + With ``--sysbuild`` option the bootloader will be re-build and re-flash |
| 174 | + every time the pristine build is used. |
| 175 | + |
| 176 | +For more information about the system build please read the :ref:`sysbuild` documentation. |
| 177 | + |
| 178 | +Manual build |
| 179 | +============ |
| 180 | + |
| 181 | +During the development cycle, it is intended to build & flash as quickly possible. |
| 182 | +For that reason, images can be built one at a time using traditional build. |
| 183 | + |
| 184 | +The instructions following are relevant for both manual build and sysbuild. |
| 185 | +The only difference is the structure of the build directory. |
| 186 | + |
| 187 | +.. note:: |
| 188 | + |
| 189 | + Remember that bootloader (MCUboot) needs to be flash at least once. |
| 190 | + |
| 191 | +Build and flash applications as usual (see :ref:`build_an_application` and |
| 192 | +:ref:`application_run` for more details). |
| 193 | + |
| 194 | +.. zephyr-app-commands:: |
| 195 | + :zephyr-app: samples/hello_world |
| 196 | + :board: esp32h2_devkitm |
| 197 | + :goals: build |
| 198 | + |
| 199 | +The usual ``flash`` target will work with the ``esp32h2_devkitm`` board |
| 200 | +configuration. Here is an example for the :zephyr:code-sample:`hello_world` |
| 201 | +application. |
| 202 | + |
| 203 | +.. zephyr-app-commands:: |
| 204 | + :zephyr-app: samples/hello_world |
| 205 | + :board: esp32h2_devkitm |
| 206 | + :goals: flash |
| 207 | + |
| 208 | +Open the serial monitor using the following command: |
| 209 | + |
| 210 | +.. code-block:: shell |
| 211 | +
|
| 212 | + west espressif monitor |
| 213 | +
|
| 214 | +After the board has automatically reset and booted, you should see the following |
| 215 | +message in the monitor: |
| 216 | + |
| 217 | +.. code-block:: console |
| 218 | +
|
| 219 | + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** |
| 220 | + Hello World! esp32h2_devkitm/esp32h2 |
| 221 | +
|
| 222 | +.. include:: ../../../espressif/common/board-variants.rst |
| 223 | + :start-after: espressif-board-variants |
| 224 | + |
| 225 | +Debugging |
| 226 | +********* |
| 227 | + |
| 228 | +As with much custom hardware, the ESP32-H2 modules require patches to |
| 229 | +OpenOCD that are not upstreamed yet. Espressif maintains their own fork of |
| 230 | +the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_. |
| 231 | + |
| 232 | +The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the |
| 233 | +``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>`` |
| 234 | +parameter when building. |
| 235 | + |
| 236 | +Here is an example for building the :zephyr:code-sample:`hello_world` application. |
| 237 | + |
| 238 | +.. zephyr-app-commands:: |
| 239 | + :zephyr-app: samples/hello_world |
| 240 | + :board: esp32h2_devkitm |
| 241 | + :goals: build flash |
| 242 | + :gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts> |
| 243 | + |
| 244 | +You can debug an application in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application. |
| 245 | + |
| 246 | +.. zephyr-app-commands:: |
| 247 | + :zephyr-app: samples/hello_world |
| 248 | + :board: esp32h2_devkitm |
| 249 | + :goals: debug |
| 250 | + |
| 251 | +References |
| 252 | +********** |
| 253 | + |
| 254 | +.. target-notes:: |
| 255 | + |
| 256 | +.. _`ESP32-H2-DevKitM-1`: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32h2/esp32-h2-devkitm-1/user_guide.html |
| 257 | +.. _`ESP32-H2 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf |
| 258 | +.. _`ESP32-H2 Technical Reference Manual`: https://www.espressif.com/sites/default/files/documentation/esp32-h2_technical_reference_manual_en.pdf |
| 259 | +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases |
0 commit comments