ESP32: Prevent from sending serial output at startup

Hello all,

I’m not sure how this is called what I’m searching for…
Everytime my ESP32 is starting up, it is sending something like this with 115200 baud:

ets Jun  8 2016 00:22:57

rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

Is there any possibility to tell the ESP32 NOT to send anything at startup?

I’m running also some kind of communication protocol with my PC on the same serial/USB/RX0/TX0 interface but with 9600 baud and the startup codes with 115200 baud are messing up everything…

The boot messages printed by the ROM bootloader can be suppressed by connecting GPIO15 to GND during boot.

1 Like

First of all: The first few messages are output from the bootloader. That is burned into the mask-ROM of the ESP32 and is literally unchangable. But, the Espressif people have thought of that and made the code that is burned in there react to the voltage of a GPIO pin.

As you can read in Suppress Boot messages - ESP32 Forum

Bootstrapping GPIO15 to ground will also disable initial output from the ROM bootloader.

There might be other messages that is from the ESP-IDF bootloader, but you should try that first. If there’s still output, you need to buid ESP-IDF from source and find the flags / defines that make it not output anything. There is a PlatformIO example available for building ESP-IDF from source in an Arduino firmware. Bootloader code and related is at esp-idf/components/bootloader at release/v4.1 · espressif/esp-idf · GitHub.

The other way would be to initially discard all the output received by the computer until a certain “START” marker is received (that is e.g. sent multiple times or with some delay at the start). Or, changing the communication baudrate to 115200 would help too.

@saibot83: Are you using the Arduino framework for ESP32 or the ESP-IDF framework?

Thanks a lot, yes this is working. However, wasting one of the rare IOs for that is not so cool

I’m using the Arduino framework

You can connect it to ground using a resistor and then still use it as an output pin after boot.

2 Likes

I connected it over a 10K resistor to GND and also use this D15 Pin as 25KHz PWM Output for FAN control and it is working :slight_smile:

Thank you all!

1 Like

im late but can i ask, i tried to connect the gpio 15 to the gnd, there are no data will be shown on the serial beign 115200, here is my code: void setup() {
Serial.begin(115200);
}

void loop() {
if (Serial.available()) {
String receivedData = Serial.readStringUntil(‘\n’);
Serial.println("Received data: " + receivedData);
// Add your confirmation logic here
}
}

I am using ESP-IDF in PlatformIO and want to disable boot messages from being sent over any of the UARTs.

  1. I don’t have a GPIO15 available to pull low at boot. I am using a Seeed Studio XAIO ESP32-C3.
  2. I tried menuconfig to turn off boot logging. Has no effect. PlatformIO has its own build approach.
  3. I tried defining build_flags in my platformio.ini file as follows but it causes compiler warnings about redefining settings in sdkconfig.h:

build_flags = -DCONFIG_LOG_BOOTLOADER_LEVEL_NONE

  1. I tried using a sdkconfig.defaults file with the setting “CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y” but it doesn’t seem to work.

I see the suggestion of building my own custom framework but that seems heavy handed and others have mentioned I should be able to simple define some build flags.

Ideas? I’m new to this stuff, so don’t assume I know much.