ESP8266 Platform This component contains platform-specific options for the ESP8266 platform. # Example configuration entry esp8266: board: nodemcuv2 framework: version: recommended Configuration variables:
https://github.com/esp8266/Arduino,
note this may break at any time
https://github.com/esp8266/Arduino/releases,
even if it hasn’t been recommended yet.
| GPIO0 | Controls Boot Mode |
|---|---|
| GPIO1 | UART TX pin |
| GPIO2 | Controls Boot Mode |
| GPIO3 | UART RX pin |
| GPIO6 | SDIO/Flash CLK pin |
| GPIO7 | SDIO/Flash Data 0 pin |
| GPIO8 | SDIO/Flash Data 1 pin |
| GPIO9 | SDIO/Flash Data 2 pin (qio/qout only) |
| GPIO10 | SDIO/Flash Data 3 pin (qio/qout only) |
| GPIO11 | SDIO/Flash CMD pin |
| GPIO12 | Attached to Hardware SPI controller MISO |
| GPIO13 | Attached to Hardware SPI controller MOSI |
| GPIO14 | Attached to Hardware SPI controller CLK |
| GPIO15 | Controls Boot Mode; Attached to Hardware SPI controller CS |
| GPIO16 | Special pin that can be accessed from RTC, and is Deep-Sleep wakeup pin |
| TOUT aka GPIO17 | ADC pin for measuring voltages, can only be used as analog input pin |
| Pin | Restrictions | State after Reset |
|---|---|---|
| GPIO0 | If HIGH on boot | Weak Pull Up |
| GPIO2 | If HIGH on boot | Weak Pull Up |
| GPIO4 | High Impedance | |
| GPIO5 | High Impedance | |
| GPIO6 | Weak Pull Up | |
| GPIO12 | Weak Pull Up | |
| GPIO13 | Weak Pull Up | |
| GPIO14 | Weak Pull Up | |
| GPIO15 | If LOW on boot | Weak Pull Up |
| GPIO16 | Has pull-down (but no pull-up) resistor | Weak Pull Down |
| Mode | GPIO0 | GPIO2 | GPIO15 | boot mode: |
|---|---|---|---|---|
| Boot from Flash (normal) | HIGH | HIGH | LOW | 3 |
| Download Code from UART | LOW | HIGH | LOW | 1 |
| Boot from SD-Card | ANY | ANY | HIGH | 4-7 |
| 0 | Undefined |
| 1 | Power On Reboot |
| 2 | External reset or deep-sleep wakeup |
| 4 | Hardware WDT reset |
| Parameter | Min. | Typical | Max. | Unit |
|---|---|---|---|---|
| Operating Temperature | -40 | 125 | °C | |
| Working Voltage V_IO | 2.5 | 3.3 | 3.6 | V |
| V_IL - INPUT voltage level to be considered LOW | -0.3 | 0.25*V_IO | V | |
| V_IH - INPUT voltage level to be considered HIGH | 0.75*V_IO | 3.6 | V | |
| V_OL - OUTPUT voltage level for LOW | 0.1*V_IO | V | ||
| V_OH - OUTPUT voltage level for HIGH | 0.8*V_IO | V | ||
| I_MAX - Maximum current for GPIO | 12 | mA | ||
| Power Consumption in Deep Sleep | 20 | µA | ||
| Power Consumption in Active Mode | 120 | mA |
1. Reset Causes
1.1. Identifying Reset Cause in ROM Code
Each time ESP8266 reboots, the ROM code will print out a number corresponding to the reset cause, as the following figure shows. You can verify the cause of the reset based on the number. Use this as a debugging method when you cannot start the user program and need to analyze the cause of the reset. The following table shows reset causes printed in ROM code. Table 1-1. Identifying Reset Cause in ROM Code
| Rst cause No. | Cause |
|---|---|
| 0 | Undefined |
| 1 | Power reboot |
| 2 | External reset or wake-up from Deep-sleep |
| 4 | Hardware WDT reset |
| Rst cause No. | Cause | GPIO state |
|---|---|---|
| 0 | Power reboot | Changed |
| 1 | Hardware WDT reset | Changed |
| 2 | Fatal exception | Unchanged |
| 3 | Software watchdog reset | Unchanged |
| 4 | Software reset | Unchanged |
| 5 | Deep-sleep | Changed |
| 6 | Hardware reset | Changed |
| Fatal exception No. | Description | Possible Causes |
|---|---|---|
| 0 | Invalid command | 1. Damaged BIN binaries
2. Wild pointers |
| 6 | Division by zero | Division by zero |
| 9 | Unaligned read/write operation addresses | 1. Unaligned read/write Cache addresses
2. Wild pointers |
| 28/29 | Access to invalid address | 1. Access to Cache after it is turned off
2. Wild pointers |