Skip to content

Conversation

@SukuWc
Copy link
Member

@SukuWc SukuWc commented Jan 31, 2026

Problem

Setting CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH=y in sdkconfig triggers an ESP-IDF bug
(espressif/esp-idf#12894) that crashes on boot if the eFuse
was previously burned. The IDF startup code only handles ESP_ERR_NOT_SUPPORTED but not ESP_ERR_INVALID_STATE,
which is returned when the eFuse is already set.

The bug was reportedly fixed in commit 53682ed, but the fix never made it to the main branch.

Solution

  • Remove CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH from sdkconfig (use default ALWAYS_ON)
  • Call esp_efuse_set_rom_log_scheme() directly in firmware with proper error handling
  • Remove the patch_esp_efuse_startup.sh Docker patch

Changes

  • grid_esp/main/grid_esp32.c - Add grid_esp32_setup_rom_log_scheme()
  • grid_esp/main/grid_esp32.h - Add function declaration
  • grid_esp/main/grid_fw.c - Call function early in app_main()
  • grid_esp/sdkconfig - Set CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y
  • Dockerfile - Remove eFuse patch
  • Delete patch_esp_efuse_startup.sh

Testing with fresh boards

  • Rebuild the docker image
  • First boot on fresh chip (eFuse not yet burned)
  • Subsequent boots (eFuse already burned to GPIO_HIGH)
  • Verify ROM logs are suppressed after first boot

Testing with known incorrectly configured boards

  • Rebuild the docker image
  • Boot on board with eFuse burned incorrectly to GPIO_LOW
  • Verify that board boots with the current firmware build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants