
1. 修改默认的日志输出串口 UART0 为 UART1
使用 ESP8266 UART1(GPIO2)作为程序日志输出串口,可进行如下配置:
menuconfig -> Component Config -> Common ESP-related- Channel for console output -> Custom UART
- UART peripheral to use for console output(0-1) -> UART1

2. 开启 UART0 串口交换配置
可基于 ESP8266_RTOS_SDK/examples/peripherals/uart_events 例程来测试,在 menuconfig 中开启如下设置:
Component config -> Common ESP-related -> Swap UART0 I/O pins

或者在 uart_driver_install() 函数之后调用 uart_enable_swap() 函数

总结:
- 将通过 GPIO1 和 GPIO3 打印芯片上电启动日志(一级 bootloader)
- 将通过 UART1(GPIO2)打印 二级 bootloader & 程序运行日志
- 将通过 UART0(GPIO13 和 GPIO15)与主机 MCU 进行 UART 通信。





















![[附源码]java毕业设计学生实习管理系统](https://img-blog.csdnimg.cn/edf3c20609fb469cacbaa9d3dc92af42.png)

