ESP8266 基础篇: 启动时 rst cause 和 boot mode

简介

ESP8266 启动时, ROM CODE 会读取 GPIO 状态和 rst cause 状态, 进而决定 ESP8266 工作模式.
通过了解和掌握 rst causeboot mode, 有助于定位某些系统问题.

ROM CODE 波特率为 74880.

ESP8266 启动时 rst cause

ESP8266 启动时会有如下打印:

ets Jan 8 2013, rst cause:1, boot mode:(5,7)

其中 rst cause 说明如下:

枚举定义 意义
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 /

Notes:
软件 WDT 重启或者软件复位都会维持上次重启状态. 比如第一次是电源重启, rst cause 为 1, 软件复位后 rst cause 仍然为 1.


ESP8266 上电 boot mode

ESP8266 上电时会判断 boot strapping 管脚的状态, 并决定 boot mode.
例如上电打印:

ets Jan 8 2013,rst cause:1, boot mode:(3,2)

其中 boot mode 说明如下:

  • 第一个值代表当前 boot 模式
  • 第二个值代表 SDIO/UART 判断

boot modestrapping 管脚的 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
4-7 [1,0,0], [1,0,1], [1,1,0], [1,1,1] 非 2 SDIO 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

boot mode 4~7 为 SDIO 的不同的协议标准, 包括低速 (lowspeed) 和高速 (highspeed), 版本号(V1, V2)等, 但并非所有 MCU 都会同时支持这些标准。

发布了57 篇原创文章 · 获赞 76 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/espressif/article/details/102646468