Debugging ESP8266EX

Debugging ESP8266EX

One way of debugging what’s running on the ESP is using the UART console. But there is a trick – it might be locked at 74880 baudrate.

There’s a quick fix. Modify the user_main.c and add:

#include "driver/uart_register.h"

on top of it.

Also, in the main loop(user_init) change

void user_init(void){
os_printf("SDK version:%d.%d.%d\n" SDK_VERSION_MAJOR, SDK_VERSION_MINOR, SDK_VERSION_REVISION);

with:

void user_init(void){
uart_div_modify(0, 115200);
SET_PERI_REG_MASK(UART_CONF0(0), UART_RXFIFO_RST | UART_TXFIFO_RST);
CLEAR_PERI_REG_MASK(UART_CONF0(0), UART_RXFIFO_RST | UART_TXFIFO_RST);
os_printf("set baudrate to 115200\n\r");

Modify the 115200 with the value you want to use, but we suggest using some standard ones, like 38400, 57600 and 115200.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *