adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.12k stars 1.22k forks source link

Turn off Espressif bootloader messages? #7056

Open dhalbert opened 2 years ago

dhalbert commented 2 years ago

At least some Espressif boards print out bootloader startup info on hard reset. We can turn this off, but I wasn't sure if it had been turned on deliberately at some point.

I am not sure if it confuses Thonny sometimes. Thonny sometimes crashes hard the first time I try to connect to an ESP32 board.

It does help you see that the board is boot-looping if it resets before CircuitPython prints anything.

@MicroDev1 @UnexpectedMaker and anyone else -- do you have an opinion?

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, 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:12756
ho 0 tail 12 room 4
load:0x40080400,len:3024
entry 0x400805dc
microdev1 commented 1 year ago

Those logs are likely coming from the boot rom and there behavior is controlled by permanent setting of eFuse bit(s). From: https://docs.espressif.com/projects/esp-idf/en/v5.0/esp32s2/api-reference/kconfig.html#config-boot-rom-log-scheme

CONFIG_BOOT_ROM_LOG_SCHEME Permanently change Boot ROM output

Found in: Boot ROM Behavior

Controls the Boot ROM log behavior. The rom log behavior can only be changed for once, specific eFuse bit(s) will be burned at app boot stage.

Available options: Always Log (BOOT_ROM_LOG_ALWAYS_ON)

Always print ROM logs, this is the default behavior.

Permanently disable logging (BOOT_ROM_LOG_ALWAYS_OFF)

Don’t print ROM logs.

Log on GPIO High (BOOT_ROM_LOG_ON_GPIO_HIGH)

Print ROM logs when GPIO level is high during start up. The GPIO number is chip dependent, e.g. on ESP32-S2, the control GPIO is GPIO46.

Log on GPIO Low (BOOT_ROM_LOG_ON_GPIO_LOW)

Print ROM logs when GPIO level is low during start up. The GPIO number is chip dependent, e.g. on ESP32-S2, the control GPIO is GPIO46.