ESP-WROOM-02D User Guide Version 1.
About This Guide This document takes ESP-WROOM-02D as examples to introduce how to use the ESP8266 SDK. The contents include preparations before compilation, SDK compilation and firmware download. Release Notes Date 2017.11 Version V1.0 Release notes First release.
Table of Contents 1. ESP-WROOM-02D Overview ................................................................................................ 1 2. ESP-WROOM-02D Pin Description....................................................................................... 2 3. Hardware Preparation for Compiling ESP-WROOM-02D ....................................................4 3.1. Hardware Preparation ................................................................................................................
1. ESP-WROOM-02D Overview " 1. ESP-WROOM-02D Overview The ESP-WROOM-02D is a new ESP8266EX-based module developed by Espressif. It differs from the ESP-WROOM-02 in that it is compatible both with 150-mil and 208-mil flash (with 150-mil flash embedded by default). The ESP-WROOM-02D also features optimized antenna and RF performance. 📖 Note: For more information on ESP8266EX, please refer to ESP8266EX Datasheet. Table 1-1.
2. ESP-WROOM-02D Pin Description " 2. ESP-WROOM-02D Pin Description Figure 2-1 shows the pin distribution of the ESP-WROOM-02D. PCB ANTENNA 1 3V3 GND 18 2 EN IO16 17 3 IO14 TOUT 16 4 IO12 RST 15 5 IO13 IO5 14 6 IO15 GND 13 7 IO2 TXD 12 8 IO0 RXD 11 9 GND IO4 10 19 GND " Figure 2-1. ESP-WROOM-02D Pin Layout ESP-WROOM-02D has 18 pins. Please see the pin definitions in Table 2-1. Table 2-1. ESP-WROOM-02D Pin Definitions No. Pin Name Functional Description 3.
2. ESP-WROOM-02D Pin Description " No. Pin Name 7 IO2 8 IO0 Functional Description GPIO2; UART1_TXD Floating (internal pull-up) or pull up. GPIO0 • UART download: pull down. • Flash boot: floating or pull up. Espressif 9 GND GND 10 IO4 GPIO4 11 RXD 12 TXD 13 GND GND 14 IO5 GPIO5 15 RST Reset 16 TOUT It can be used to test the power-supply voltage of VDD3P3 (Pin3 and Pin4) and the input power voltage of TOUT (Pin6). These two functions cannot be used simultaneously.
3. Hardware Preparation for Compiling ESP-WROOM-02D " 3. Hardware Preparation for Compiling ESP-WROOM-02D 3.1. Hardware Preparation • ESP-WROOM-02D module • USB-to-TTL converter (FT232R recommended) • PC for programming: Windows XP or Windows 7 OS is recommended, with enough RAM to run a Linux virtual machine. • Micro-USB cable 3.2. Hardware Connection 1. Lead out the pins of the ESP-WROOM-02D, as shown in Table 2-2. Table 2-2. ESP-WROOM-02D Pins Pin Pin status EN Pull up 3V3 3.
3. Hardware Preparation for Compiling ESP-WROOM-02D " Figure 2-1. ESP-WROOM-02D Download Mode 3. Connect the USB-to-TTL converter to the PC. 4. Download firmware to flash with the ESP8266 DOWNLOAD TOOL. 📖 Note: On how to download firmware, please refer to Chapter 4, "Flash Maps" and Chapter 6, "Downloading the Firmware". 5. After downloading, switch ESP-WROOM-02U to working mode. Set IO0 as floating or pull-up. 6. Power on ESP-LAUNCHER again and the chip will read and run programs from the flash.
4. Software Preparation for Compiling ESP-WROOM-02D " 4. Software Preparation for Compiling ESP-WROOM-02D Users can download the non-OS SDK (including application examples) from: http://www.espressif.com/en/support/download/sdks-demos? keys=&field_type_tid%5B%5D=14. Figure 3-1 shows the directory structure of the non-OS SDK. " Figure 3-1. Non-OS SDK Directory Structure • bin: compiled binaries to be downloaded directly into the flash. • documents: SDK-related documents or links.
4. Software Preparation for Compiling ESP-WROOM-02D " • ESP8266_IOT_PLATFORM https://github.com/espressif/ESP8266_IOT_PLATFORM Table 3-2 shows the directory structure of the RTOS SDK. " Figure 3-2. RTOS SDK Directory Structure • bin: boot and initialization firmware. • documents: ESP8266_RTOS_SDK files. • driver_lib: sample codes of drivers. • examples: sample codes for Espressif’s application programs. - openssl_demo: sample codes of the openssl API function.
4. Software Preparation for Compiling ESP-WROOM-02D " 4.2. ESP8266 Toolkit 4.2.1. Compiler Please download VirtualBox from: https://www.virtualbox.org/wiki/Downloads. 📖 Note: Please choose the right version of VirtualBox according to the host machine's OS. Please download the compiler ESP8266_lubuntu_20141021.ova from: http://downloads.espressif.com/FB/ESP8266_GCC.zip Steps Results 1. Start Windows OS and install the virtual machine. • Double-click VirtualBox-5.0.16-105871-Win.
4. Software Preparation for Compiling ESP-WROOM-02D " Steps Results • Select File > Import Appliance, and a dialog box will show up 👉 . • Select the image file to import, for example, C: \ESP8266_lubuntu_20141021.ova, and click Next. • Click Import to confirm the settings. 3. Create a shared folder. • Create a new folder named D: \VM\share. • Select Machine > Settings > Shared Folders…, and a dialog box will show up 👉 . • Select the shared folder in Machine Folders, for example, D:\VM\share. 4.
4. Software Preparation for Compiling ESP-WROOM-02D " Steps Results • After importing, a virtual machine named ESP8266_lubuntu shows up 👉. • Double-click ESP8266_lubuntu or Start to run the virtual machine. • The system shows the ESP8266 virtual machine 👉 . • If a dialog box like the one below👇 shows up, please enter the password: espressif. " 4.2.2. Firmware Download Tool Please download the ESP8266 DOWNLOAD TOOL from: http://www.espressif.com/support/download/other-tools.
5. Compiling the SDK " 5. Compiling the SDK 5.1. Preparations 1. Modifying SDK Files 📖 Note: Users need to modify the SDK files if using the OTA firmware. 1. Start Windows OS. 2. Modify files in ESP8266_NONOS_SDK/examples/IoT_Demo/include according to the flash map. • Modify #define PRIV_PARAM_START_SEC in user_light.h and user_plug.h. " • Modify #define ESP_PARAM_START_SEC in user_esp_platform.h. " Table 5-1 lists the modified values. Table 5-1.
5. Compiling the SDK " 3. Copy the files to be compiled to the shared folder. Steps Results • Copy ESP8266_NONOS_SDK folder to the shared directory, for example, C:\VM\share. • Copy IoT_Demo folder to C: \VM\share\ESP8266_NONOS_SDK, as shown in the figure on the right 👉 . 4. Download shared directory. Steps Results • Execute ./mount.sh. • Input the password: espressif. Downloading shared files is completed.
5. Compiling the SDK " 5.2. Compilation 5.2.1. Compile ESP8266_NONOS_SDK_v0.9.5 and Later Versions 2. Switch to the /Share/ESP8266_NONOS_SDK/IoT_Demo directory in the terminal. cd /home/esp8266/Share/ESP8266_NONOS_SDK/IoT_Demo ./gen_misc.sh The system shows the following information: gen_misc.sh version 20150511 Please follow below steps(1-5) to generate specific bin(s): 3. Select the required options as shown in Figure 5-1.
5. Compiling the SDK " 📖 Notes: • The sample options are marked in green. Users can select the right options as needed. • For OTA and non-OTA firmware, please refer to Section 1.4, "ESP8266 FW". • Only sdk_v1.1.0 + boot 1.4 + flash download tool_v1.2 and higher versions support options 5 and 6 in Step 5. • After compiling user1.bin, execute make clean first to clear the temporary files generated by the last compilation, and then compile user2.bin.
6. Downloading the Firmware " 6. Downloading the Firmware 6.1. Download Procedure 1. Start Windows OS. 2. Double-click ESP_DOWNLOAD_TOOL.exe to open Flash tool. Figure 6-1. ESP8266 DOWNLOAD TOOL—SPIDownload SPIDownload HSPIDownload RFConfig MutiDownload Espressif For SPI Flash download. For HSPI Flash download. RF initialization Configuration. For multi-mother boards download. " /" 23 15 2017.
6. Downloading the Firmware " 3. Double-click " in Download Path Config panel to select the binaries to be downloaded. Set the corresponding download addresses in ADDR. 4. Configure SPIDownload. 📖 Note: The binaries to be downloaded and the corresponding addresses vary with different SPI Flash sizes and actual demands. For details, please refer to Chapter 4, "Flash Maps". Table 6-1.
6. Downloading the Firmware " Items Description SPI FLASH CONFIG BAUDRATE Select the baud rate of downloading. The default value is 115200. 5. After downloading, turn GPIO0 Control on ESP-LAUNCHER to the outer side and power the board on to enable the working mode. 6.2. Check Log File After downloading firmware, users can check the log printed in the terminal by using the serial port debug tool. Users need to configure the settings of the serial port debug tool, as follows: Table 6-2.
6. Downloading the Firmware " add if0 add if1 dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1) bcn 100 finish 6.2.2. ESP8266 AT If users download the ESP8266 AT firmware, or the default firmware in ESP-LAUNCHER or ESP-WROOM-02U, the system in working mode will display “Ready” at the end. Input command “AT” in the terminal and the system will return “OK”, which means that the firmware works properly.
6. Downloading the Firmware " ! Figure 6-2. ESP8266 DOWNLOAD TOOL - RF InitConfig 6.3.1. Configuration of RF InitConfig Options RF InitConfig options are listed in the upper part of Figure 6-2. Please refer to Table 6-3 for a description of this configuration. Table 6-3. Configuration of RF InitConfig Options Items TxTargetPowerConfig Description Users need not configure this. It varies with the options in LowPowerMode. Configure the low power mode as required.
6. Downloading the Firmware " Items Description Configure the TOUT pin according to the actual TOUT pin status. We recommend the default value. • TOUT_ADC_EN: When the TOUT pin connects to an external circuit, measure the external voltage (0V - 1V) through the internal ADC. TOUT PinConf • TOUT_VDD_EN: When TOUT pin is left floating, measure VDD33 voltage through uint16 system_get_vdd33(void). ⚠ Notice: • Users cannot configure TOUT_ADC_EN and TOUT_VDD_EN at the same time.
6. Downloading the Firmware " The following section introduces how to modify the 112 ~ 114 byte parameters. Figure 6-3 shows the initial configuration. ! Figure 6-3. 112 ~ 114 Byte Parameters Modify the RF Initialization Parameters Byte 114 is used to control THE RF initialization when ESP8266 is powered on. Table 6-5 provides the parameter configuration. 📖 Note: Supported by ESP8266_NONOS_SDK_V1.5.3 and ESP8266_RTOS_SDK_V1.3.0 and higher. Table 6-5.
6. Downloading the Firmware " Option Description The default value of byte 112 is 0. When value = 0, it means that the bbpll is 168 M. Both positive and negative frequency offsets can be corrected. bit 1 However, this may effect the digital peripheral performance and, therefore, it is not recommended. When value = 1, it means that the bbpll is 160 M. Only the positive frequency offset can be corrected.
6. Downloading the Firmware " 4. Applications, such as smart lights, work at a wide temperature range of -40 °C to 125 °C, and need to track and correct the frequency offset automatically. The frequency offset at ambient temperature is large, so the initial offset correction value is needed. • If the frequency offset is +160 kHz (at ambient temperature), users can set byte 112 = 0x0B, byte 113 = (256 - 160/8) = 236 = 0xEC.
Disclaimer and Copyright Notice Information in this document, including URL references, is subject to change without notice. THIS DOCUMENT IS PROVIDED AS IS WITH NO WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY, NON-INFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR 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.
FCC Label: The FCC ID is on the front of the device. It is easily visible. The device FCC ID is 2AC7Z‐ESPWROOM02D. A label with the following statements must be attached to the host end product: This device contains FCC ID: 2AC7Z‐ESPWROOM02D. The manual provides guidance to the host manufacturer will be included in the documentation that will be provided to the OEM. The module is limited to installation in mobile or fixed applications.
FCC RF Exposure Requirements This device complies with FCC RF radiation exposure limits set forth for an uncontrolled enviroment. The antenna(s) used for this transmitter must not be co‐located or operating in conjunction with any other antenna or transmitter and must be installed to provide a separation distance of at least 20cm from all persons. FCC Regulations This device complies with part 15 of the FCC Rules.
Canada Regulations: This device complies with Industry Canada’s licence-exempt RSSs. Operation is subject to the following two conditions: (1) This device may not cause interference; and (2) This device must accept any interference, including interference that may cause undesired operation of the device. Le présentappareilestconforme aux CNR d’Industrie Canada applicables aux appareils radio exempts de licence.
A label with the following statements must be attached to the host end product: This device contains IC: 21098‐ESPWROOM02D. The manual provides guidance to the host manufacturer will be included in the documentation that will be provided to the OEM. The module is limited to installation in mobile or fixed applications. The separate approval is required for all other operating configurations, including portable configurations and different antenna configurations.