ESP32-H2-Zero

From Waveshare Wiki
Jump to: navigation, search

ESP32-H2-Zero
Without header
ESP32-H2-Zero

USB Type-C
ESP32-H2-Zero
With pre-soldered header
ESP32-H2-Zero-M

USB Type-C
{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

Introduction

ESP32-H2-Zero is a compact microcontroller development board with multiple digital interfaces.

In hardware, it adopts the ESP32-H2FH4S chip, which features a RISC-V 32-bit single-core processor with a clock frequency up to 96 MHz, and includes 320 KB SRAM, 128 KB ROM, and 4 KB LP memory. It is compatible with a variety of peripheral devices, making it more convenient to use.

On the software side, you can choose to develop in the ESP-IDF development environment or on the Arduino IDE, making it easy and quick to get started and apply it to products.

Features

  • Adopts the ESP32-H2FH4S chip, equipped with a RISC-V 32-bit single-core processor, with a clock speed of up to 96 MHz
  • Integrated 320 KB SRAM, 128 KB ROM, 4 KB LP memory, and 4MB Flash memory
  • Integrated Bluetooth LE wireless communication and IEEE 802.15.4 technology, featuring superior RF performance
  • Adopts Type-C connector, no need to worry about insertion direction
  • Rich peripheral interfaces, compatible with the pins of ESP32-H2-DevKitM-1 development board, offers strong compatibility and expandability
  • Castellated module allows soldering directly to carrier boards
  • Support a variety of low-power operating states, adjustable balance between communication distance, data rate and power consumption to meet the power requirements of various application scenarios

Functional Block Diagram

ESP32-H2-Zero-details-9.jpg

Interfaces

ESP32-H2-Zero-details-intro.jpg

1. ESP32-H2FH4S
Equipped with a RISC-V 32-bit single-core processor, supports up to 96MHz clock frequency

2. 2.4G ceramic antenna

3. ME6217C33M5G
Low dropout LDO, current (Max) 800mA

4. WS2812 RGB LED

5. BOOT button
Press it and then press the RESET button to enter download mode

6. RESET button

7. USB Type-C port
For downloading program and debugging

8. ESP32-H2FH4S pinout

Pinout Definition

ESP32-H2-Zero-details-inter.jpg

Dimensions

ESP32-H2-Zero-details-size.jpg

Working with ESP-IDF

The following development system is Windows by default, and it is recommended to use the VSCode plug-in for development.

Develop with VSCode Plug-in

Install VSCode

  • Open the download page of the official VSCode website, and select the corresponding system and system bit to download.

ESP32-H2 TO Environment 0.png

  • After running the installation package, the rest can be installed by default, but here for the subsequent experience, it is recommended to check boxes 1, 2, and 3.
    • After the first two items are enabled, you can open VSCode directly by right-clicking files or directories, which can improve the subsequent user experience.
    • After the third item is enabled, you can select VSCode directly when you choose how to open it.
ESP32-H2 TO Environment 1.png

Install Espressif IDF Plug-in

  • Note: Currently the latest version of the plugin is V1.6.4, users can choose the same version as us for a consistent experience.
  • Open VSCode, use Shift+Ctrl+X enter the plug-in manager.

ESP32-H2 TO Environment 2.png

  • In the search bar, enter Espressif IDF to select the corresponding plug-in and click Install.

ESP32-H2 TO Environment 3.png

ESP32-H2 TO Environment 4.png

  • Press shortcut key F1 to input:
esp-idf: configure esp-idf extension

ESP32-H2 TO Environment 5.png

  • Select express (This tutorial is intended for first-time installation users, so only the first general installation tutorial is covered).

ESP32-H2 TO Environment 6.png

  • Choose the download server, we recommend users to use Espressif as your download server

ESP32-H2 TO Environment 7.png

  • Select the version of ESP-IDF you want to use now, we choose the latest V5.1.1 (note that ESP-IDF only supports ESP32-H2 after V5.1)

ESP32-H2 TO Environment 8.png

  • The following two are the installation paths respectively for the ESP-IDF container directory and the ESP-IDF Tools directory.


ESP32-H2 TO Environment 9.png

  • Note: If you have installed ESP-IDF before, or failed to do so, please be sure to delete the file completely or create a new path without Chinese.
  • After configuring, click Install to download:

ESP32-H2 TO Environment 10.png

  • Enter the download interface, and then it will automatically install the corresponding tools and environment, just wait for a second.

ESP32-H2 TO Environment 11.png

  • After the installation is complete, you will enter the following interface, indicating that the installation is finished.

ESP32-H2 TO Environment 12.png

Official Demo Usage Tutorial

Create Demo ( Demo )

  • Press shortcut key F1 to input:
esp-idf:show examples projects

ESP32-H2 TO Program 1.png

  • Select your current IDF version

ESP32-H2 TO Program 2.png

  • Take the Hello world demo as an example:
    • ①Select the corresponding demo.
    • ②Its readme will state what chip the demo applies to (how to use the demo and the file structure are described below, omitted here).
    • ③Click to create the demo.

ESP32-H2 TO Program 3.png
Select the path to save the demo, and require that the demos cannot use folders with the same name
ESP32-H2 TO Program 4.png

Modify COM Port

  • The corresponding COM ports are shown here, click to modify them.
  • Please select the COM ports corresponding to the device. It is recommended to prioritize using the COM port corresponding to USB (which can be viewed in Device Manager)
  • If the download fails, please press and hold the Reset button for more than 1 second, and wait for the PC to re-recognize the device before downloading again.

ESP32-H2 TO Program 5.png

  • Select the project or demo to use.

ESP32-H2 TO Program 6.png

  • Then we finish the modification of the COM ports.

Modify Driver Object

  • The driver object is displayed here, and you can modify it by clicking on it.
  • Select the project or demo to use.

ESP32-H2 TO Program 7.png

  • Wait for a moment after clicking.

ESP32-H2 TO Program 8.png

  • Select the object we need to drive, which is our main chip ESP32H2

ESP32-H2 TO Program 9.png

  • Choose the openocd path, it doesn't affect us here, so let's just choose one.

ESP32-H2 TO Program 10.png

Other Status Bar Functions

ESP32-H2 TO Program 11.png

  • ①SDK configuration editor, supports modifying many features and configurations of ESP-IDF
  • ②All cleanup, and clear all compiled files
  • ③Compile
  • ④Current download mode, the default is UART
  • ⑤Flash the current firmware, please do it after compiling
  • ⑥Open the serial port monitor, used to view the serial port information
  • ⑦Compile, flash,open the serial monitor, all-in-one button (most commonly used for debugging)

Compile, Flash and Serial Monitor

  • Click on the all-in-one button we described before to compile, flash and open the serial monitor.

ESP32-H2 TO Program 12.png

  • It may take a long time to compile especially for the first time.

ESP32-H2 TO Program 13.png

  • During this process, the ESP-IDF may take up a lot of CPU resources, so it may cause the system to lag.
  • If it is the first time to flash the program for a new project, you will need to select the download method, and select UART.

ESP32-H2 TO Program 14.png

  • This can also be changed later in the Download methods section (click on it to bring up the options).

ESP32-H2 TO Program 15.png

  • As it comes with the onboard automatic download circuit, it can be downloaded automatically without manual operation.

ESP32-H2 TO Program 16.png

  • After successful download, it will automatically enter the serial monitor, you can see the chip output the corresponding information and be prompted to restart after 10S

ESP32-H2 TO Program 17.png

Demo Demonstration

Hello Word

Official demo path: get-started -> hello_world
Demo effect: Output Hello world! at 10-second intervals in the TERMINAL window
     Software Operation
  • Create the official demo hello_world according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Program 17.png

GPIO

Official demo path: peripherals -> gpio -> generic_gpio
Demo effect: LED flashes at 1-second intervals
     Hardware Connection
ESP32-H2 LED
GPIO18 (or GPIO19) LED+
GND LED-
     Software Operation
  • Create the official demo generic_gpio according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 1.png

  • Enter demo macro definition location to see the GPIO actually processed

ESP32-H2 TO Sample 2.png

  • Right-click to enter GPIO definition location

ESP32-H2 TO Sample 3.png

  • The GPIOs actually processed are GPIO8 and GPIO9

ESP32-H2 TO Sample 4.png

RGB

Official demo path: get-started -> blink
Demo effect: Onboard RGB light beads blink at 1-second intervals
     Software Operation
  • Create the official demo blink according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 5.png

UART

Official demo path: peripherals -> uart-> uart_async_rxtxtasks
Demo effect: Perform UART data self-transmission/reception by shorting GPIO4 with GPIO5
     Hardware Connection
ESP32-H2 ESP32-H2 (same chip)
GPIO4 GPIO5
     Software Operation
  • Create the official demo uart_async_rxtxtasks according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 6.png

  • Connect hardware based on the GPIO used

ESP32-H2 TO Sample 7.png

  • Go to the definition file to see the GPIO actually used (check GPIO_NUM_4 -> right click -> Go to Definition)

ESP32-H2 TO Sample 8.png

I2C

Official demo path: peripherals -> lcd-> i2c_oled
Demo effect: Light up 0.96inch OLED (A) and display a string of characters
     Hardware Connection
0.96inch OLED (A) ESP32-H2
VCC 3V3
GND GND
DIN GPIO3
CLK GPIO4
CS GND
D/C GND
RES GPIO9
     Software Operation

ESP32-H2 TO Sample 9.png

  • Adapt to 0.96inch OLED (A), define the RES pin as GPIO9

ESP32-H2 TO Sample 10.png

  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 11.png

  • View the GPIO actually used

ESP32-H2 TO Sample 13.png

SPI

Official demo path: peripherals -> spi_master-> lcd
Demo effect: Display images dynamically on the 2.4inch LCD Module
     Hardware Connection
2.4inch LCD Module ESP32-H2
VCC 3V3
GND GND
DIN GPIO5
CLK GPIO4
CS GPIO1
D/C GPIO10
RES GPIO11
BL GPIO12
     Software Operation
  • Right-click on the VScode icon to run VScode as an administrator

ESP32-H2 TO Sample 14.png

ESP32-H2 TO Sample 15.png

  • Jump to the defined location

ESP32-H2 TO Sample 16.png

  • The ESP32-H2 is currently in use, block other chip definitions

ESP32-H2 TO Sample 18.png

  • Define the macro ESP32-H2, CONFIG_IDF_TARGET_ESP32H2
//#define CONFIG_IDF_TARGET_ESP32 1
#define CONFIG_IDF_TARGET_ESP32H2 1

ESP32-H2 TO Sample 19.png

  • Waiting to read ID

ESP32-H2 TO Sample Add 1.png

  • Add read delay to prevent read failure
vTaskDelay(100 / portTICK_PERIOD_MS);

ESP32-H2 TO Sample Add 2.png

  • Modify the backlight

ESP32-H2 TO Sample 20.png

  • Changed to gpio_set_level(PIN_NUM_BCKL, 1);

ESP32-H2 TO Sample 21.png

  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 22.png

Bluetooth

Official demo path: bluetooth -> bluedroid -> ble -> gatt_server
Demo effect: ESP32-H2 transmits data with the Bluetooth debugging assistant on the mobile phone
     Software Operation
  • Install Bluetooth debugging assistant on the mobile phone (other Bluetooth debugging software can also be used)
  • Create the official demo gatt_server according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Bluetooth name and UUID, Bluetooth name is ESP_GATTS_DEMO

ESP32-H2 TO Sample 24.png

  • Modify the COM port and driver object (it is recommended to use the COM port corresponding to USB, which can be viewed in Device Manager) and click compile and flash to run the program

ESP32-H2 TO Sample 25.png

  • Connect the Bluetooth device ESP_GATTS_DEMO on the mobile phone

ESP32-H2 TO Sample 26.png

  • The successful connection is shown below:

ESP32-H2 TO Sample 27.png

  • Based on the value of the UUID in the program, it can be known that there are two servers below. Choose one for uplink transmission

ESP32-H2 TO Sample 28.png

  • ESP32-H2 receives data

ESP32-H2 TO Sample 29.png

Zigbee

Official demo 1 path: Zigbee-> light_sample-> HA_on_off_switch
Official demo 2 path: Zigbee-> light_sample-> HA_on_off_light
Demo effect: Two ESP32-H2 chips, use the BOOT button of one (to flash HA_on_off_switch demo) to control the on/off of the RGB LED on the other chip
Note: Please flash the HA_on_off_switch demo to one chip first, and then flash HA_on_off_light demo to the other chip
     Software Operation 1
  • Create the official demo HA_on_off_switch according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object, click compile and flash to run the demo

ESP32-H2 TO Sample 30.png

     Software Operation 2
  • Create the official demo HA_on_off_light according to the tutorial (Create Demo) above
  • The demo is compatible with ESP32-H2 and can be used without modifying the demo
  • Modify the COM port and driver object, click compile and flash to run the demo (You need to wait for a while to allow the two chips to establish a connection)

ESP32-H2 TO Sample 31.png

  • If the connection is successful, the corresponding button demo and LED demo will print the relevant data

ESP32-H2 TO Sample 32.png

  • If initialization fails, it may be due to the device having residual information from other networks. You can erase the device information (see Erasure Tutorial) and then re-network.


Flash Erasure Tutorial

  • Unzip the software resource package (Flash debugging software)
  • Open flash_download_tool_3.9.5.exe software, select ESP32-H2 and UART

ESP32-H2 TO Erase Flash 1.png

  • Select the port number of the UART, click START (do not select any bin files)

ESP32-H2 TO Erase Flash 2.png

  • Wait for the flashing to complete, then click Erase

ESP32-H2 TO Erase Flash 3.png

  • Wait for the erasing to complete

ESP32-H2 TO Erase Flash 4.png

Working with Arduino

Please note that Arduino 3.0.0-alpha is based on ESP-IDF v5.1 and differs significantly from versions based on ESP-IDF V4.X. After performing the following operations, your previous demo may require some adjustments to work properly
Please note that the computer username must be in English

Environment Setup

ESP32-H2 TO Arduino 1.png

  • Open Arduino IDE after installation

ESP32-H2 TO Arduino 2.png

  • Enter Preferences page

ESP32-H2 TO Arduino 3.png

  • Add a JSON link
https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json

ESP32-H2 TO Arduino 4.png ESP32-H2 TO Arduino 5.png

  • Modify the project folder to C:\Users\Waveshare\AppData\Local\Arduino15\packages (where Waveshare is the computer username)

ESP32-H2 TO Arduino Add 1.png

  • Enter the development board manager, search for esp32, select 3.0.0-alpha3 version 3.0.0 in esp32 by Espressif Systems below, and click INSTALL (if it cannot be installed normally, you can try using a phone hotspot)

ESP32-H2 TO Arduino 6.png ESP32-H2 TO Arduino 7.png

  • Restart Arduino IDE after installation

ESP32-H2 TO Arduino 8.png

Click to expand if installation fails

  • Failed to install version 3.0.0-alpha3

ESP32-H2 TO Arduino 9.png

ESP32-H2 TO Arduino 10.png

  • Enter from the resource manager at the path "C:\Users\Waveshare\AppData\Local\Arduino15\staging\packages" (where Waveshare is the computer username, you need to enable Show hidden files)

ESP32-H2 TO Arduino 11.png

  • Uncompress the downloaded file above to the packages folder

ESP32-H2 TO Arduino 12.png

  • Perform installation operation again

ESP32-H2 TO Arduino 13.png

  • Restart Arduino IDE after installation

ESP32-H2 TO Arduino 14.png

Create Demo

  • Change the project folder above to c:\Users\Waveshare\AppData\Local\Arduino15\packages
  • Create a demo based on the demos in the project folder under the file

ESP32-H2 TO Arduino sample 1.png

  • The following demonstrates an example of creating an RGB blink (found under File -> Sketchbook -> esp32 -> hardware -> esp32 -> 3.0.0-alpha3 -> libraries -> ESP32 -> examples -> GPIO -> BlinkRGB )

ESP32-H2 TO Arduino sample 2.png

  • Select development board and port

ESP32-H2 TO Arduino sample 3.png

  • Search for ESP32H2, select ESP32H2 Dev Module and download port

ESP32-H2 TO Arduino sample 5.png

  • Select OK, click upload, Arduino IDE will compile and flash the demo

ESP32-H2 TO Arduino sample 6.png

  • Upload complete, and you can see the output on the development board

ESP32-H2 TO Arduino sample 7.png


Resources

Software

Programming Software

Driver

Serial Port

Flashing

Bluetooth Debugging

Schematic Diagram

Datasheets

ESP32-H2

Official Document

Raspberry Pi Official Document

FAQ


 Answer:

Method 1: Click the Reset button for more than 1 second, wait for the PC to re-recognize the device and then download again.
Method 2: Long press the BOOT button, press RESET at the same time, then release RESET, then release the BOOT button, at this time the module can enter the download mode, which can solve most of the problems that can not be downloaded.


 Answer:

Click the shortcut key F1 in VSCode, search for Espressif IDF, and you will find the extension that is marked as untrusted. Set it to trusted.


 Answer:

Please re-select the COM port and the driver object after switching ESP, then recompile and flash.


 Answer:

Check if the power voltage of the USB port is less than 5V. Generally, the power voltage of the USB port is above 4.9V, and both USB ports of the module can be used normally. If it is below 4.9V, there may be a power supply shortage and USB disconnection issue. In this case, a USB port with sufficient voltage should be used.


 Answer:

It may be due to the device having residual information from other networks. You can erase the device information (see Erasure Tutorial) and then re-network.


 Answer:

Please erase the two boards with firmware flashing software, and then perform the demo flashing.



Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)