ESP32MINI1 User Manual Preliminary v0.1 Espressif Systems Copyright 2021 www.espressif.com This user manual shows how to get started with ESP32-MINI-1 module. About This Manual Document Updates Please always refer to the latest version on https://www.espressif.com/en/support/download/documents. Revision History For revision history of this document, please refer to the last page. Documentation Change Notification Espressif provides email notifications to keep customers updated on changes to technical documentation. Please subscribe at www.espressif.com/en/subscribe. Certification Download certificates for Espressif products from www.espressif.com/en/certificates. 2 Get Started on ESP32MINI1 2.1 What You Need Contents Contents 1 Overview 1.1 Module Overview 1.2 Pin Description 2.2 2.3 Hardware Connection Set up Development Environment 2.3.1 Install Prerequisites 2.3.2 Get ESP-IDF Set up Tools 2.3.3 2.3.4 Set up Environment Variables 2.4 Create Your First Project 2.4.1 Start a Project 2.4.2 Connect Your Device 2.4.3 Configure 2.4.4 Build the Project 2.4.5 Flash onto the Device 2.4.6 Monitor Learning Resources 3 3.1 Must-Read Documents 3.2 Must-Have Resources Revision History 4 4 4 7 7 7 8 8 8 9 9 9 9 9 10 10 11 12 14 14 14 16 Espressif Systems 3 ESP32-MINI-1 User Manual (Preliminary v0.1) 1 Overview 1 Overview 1.1 Module Overview ESP32-MINI-1 is a highly-integrated, small-sized Wi-Fi+Bluetooth+Bluetooth LE MCU module that has a rich set of peripherals. This module is an ideal choice for a wide variety of IoT applications, ranging from home automation, smart building, consumer electronics to industrial control, especially suitable for applications within a compact space, such as bulbs, switches and sockets. This module comes in two versions:
85 C version 105 C version Table 11. ESP32MINI1 Specifications Categories Items Specifications Wi-Fi Protocols Frequency range Protocols Bluetooth Radio Audio Module interfaces Integrated crystal Integrated SPI flash 802.11 b/g/n (802.11n up to 150 Mbps) A-MPDU and A-MSDU aggregation and 0.4 s guard interval support 2412 ~ 2484 MHz Protocols v4.2 BR/EDR and Bluetooth LE specifica-
tions Class-1, class-2 and class-3 transmitter AFH CVSD and SBC SD card, UART, SPI, SDIO, I2C, LED PWM, motor PWM, I2S, infrared remote controller, pulse counter, GPIO, touch sensor, ADC, DAC, Two-Wire Automo-
tive Interface (TWAITM, compatible with ISO11898-1) 40 MHz crystal Hardware Operating voltage/Power supply 3.0 V ~ 3.6 V Operating current Average: 80 mA Minimum current delivered by power 4 MB 500 mA supply ture range Moisture sensitivity level (MSL) Level 3 C ~ +105 C 1.2 Pin Description ESP32-MINI-1 has 55 pins. See pin definitions in Table 1-2. Recommended operating tempera-
85 C version: 40 C ~ +85 C; 105 C version: 40 Espressif Systems 4 ESP32-MINI-1 User Manual (Preliminary v0.1) 1 Overview No. Type Function 1, 2, 27, 38 ~ 55 Ground Name GND 3V3 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 32 P P I I I I I I I I/O I/O I/O I/O
I/O I/O I/O I/O I/O I/O I36 I37 I38 I39 EN I34 I35 IO32 IO33 IO25 IO26 IO27 IO14 IO12 IO13 IO15 IO2 IO0 IO4 NC NC IO9 IO10 NC IO5 IO18 IO23 IO19 Table 12. Pin Definitions Power supply GPIO36, ADC1_CH0, RTC_GPIO0 GPIO37, ADC1_CH1, RTC_GPIO1 GPIO38, ADC1_CH2, RTC_GPIO2 GPIO39, ADC1_CH3, RTC_GPIO3 High: enables the chip Low: the chip powers off Note: do not leave the pin floating GPIO34, ADC1_CH6, RTC_GPIO4 GPIO35, ADC1_CH7, RTC_GPIO5 TOUCH9, RTC_GPIO9 TOUCH8, RTC_GPIO8 I/O GPIO32, XTAL_32K_P (32.768 kHz crystal oscillator input), ADC1_CH4, I/O GPIO33, XTAL_32K_N (32.768 kHz crystal oscillator output), ADC1_CH5, GPIO25, DAC_1, ADC2_CH8, RTC_GPIO6, EMAC_RXD0 GPIO26, DAC_2, ADC2_CH9, RTC_GPIO7, EMAC_RXD1 GPIO27, ADC2_CH7, TOUCH7, RTC_GPIO17, EMAC_RX_DV GPIO14, ADC2_CH6, TOUCH6, RTC_GPIO16, MTMS, HSPICLK, HS2_CLK, SD_CLK, EMAC_TXD2 I/O GPIO12, ADC2_CH5, TOUCH5, RTC_GPIO15, MTDI, HSPIQ, HS2_DATA2, SD_DATA2, EMAC_TXD3 I/O GPIO13, ADC2_CH4, TOUCH4, RTC_GPIO14, MTCK, HSPID, HS2_DATA3, SD_DATA3, EMAC_RX_ER I/O GPIO15, ADC2_CH3, TOUCH3, RTC_GPIO13, MTDO, HSPICS0, HS2_CMD, SD_CMD, EMAC_RXD3 I/O GPIO2, ADC2_CH2, TOUCH2, RTC_GPIO12, HSPIWP, HS2_DATA0, I/O GPIO0, ADC2_CH1, TOUCH1, RTC_GPIO11, CLK_OUT1, I/O GPIO4, ADC2_CH0, TOUCH0, RTC_GPIO10, HSPIHD, HS2_DATA1, SD_DATA1, EMAC_TX_ER SD_DATA0 EMAC_TX_CLK No connect No connect No connect GPIO9, HS1_DATA2, U1RXD, SD_DATA2 GPIO10, HS1_DATA3, U1TXD, SD_DATA3 GPIO5, HS1_DATA6, VSPICS0, EMAC_RX_CLK GPIO18, HS1_DATA7, VSPICLK GPIO23, HS1_STROBE, VSPID GPIO19, VSPIQ, U0CTS, EMAC_TXD0 Contd on next page Espressif Systems 5 ESP32-MINI-1 User Manual (Preliminary v0.1) 1 Overview Name IO22 IO21 RXD0 TXD0 NC Table 12 contd from previous page No. Type Function 33 34 35 36 37 I/O I/O I/O I/O
GPIO22, VSPIWP, U0RTS, EMAC_TXD1 GPIO21, VSPIHD, EMAC_TX_EN GPIO3, U0RXD, CLK_OUT2 GPIO1, U0TXD, CLK_OUT3, EMAC_RXD2 No connect 1 Pins GPIO6, GPIO7, GPIO8, GPIO11, GPIO16, and GPIO17 on the ESP32-U4WDH chip are connected to the SPI flash integrated on the module and are not led out. 2 For peripheral pin configurations, please refer to ESP32 Series Datasheet. Espressif Systems 6 ESP32-MINI-1 User Manual (Preliminary v0.1) 2 Get Started on ESP32-MINI-1 2 Get Started on ESP32MINI1 2.1 What You Need To develop applications for ESP32-MINI-1 module you need:
1 x ESP32-MINI-1 module 1 x Espressif RF testing board 1 x USB-to-Serial board 1 x Micro-USB cable 1 x PC running Linux In this user guide, we take Linux operating system as an example. For more information about the configuration on Windows and macOS, please refer to ESP-IDF Programming Guide. 2.2 Hardware Connection 1. Solder the ESP32-MINI-1 module to the RF testing board as shown in Figure 2-1. Figure 21. Hardware Connection 2. Connect the RF testing board to the USB-to-Serial board via TXD, RXD, and GND. 3. Connect the USB-to-Serial board to the PC. 4. Connect the RF testing board to the PC or a power adapter to enable 5 V power supply, via the Micro-USB cable. 5. During download, connect IO0 to GND via a jumper. Then, turn ON the testing board. 6. Download firmware into flash. For details, see the sections below. Espressif Systems 7 ESP32-MINI-1 User Manual (Preliminary v0.1) 2 Get Started on ESP32-MINI-1 7. After download, remove the jumper on IO0 and GND. 8. Power up the RF testing board again. ESP32-MINI-1 will switch to working mode. The chip will read programs from flash upon initialization. Note:
IO0 is internally logic high. If IO0 is set to pull-up, the Boot mode is selected. If this pin is pull-down or left floating, the Download mode is selected. For more information on ESP32-MINI-1, please refer to ESP32-MINI-1 Datasheet. 2.3 Set up Development Environment The Espressif IoT Development Framework (ESP-IDF for short) is a framework for developing applications based on the Espressif ESP32. Users can develop applications with ESP32 in Windows/Linux/macOS based on ESP-IDF. Here we take Linux operating system as an example. 2.3.1 Install Prerequisites To compile with ESP-IDF you need to get the following packages:
CentOS 7:
sudo yum install git wget flex bison gperf python cmake ninjabuild ccache dfuutil Ubuntu and Debian (one command breaks into two lines):
sudo aptget install git wget flex bison gperf python pythonpip pythonsetuptools cmake ninja build ccache libi dev libssl dev dfuutil sudo pacman S needed gcc git make flex bison gperf pythonpip cmake ninja ccache dfuutil This guide uses the directory ~/esp on Linux as an installation folder for ESP-IDF. Keep in mind that ESP-IDF does not support spaces in paths. To build applications for ESP32-MINI-1 module, you need the software libraries provided by Espressif in ESP-IDF To get ESP-IDF, create an installation directory (~/esp) to download ESP-IDF to and clone the repository with git git clone recursive https://github .com/espressif/espidf. git Espressif Systems 8 ESP32-MINI-1 User Manual (Preliminary v0.1) Arch:
Note:
2.3.2 Get ESPIDF repository. clone:
mkdir p ~/esp cd ~/esp 2 Get Started on ESP32-MINI-1 version to use in a given situation. 2.3.3 Set up Tools cd ~/esp/espidf
./ install .sh ESP-IDF will be downloaded into ~/esp/esp-idf. Consult ESP-IDF Versions for information about which ESP-IDF Aside from the ESP-IDF, you also need to install the tools used by ESP-IDF, such as the compiler, debugger, Python packages, etc. ESP-IDF provides a script named install.sh to help set up the tools in one go. 2.3.4 Set up Environment Variables The installed tools are not yet added to the PATH environment variable. To make the tools usable from the command line, some environment variables must be set. ESP-IDF provides another script export.sh which does that. In the terminal where you are going to use ESP-IDF, run:
. $HOME/esp/espidf/export.sh Now everything is ready, you can build your first project on ESP32-MINI-1 module. 2.4 Create Your First Project 2.4.1 Start a Project Now you are ready to prepare your application for ESP32-MINI-1 module. You can start with get-started/hello_world project from examples directory in ESP-IDF. Copy get-started/hello_world to ~/esp directory:
cp r $IDF_PATH/examples/getstarted/hello_world . There is a range of example projects in the examples directory in ESP-IDF. You can copy any project in the same way as presented above and run it. It is also possible to build examples in-place, without copying them 2.4.2 Connect Your Device Now connect your ESP32-MINI-1 module to the computer and check under what serial port the module is visible. Serial ports in Linux start with /dev/tty in their names. Run the command below two times, first with the board unplugged, then with plugged in. The port which appears the second time is the one you need:
cd ~/esp first. ls /dev/tty*
Note:
Keep the port name handy as you will need it in the next steps. Espressif Systems 9 ESP32-MINI-1 User Manual (Preliminary v0.1) Navigate to your hello_world directory from Step 2.4.1. Start a Project, set ESP32 chip as the target and run the 2 Get Started on ESP32-MINI-1 2.4.3 Configure project configuration utility menuconfig. cd ~/esp/hello_world idf .py settarget esp32 idf .py menuconfig Setting the target with idf.py set-target esp32 should be done once, after opening a new project. If the project contains some existing builds and configuration, they will be cleared and initialized. The target may be saved in environment variable to skip this step at all. See Selecting the Target for additional information. If the previous steps have been done correctly, the following menu appears:
Figure 22. Project Configuration Home Window The colors of the menu could be different in your terminal. You can change the appearance with the option
--style. Please run idf.py menuconfig --helpfor further information. 2.4.4 Build the Project Build the project by running:
idf .py build This command will compile the application and all ESP-IDF components, then it will generate the bootloader, partition table, and application binaries.
$ idf .py build Running cmake in directory /path/to/hello_world/build Executing cmake G Ninja warnuninitialized /path/to/hello_world... Warn about uninitialized values . Found Git: /usr/bin/git (found version 2.17.0) Espressif Systems 10 ESP32-MINI-1 User Manual (Preliminary v0.1) 2 Get Started on ESP32-MINI-1 Building empty aws_iot component due to configuration Component names: ... Component paths: ... .. (more lines of build system output)
[527/527] Generating hello world.bin esptool .py v2.3.1 Project build complete. To flash , run this command:
../../../ components/esptool_py/esptool/esptool.py p (PORT) b 921600 write_flash flash_mode dio flash_size detect flash_freq 40m 0x10000 build/helloworld.bin build 0x1000 build /bootloader/bootloader. bin 0x8000 build/ partition_table / partition table.bin or run idf .py p PORT flash If there are no errors, the build will finish by generating the firmware binary .bin file. 2.4.5 Flash onto the Device idf .py p PORT [b BAUD] flash Flash the binaries that you just built onto your ESP32-MINI-1 module by running:
Replace PORT with your modules serial port name from Step: Connect Your Device. You can also change the flasher baud rate by replacing BAUD with the baud rate you need. The default baud For more information on idf.py arguments, see idf.py. rate is 460800. Note:
The option flash automatically builds and flashes the project, so running idf.py build is not necessary. Running esptool.py in directory
[...]/ esp/hello_world Executing python [...]/ espidf/components/esptool_py/esptool/esptool.py b 460800 write_flash
@flash_project_args ... esptool .py b 460800 write_flash flash_mode dio flash_size detect flash_freq 40m 0x1000 bootloader/bootloader. bin 0x8000 partition_table / partition table.bin 0x10000 helloworld.bin esptool .py v2.3.1 Connecting .... Detecting chip type ... ESP32 Chip is ESP32U4WDH (revision 3) Features : WiFi, BT, Single Core Uploading stub ... Running stub ... Stub running ... Changing baud rate to 460800 Changed. Espressif Systems 11 ESP32-MINI-1 User Manual (Preliminary v0.1) 2 Get Started on ESP32-MINI-1 Configuring flash size ... Autodetected Flash size : 4MB Flash params set to 0x0220 Compressed 22992 bytes to 13019... Hash of data verified . Compressed 3072 bytes to 82... Hash of data verified . Compressed 136672 bytes to 67544... Hash of data verified . Leaving ... Hard resetting via RTS pin... and re-power up the testing board. 2.4.6 Monitor your serial port name). Wrote 22992 bytes (13019 compressed) at 0x00001000 in 0.3 seconds ( effective 558.9 kbit/s )... Wrote 3072 bytes (82 compressed) at 0x00008000 in 0.0 seconds ( effective 5789.3 kbit/s )... Wrote 136672 bytes (67544 compressed) at 0x00010000 in 1.9 seconds ( effective 567.5 kbit/s )... If everything goes well, the hello_world application starts running after you remove the jumper on IO0 and GND, To check if hello_world is indeed running, type idf.py -p PORT monitor (Do not forget to replace PORT with Executing python [...]/ espidf/tools/idf_monitor.py b 115200 [...]/ esp/hello_world/build/ hello world. elf ... This command launches the IDF Monitor application:
$ idf .py p /dev/ttyUSB0 monitor Running idf_monitor in directory
[...]/ esp/hello_world/build idf_monitor on /dev/ttyUSB0 115200 Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ets Jun 8 2016 00:22:57 rst :0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 After startup and diagnostic logs scroll up, you should see Hello world! printed out by the application. This is esp32 chip with 1 CPU core, WiFi/BT/BLE, silicon revision 3, 4MB external flash
... .. Hello world!
Restarting in 10 seconds ... Restarting in 9 seconds ... Restarting in 8 seconds ... Restarting in 7 seconds ... To exit IDF monitor use the shortcut Ctrl+]. Espressif Systems 12 ESP32-MINI-1 User Manual (Preliminary v0.1) 2 Get Started on ESP32-MINI-1 Thats all what you need to get started with ESP32-MINI-1 module! Now you are ready to try some other examples in ESP-IDF, or go right to developing your own applications. Espressif Systems 13 ESP32-MINI-1 User Manual (Preliminary v0.1) 3 Learning Resources 3 Learning Resources 3.1 MustRead Documents The following link provides documents related to ESP32. ESP32 Datasheet This document provides an introduction to the specifications of the ESP32 hardware, including overview, pin definitions, functional description, peripheral interface, electrical characteristics, etc. ESP32 ECO V3 User Guide This document describes differences between V3 and previous ESP32 silicon wafer revisions. ECO and Workarounds for Bugs in ESP32 This document details hardware errata and workarounds in the ESP32. It hosts extensive documentation for ESP-IDF ranging from hardware guides to API reference. The manual provides detailed information on how to use the ESP32 memory and peripherals. ESP-IDF Programming Guide ESP32 Technical Reference Manual ESP32 Hardware Resources The zip files include the schematics, PCB layout, Gerber and BOM list of ESP32 modules and development ESP32 Hardware Design Guidelines The guidelines outline recommended design practices when developing standalone or add-on systems based on the ESP32 series of products, including the ESP32 chip, the ESP32 modules and development boards. boards. This document introduces the ESP32 AT commands, explains how to use them, and provides examples of ESP32 AT Instruction Set and Examples several common AT commands. Espressif Products Ordering Information 3.2 MustHave Resources Here are the ESP32-related must-have resources. ESP32 BBS ESP32 GitHub ESP32 Tools Certification and Test. This is an Engineer-to-Engineer (E2E) Community for ESP32 where you can post questions, share knowledge, explore ideas, and help solve problems with fellow engineers. ESP32 development projects are freely distributed under Espressifs MIT license on GitHub. It is established to help developers get started with ESP32 and foster innovation and the growth of general knowledge about the hardware and software surrounding ESP32 devices. This is a webpage where users can download ESP32 Flash Download Tools and the zip file ESP32 Espressif Systems 14 ESP32-MINI-1 User Manual (Preliminary v0.1) 3 Learning Resources ESP-IDF ESP32 Resources This webpage links users to the official IoT development framework for ESP32. This webpage provides the links to all available ESP32 documents, SDK and tools. Espressif Systems 15 ESP32-MINI-1 User Manual (Preliminary v0.1) Revision History Revision History Date Version Release notes 2021-01-14 V0.1 Preliminary release Espressif Systems 16 ESP32-MINI-1 User Manual (Preliminary v0.1) Disclaimer and Copyright Notice Information in this document, including URL references, is subject to change without notice. ALL THIRD PARTYS INFORMATION IN THIS DOCUMENT IS PROVIDED AS IS WITH NO WARRANTIES TO ITS AUTHENTICITY AND ACCURACY. NO WARRANTY IS PROVIDED TO THIS DOCUMENT FOR ITS MERCHANTABILITY, NON-
INFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, NOR DOES ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. All liability, including liability for infringement of any proprietary rights, relating to use of information in this document is disclaimed. No licenses express or implied, by estoppel or otherwise, to any intellectual property rights are granted herein. The Wi-Fi Alliance Member logo is a trademark of the Wi-Fi Alliance. The Bluetooth logo is a registered trademark of Bluetooth SIG. www.espressif.com All trade names, trademarks and registered trademarks mentioned in this document are property of their respective owners, and are hereby acknowledged. Copyright 2021 Espressif Systems (Shanghai) Co., Ltd. All rights reserved.