Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent sleep sub change broke the booloader for builds using the 8MD256 as RTC clock source (IDFGH-13745) #14608

Open
3 tasks done
KaeLL opened this issue Sep 19, 2024 · 1 comment
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@KaeLL
Copy link
Contributor

KaeLL commented Sep 19, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4-dev-3089-g81f4ef73c3

Espressif SoC revision.

ESP32-D0WD-V3 (revision v3.0)

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

ESP-WROVER-KIT V4.1

Power Supply used.

USB

What is the expected behavior?

To work.

What is the actual behavior?

This

assert(s_sleep_sub_mode_ref_cnt[mode] >= 0);

gets triggered after the first restart

Steps to reproduce.

Apparently, all it's needed is to enable CONFIG_RTC_CLK_SRC_INT_8MD256, build and flash an app that just esp_restart()s at least once, and it should break at the beginning of the 2nd boot cycle.

Debug Logs.

assert failed: esp_sleep_sub_mode_config sleep_modes.c:2187 (s_sleep_sub_mode_ref_cnt[mode] >= 0)

0x400817a1: panic_abort at /esp-idf/components/esp_system/panic.c:454
0x40090889: esp_system_abort at /esp-idf/components/esp_system/port/esp_system_chip.c:92
0x40096ba9: __assert_func at /esp-idf/components/newlib/assert.c:80
0x400d67eb: esp_sleep_sub_mode_config at /esp-idf/components/esp_hw_support/sleep_modes.c:2186 (discriminator 1)
0x4008ed9d: rtc_clk_slow_src_set at /esp-idf/components/esp_hw_support/port/esp32/rtc_clk.c:283
0x400d41e4: select_rtc_slow_clk at /esp-idf/components/esp_system/port/soc/esp32/clk.c:93
0x400d429d: esp_clk_init at /esp-idf/components/esp_system/port/soc/esp32/clk.c:156
0x40081397: call_start_cpu0 at /esp-idf/components/esp_system/port/cpu_start.c:730

More Information.

Merge eab9876 brought the regression.

defconfig
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration
#
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_BOOTLOADER_LOG_COLORS=n
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_ota_encrypted.csv"
CONFIG_PARTITION_TABLE_OFFSET=0xC000
CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=n
CONFIG_COMPILER_HIDE_PATHS_MACROS=n
CONFIG_COMPILER_RT_LIB_GCCLIB=y
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
CONFIG_BT_NIMBLE_MAX_BONDS=1
CONFIG_BT_NIMBLE_MAX_CCCDS=0
CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="AR"
CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=517
CONFIG_BT_NIMBLE_MSYS_1_BLOCK_SIZE=512
CONFIG_BT_NIMBLE_MSYS_2_BLOCK_SIZE=512
CONFIG_BT_NIMBLE_TRANSPORT_ACL_SIZE=512
CONFIG_BT_NIMBLE_TRANSPORT_EVT_COUNT=40
CONFIG_BT_NIMBLE_HS_FLOW_CTRL=n
CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=y
CONFIG_BT_NIMBLE_WHITELIST_SIZE=1
CONFIG_BT_NIMBLE_BLE_GATT_BLOB_TRANSFER=y
CONFIG_BT_NIMBLE_HIGH_DUTY_ADV_ITVL=y
CONFIG_BT_HCI_LOG_DEBUG_EN=y
CONFIG_BT_HCI_LOG_DATA_BUFFER_SIZE=8
CONFIG_BT_HCI_LOG_ADV_BUFFER_SIZE=10
CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE=y
CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS=y
CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=n
CONFIG_SPI_MASTER_ISR_IN_IRAM=n
CONFIG_SPI_SLAVE_ISR_IN_IRAM=n
CONFIG_ETH_USE_ESP32_EMAC=n
CONFIG_ETH_USE_SPI_ETHERNET=n
CONFIG_ESP_EVENT_POST_FROM_ISR=n
CONFIG_ESP_GDBSTUB_MAX_TASKS=16
CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH=y
CONFIG_HTTPD_MAX_REQ_HDR_LEN=2048
CONFIG_HTTPD_LOG_PURGE_DATA=y
CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP=y
CONFIG_ESP32_REV_MIN_1=y
CONFIG_RTC_CLK_SRC_INT_8MD256=y
CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y
CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=n
CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=n
CONFIG_ESP_PHY_RF_CAL_FULL=y
CONFIG_ESP_PHY_PLL_TRACK_DEBUG=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=10240
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
CONFIG_ESP_CONSOLE_UART_BAUDRATE=2000000
CONFIG_ESP_INT_WDT_TIMEOUT_MS=30
CONFIG_ESP_TASK_WDT_PANIC=y
CONFIG_ESP_TASK_WDT_TIMEOUT_S=3
CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y
CONFIG_ESP_IPC_TASK_STACK_SIZE=2048
CONFIG_ESP_TIMER_INTERRUPT_LEVEL=3
CONFIG_ESP_WIFI_NVS_ENABLED=n
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=n
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=n
CONFIG_ESP_WIFI_GMAC_SUPPORT=n
CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=n
CONFIG_FREERTOS_UNICORE=y
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=n
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=n
CONFIG_FREERTOS_ISR_STACKSIZE=2096
CONFIG_FREERTOS_CORETIMER_1=y
CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM=y
CONFIG_LWIP_IPV6=n
CONFIG_LWIP_SNTP_MAX_SERVERS=2
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y
CONFIG_MBEDTLS_PLATFORM_TIME_ALT=y
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=y
CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=n
CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED=y
CONFIG_MQTT_REPORT_DELETED_MESSAGES=y
CONFIG_NVS_ASSERT_ERROR_CHECK=y
CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE=y
CONFIG_WS_TRANSPORT=n
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
@KaeLL KaeLL added the Type: Bug bugs in IDF label Sep 19, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 19, 2024
@github-actions github-actions bot changed the title Recent sleep sub change broke the booloader for builds using the 8MD256 as RTC clock source Recent sleep sub change broke the booloader for builds using the 8MD256 as RTC clock source (IDFGH-13745) Sep 19, 2024
@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new Status: In Progress Work is in progress labels Sep 24, 2024
@esp-wzh
Copy link
Collaborator

esp-wzh commented Oct 21, 2024

Fixed in commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants