Disable boot debug log ESP32

Hi. I disabled all log messages (and it works), however it still prints the boot debug log. Does anyone know what to do to disable log messages completely?

Code :

#include <esp32-hal-log.h>
[...]
esp_log_level_set("*", ESP_LOG_NONE);

Output :

rst:0x1 (POWERON_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:2
load:0x3fff0030,len:1184
load:0x40078000,len:13104
load:0x40080400,len:3036
entry 0x400805e4

That’s the bootloader. The output is generated before the very first of your firmware is even executed. So by the principle of time travel not being possible, your firmware code can’t affect the output before it.

Of course, Espressif has an option to disable bootloader output, but that is by pulling / strapping GPIO15 low at boot, e.g. by using a strong pull-down resistor (like 1K) or a direct connection to GND, depending on what else you have connected to GPIO15.

https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/boot-mode-selection.html#other-pins

Thus, this topic is also a duplicate of

If you are using the ESP-IDF framework (and not the Arduino framework), you can configure the bootloader log level using menuconfig (Section Bootloader config).

Thanks!
I just have one more question. I’m new to embedded system so this might sound silly, but it’s been over a month since I first started working with an ESP32. Until a few days ago, it never displayed any bootloader messages, and ever since I erased the NVRAM with this command : pio run -t erase , it displays the bootloader. Is it simply a coincidence or did the command enable something ?

NVRAM is NVS, which is a separate flash partition. The bootloader is also a flash partition. Could it be that the bootloader was replaced for the first time when you run pio run -t erase? (The bootloader log level is compiled into the bootloader.)

1 Like

That might explain why it started happening. Thanks!