※This article is based on ESP8266_RTOS_SDK 3.0
ESP8266 启动时会有如下打印:
ets Jan 8 2013, rst cause:1, boot mode:(5,7)
值 | 枚举定义 | 意义 |
0 | NO_MEAN | 无意义 |
1 | VBAT_REST | 上电复位(电源重启) |
2 | EXT_SYS_RESET | 外部复位 (deep-sleep 醒来) |
3 | SW_RESET | 软件复位 |
4 | WDT_RESET | 硬件看门狗复位 |
5 | DEEPSLEEP_TIMER_RESET | / |
6 | DEEPSLEEP_POWER_ON_RESET | / |
注意:
软件 WDT 重启或者软件复位都会维持上次重启状态. 比如第一次是电源重启, rst cause 为 1, 软件复位后 rst cause 仍然为 1.
boot mode 由 strapping 管脚的 3 位值 [GPIO15, GPIO0, GPIO2] 共同决定. 如下表所示:
boot mode | Strapping 管脚的 3 位值[GPIO15, GPIO0, GPIO2] | SDIO/UART 判断 | 意义 |
0 | [0, 0, 0] | / | remap boot |
1 | [0, 0, 1] | / | UART boot |
2 | [0, 1, 0] | / | jump boot |
3 | [0, 1, 1] | / | fast flash boot |
4 | [1, 0, 0] | 2 | SDIO lowspeed V1 UART boot |
5 | [1, 0, 1] | 2 | SDIO lowspeed v2 uart boot |
6 | [1, 1, 0] | 2 | SDIO highspeed v1 uart boot |
7 | [1, 1, 1] | 2 | SDIO highspeed v2 uart boot |
4-7 | [1,0,0], [1,0,1], [1,1,0], [1,1,1] | 非 2 | SDIO boot |
boot mode 4~7 为 SDIO 的不同的协议标准, 包括低速 (lowspeed) 和高速 (highspeed), 版本号(V1, V2)等, 但并非所有 MCU 都会同时支持这些标准。
コメント: