ESP32 User Guide Version 0.
About This Guide This guide describes the software, firmware environment and development recommendations required to build an application around the ESP32 development board with build-in ESP32 chip. Note: l a This guide is only for SDK Verison 1.0.0. Refer to the “ESP32 System Description” for more details on the ESP32 development board. This document is structured as follows: Chapter Title Chapter 1 Introduction it n Subject Introduces the ESP32 and software and hardware required.
Table of Contents 1. Introduction ...............................................................................................................................................4 1.1. ESP32 .......................................................................................................................................................................4 1.2. Requirements ....................................................................................................................................
1. Introduction 1. Introduction 1.1. ESP32 ESP32 provides a Wi-Fi solution in the 2.4GHz band by using 40nm technology. It delivers highly integrated Wi-Fi SoC solution to meet the continuous demands for efficient power usage, compact design and reliable performance. l a You can use ESP32 series hardware and software provided by Espressif to develop and program some useful Wi-Fi and wearable electronics applications and products in Internet of Things(IoT) industry. it 1.2.
1. Introduction 1.2.2. Software Development Platform ESP32 RTOS SDK is a development platform provided for the users to develop their project. • For the latest version, go to Download ESP32 RTOS SDK in Github. • For the package components, refer to Figure 1-2.
1. Introduction Serial Terminal Tool We recommend using Minicom as a serial terminal tool to show the communication information and debug code. Uploading Tool We recommend using Python 2.6 or 2.7 and esptool_ESP32.py to upload firmware to the flash. • For the latest version of Python, go to Download Python. • esptool_ESP32.py file is in the ESP32 RTOS SDK > tools folder, refer to Figure 1-2. l a Package Components. • For the details of instructions, refer to 2.5.2 Uploading Files.
2. Getting Started 2. Getting Started 2.1. Getting Started to Use SDK 2.1.1. l a Process Overview Start Building toolchain n e it Building firmware d fi Uploading firmware 2.1.2. n o C Configuring firmware End Figure 2-1. Process Overview Building Toolchain We suggest to choose Crosstool-ng as the compiler toolchain. Follow the instructions below to install Crosstool-ng. Note: Your PC needs to connect to the Internet. 1. Update the system. sudo apt-get update Espressif 2015.
2. Getting Started 2. Install the required toolchain packages. sudo apt-get install git autoconf build-essential gperf bison flex texinfo libtool libncurses5-dev wget gawk libc6 python-serial libexpat-dev 2 upgraded, 37 newly installed, 0 to remove and 395 not upgraded. Need to get 10.4 MB of archives. After this operation, 48.7 MB of additional disk space will be used. Do you want to continue? [Y/n] l a y Setting up texinfo (5.2.0.dfsg.1-2) ... it Setting up libwww-perl (6.05-2) ...
2. Getting Started 6. Install toolchain. cd crosstool-NG/ ./bootstrap && ./configure --prefix=`pwd` && make && make install For auto-completion, do not forget to install 'ct-ng.comp' into your bash completion directory (usually /etc/bash_completion.d) username:/opt/Espressif/crosstool-NG$ ./ct-ng xtensa-esp108-elf l a *********************************************************** WARNING! This sample may enable experimental features.
2. Getting Started Note: You need to do Step 6 every time you open a new shell, or you can put it inside your .bashrc file. 🔚 2.1.3. Building Firmware 1. Create a directory to store a new project. mkdir ~/Workspace l a cd ~/Workspace 2. Download the latest ESP32 RTOS SDK. it git clone https://github.com/espressif/ESP32_RTOS_SDK.git Notes: n e 1. For the package components of the SDK, refer to “1.3 Package Components”. 2.
2. Getting Started Note: If your project is successfully compiled, the irom1.bin, irom0_flash.bin, and user.ota files will be generated in /Workspace/ESP32_BIN directory. Current contents of /Workspace/ESP32_BIN directory is shown as Table2-1. Table 2-1. ESP32_BIN Directory Files File Name 2.1.4. Description blank.bin • Provided with the SDK. • Used to initialize the system parameters. boot.bin • Provided with the SDK. • Main program. irom1.bin • Generated from compiling. • Main program.
2. Getting Started The configuration items are shown in Table 2-2. Table 2-2. Configuration Items of Minicom Item Value Bps/Par/Bits 115200 8N1 Hardware Flow Control No Software Flow Control No 7. l a Upload files. >python esptool_ESP32.py -p dev/tty8 -b 115200 write_flash -ff 40m fm qio -fs 2m it 0x0 ~/Workspace/ESP32_BIN/boot.bin 0x04000 ~/Workspace/ESP32_BIN/irom1.bin 0x40000 ~/Workspace/ESP32_BIN/bin/irom0_flash.bin n e 0xFC000 ~/Workspace/ESP32_BIN/blank.
2. Getting Started Item Value SPI Speed Set the SPI speed of the uploading. The default value is 40 MHz. SPI Mode Set the SPI speed of the uploading. The default value is QIO. Flash Size The size of your flash, We use 2Mbit flash in this example. The flash size of 1MB, 2MB, 4MB, 8MB, 16MB and 32MB are supported. Start Address Set the start addresses of the bin files. The start address of blank.bin and esp_init_data_default.bin may be different when you use a different flash size.
2. Getting Started Result The flash layout is shown as Figure 2-3. esp_init_data_default.bin 16K 240K 3840K boot.bin irom1.bin 4K irom0_flash.bin 4K 4K 4K blank.bin l a System Parameter Available segment it Figure 2-3. Flash Layout For the flash usage, refer to Table 2-5. n e Table 2-5. Flash Usage Segment Name 2.1.5.
2. Getting Started op -S -o wmode Parameter Table 2-6. op Command Parameter Parameter Description -Q Query Wi-Fi mode. -S Set Wi-Fi mode. l a There are 3 Wi-Fi modes: • mode = 1: STA mode • mode = 2: AP mode • mode = 3: STA+AP mode wmode 2.2.2. sta it n e Description sta commands are used to scan the STA network interface, connect or disconnect AP, and query the connecting status of STA network interface.
2. Getting Started 2.2.3. ap Description ap commands are used to set the parameter of AP network interface. Example ap -S [-s ssid] [-p password] [-t encrypt] [-n channel] [-h] [-m max_sta] ap –Q l a ap –L Parameter it Table 2-8. ap Command Parameter Parameter Description -S Set AP mode. -s ssid -p password Set AP password. -t encrypt Set AP encrypt mode. -h Hide ssid. d fi -m max_sta Set AP max connections. -Q Show AP parameters. -L 2.2.4. n e Set AP ssid.
2. Getting Started 2.2.5. dhcp Description dhcp commands are used to enable or disable dhcp server/client. Example dchp -S [-o mode] dhcp -E [-o mode] dhcp -Q [-o mode] l a Parameter Table 2-10. dhcp Command Parameter Parameter -S Start DHCP (Client/Server). -E End DHCP (Client/Server). -Q show DHCP status. n e • mode = 1 : DHCP client of STA interface. • mode = 2 : DHCP server of AP interface. • mode = 3 : both. -o mode 2.2.6.
2. Getting Started 2.2.7. reboot Description reboot command is used to reboot the board. Example reboot 2.2.8. ram l a ram command is used to query the size of the remaining heap in the system. Example ram it n e d fi n o C Espressif 2015.
Appendix - Notices Appendix - Notices I. Federal Communications Commission (FCC) Declaration of Conformity This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation.
The OEM or final integrator must ensure that FCC labeling requirements are met. This includes an additional label on the outside of the final product housing with the following contents: Company Name Model:ESP32 FCC ID:2AC7Z-ESP32 This device complies with part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation.