The ESP32-S2-MINI-1 and ESP32-S2-MINI-1U are powerful, generic Wi-Fi MCU modules designed for a wide range of applications, from low-power sensor networks to demanding tasks like voice encoding, music streaming, and MP3 decoding. This user manual provides guidance on setting up the basic software development environment for these modules.
Function Description
These modules serve as the core for Wi-Fi enabled applications, leveraging the ESP-IDF (Espressif IoT Development Framework) for software development. They integrate a Wi-Fi MCU, offering a comprehensive solution for various IoT and embedded systems. The modules support a wide array of peripherals, enabling flexible integration with different sensors and external components.
Important Technical Specifications
- Wi-Fi Protocols: The modules adhere to the 802.11 b/g/n Wi-Fi standards.
- Operating Frequency Range: They operate within the 2412 MHz to 2484 MHz frequency band.
- Peripherals: A rich set of peripherals is available, including:
- GPIO (General Purpose Input/Output)
- SPI (Serial Peripheral Interface)
- LCD (Liquid Crystal Display) interface
- UART (Universal Asynchronous Receiver/Transmitter)
- I2C (Inter-Integrated Circuit)
- I2S (Integrated Interchip Sound)
- Camera interface
- IR (Infrared)
- Pulse counter
- LED PWM (Pulse Width Modulation)
- USB OTG 1.1 (On-The-Go)
- ADC (Analog-to-Digital Converter)
- DAC (Digital-to-Analog Converter)
- Touch sensor
- Temperature sensor
- Operating Voltage: The modules operate within a voltage range of 3.0 V to 3.6 V.
- Operating Current:
- TX (Transmit): 120 ~ 190 mA
- RX (Receive): 63 ~ 68 mA
- Power Supply: A minimum power supply of 500 mA is recommended.
- Operating Temperature: The modules are designed to operate in a wide temperature range from -40 °C to 85 °C.
- Storage Temperature: For storage, the temperature range is -40 °C to 150 °C.
- Dimensions: The physical dimensions of the module (with shielding box) are (18.00±0.10) mm x (31.00±0.10) mm x (3.30±0.10) mm.
- Pin Configuration: Both ESP32-S2-MINI-1 and ESP32-S2-MINI-1U modules have 65 pins. Key pins include:
- GND (Pins 1, 2, 30, 42, 43, 46-65): Ground.
- 3V3 (Pin 3): Power supply.
- IO0 (Pin 4): RTC_GPIO0, GPIO0. Internally logic high. Shorting IO0 to GND via a jumper is required during download mode.
- IO1 (Pin 5): RTC_GPIO1, GPIO1, TOUCH1, ADC1_CH0.
- IO2 (Pin 6): RTC_GPIO2, GPIO2, TOUCH2, ADC1_CH1.
- IO3 (Pin 7): RTC_GPIO3, GPIO3, TOUCH3, ADC1_CH2.
- IO4 (Pin 8): RTC_GPIO4, GPIO4, TOUCH4, ADC1_CH3.
- IO5 (Pin 9): RTC_GPIO5, GPIO5, TOUCH5, ADC1_CH4.
- IO6 (Pin 10): RTC_GPIO6, GPIO6, TOUCH6, ADC1_CH5.
- IO7 (Pin 11): RTC_GPIO7, GPIO7, TOUCH7, ADC1_CH6.
- IO8 (Pin 12): RTC_GPIO8, GPIO8, TOUCH8, ADC1_CH7.
- IO9 (Pin 13): RTC_GPIO9, GPIO9, TOUCH9, ADC1_CH8, FSPIHD.
- IO10 (Pin 14): RTC_GPIO10, GPIO10, TOUCH10, ADC1_CH9, FSPICSO, FSPIIO4.
- IO11 (Pin 15): RTC_GPIO11, GPIO11, TOUCH11, ADC2_CH0, FSPID, FSPIIO5.
- IO12 (Pin 16): RTC_GPIO12, GPIO12, TOUCH12, ADC2_CH1, FSPICLK, FSPIIO6.
- IO13 (Pin 17): RTC_GPIO13, GPIO13, TOUCH13, ADC2_CH2, FSPIQ, FSPIIO7.
- IO14 (Pin 18): RTC_GPIO14, GPIO14, TOUCH14, ADC2_CH3, FSPIWP, FSPIDQS.
- IO15 (Pin 19): RTC_GPIO15, GPIO15, U0RTS, ADC2_CH4, XTAL_32K_P.
- IO16 (Pin 20): RTC_GPIO16, GPIO16, U0CTS, ADC2_CH5, XTAL_32K_N.
- IO17 (Pin 21): RTC_GPIO17, GPIO17, U1TXD, ADC2_CH6, DAC_1.
- IO18 (Pin 22): RTC_GPIO18, GPIO18, U1RXD, ADC2_CH7, DAC_2, CLK_OUT3.
- IO19 (Pin 23): RTC_GPIO19, GPIO19, U1RTS, ADC2_CH8, CLK_OUT2, USB_D-.
- IO20 (Pin 24): RTC_GPIO20, GPIO20, U1CTS, ADC2_CH9, CLK_OUT1, USB_D+.
- IO21 (Pin 25): RTC_GPIO21, GPIO21.
- IO26 (Pin 26): SPICS1, GPIO26.
- NC (Pin 27): Not connected.
- IO33 (Pin 28): SPIIO4, GPIO33, FSPIHD.
- IO34 (Pin 29): SPIIO5, GPIO34, FSPICSO.
- IO35 (Pin 31): SPIIO6, GPIO35, FSPID.
- IO36 (Pin 32): SPIIO7, GPIO36, FSPICLK.
- IO37 (Pin 33): SPIDQS, GPIO37, FSPIQ.
- IO38 (Pin 34): GPIO38, FSPIWP.
- IO39 (Pin 35): MTCK, GPIO39, CLK_OUT3.
- IO40 (Pin 36): MTDO, GPIO40, CLK_OUT2.
- IO41 (Pin 37): MTDI, GPIO41, CLK_OUT1.
- IO42 (Pin 38): MTMS, GPIO42.
- TXD0 (Pin 39): U0TXD, GPIO43, CLK_OUT1.
- RXD0 (Pin 40): U0RXD, GPIO44, CLK_OUT2.
- IO45 (Pin 41): GPIO45.
- IO46 (Pin 44): GPIO46.
- EN (Pin 45): Chip enable. High: on, enables the chip. Low: off, the chip powers off. It's important not to leave the EN pin floating.
Usage Features
The modules are designed for ease of development using the ESP-IDF framework, supporting Windows, Linux, and macOS operating systems.
- Hardware Preparation:
- Requires an Espressif RF testing board, a USB-TTL serial module, a PC (Windows 7 recommended), and a Micro-USB cable.
- Connection involves attaching the ESP32-S2-MINI-1/1U to the RF testing board, then connecting the USB-TTL serial module to the RF board via TXD, RXD, and GND, and finally connecting the USB-TTL module to the PC.
- Power is supplied to the RF testing board via a Micro-USB cable from the PC or a power adapter.
- Firmware Download:
- During download, IO0 must be shorted to GND via a jumper.
- Firmware is flashed using the ESP32-S2 DOWNLOAD TOOL.
- After download, the jumper on IO0 and GND must be removed.
- Powering up the RF testing board again will switch the module to working mode, and it will read programs from flash upon initialization.
- Software Development Environment Setup:
- Toolchain Installation: The user needs to install the compiler, debugger, Python packages, and other tools.
- Windows: Download the precompiled toolchain and MSYS2 zip from Espressif's website. Run
C:\msys32\mingw32.exe to open an MSYS2 terminal and create a directory ~/esp for the toolchain.
- Linux: Install prerequisites (gcc, git, wget, make, ncurses-devel, flex, bison, gperf, python pyserial, python-pyelftools) using package managers (yum for CentOS, apt-get for Ubuntu/Debian, pacman for Arch). Download and unzip the appropriate 64-bit or 32-bit Linux toolchain to
~/esp. Add the toolchain's bin directory to the PATH environment variable in ~/.profile.
- macOS: Install
pip using sudo easy_install pip. Download and unzip the macOS toolchain to ~/esp. Add the toolchain's bin directory to the PATH environment variable in ~/.profile.
- ESP-IDF Installation: Clone the ESP-IDF repository from GitHub using
git clone --recursive -b feature/esp32s2beta https://github.com/espressif/esp-idf.git. The --recursive option is crucial for downloading all submodules.
- IDF_PATH Configuration: Add the ESP-IDF directory to the user's profile as an environment variable
IDF_PATH to ensure persistence across system restarts. For Windows, this is done via "Edit Environment Variables". For Linux and macOS, it involves adding export IDF_PATH=~/esp/esp-idf and export PATH="$IDF_PATH/tools:$PATH" to ~/.profile.
- Serial Connection:
- Connect the ESP32 board to the PC via USB. Install necessary device drivers (CP210x USB to UART Bridge VCP Drivers or FTDI Virtual COM Port Drivers) if they don't install automatically.
- Windows: Verify the COM port in Device Manager by disconnecting and reconnecting the ESP32 board.
- Linux/macOS: Identify the serial port device name by running
ls /dev/tty* (Linux) or ls /dev/cu.* (macOS) before and after plugging in the board.
- Linux User Permissions: Add the current user to the
dialout group (or uucp for Arch Linux) using sudo usermod -a -G dialout $USER to grant read/write access to the serial port. Re-login is required.
- Verification: Use a serial terminal program like PuTTY (available for Windows and Linux) to verify the serial connection. Set parameters to baud rate = 115200, data bits = 8, stop bits = 1, and parity = N.
- Configuration: Navigate to the
hello_world example directory and run idf.py -DIDF_TARGET=esp32s2beta menuconfig to configure the project.
- Build and Flash:
- Build the application, bootloader, partition table, and binaries by running
idf.py build.
- Flash the built binaries onto the ESP32-S2 board using
idf.py -p PORT [-b BAUD] flash, replacing PORT with the serial port name and optionally BAUD with the desired baud rate (default is 460800).
- IDF Monitor: After flashing, launch the IDF monitor with
idf.py -p PORT monitor to view startup logs and application output, such as "Hello world!". Exit the monitor using Ctrl+].
Maintenance Features
- Documentation Updates: Espressif provides email notifications for changes to technical documentation. Users can subscribe to stay updated.
- Certification Downloads: Certificates for Espressif products can be downloaded from their website.
- Toolchain Updates: When ESP-IDF is updated, new toolchains or environment requirements may arise. The manual provides instructions for migrating data from an old MSYS2 environment to a new one on Windows, ensuring compatibility.
- Troubleshooting Serial Connection: The manual addresses common issues like "Failed to open port /dev/ttyUSB0" on Linux by guiding users to add themselves to the
dialout group. It also notes that for some serial port wiring configurations, RTS & DTR pins might need to be disabled in the terminal program for the ESP32-S2 to boot correctly.
- Crystal Frequency Mismatch: If the IDF monitor shows random garbage after upload, it suggests a possible mismatch in crystal frequency (e.g., board using 26MHz while ESP-IDF defaults to 40MHz), which might require configuration adjustments.