feat(openthread): add sleep debug message

This commit is contained in:
Xu Si Yu 2023-07-21 14:49:50 +08:00
parent 5f51dcc686
commit 753f74cb99
5 changed files with 20 additions and 0 deletions

View File

@ -164,6 +164,12 @@ menu "Hardware Settings"
only for code quality inspection. Enabling it will increase the time overhead of entering
and exiting sleep. It is not recommended to enable it in the release version.
config ESP_SLEEP_DEBUG
bool "esp sleep debug"
default n
help
Enable esp sleep debug.
endmenu
menu "ESP_SLEEP_WORKAROUND"

View File

@ -579,6 +579,14 @@ static esp_err_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags, esp_sleep_mode_t m
bool deep_sleep = (mode == ESP_SLEEP_MODE_DEEP_SLEEP);
bool should_skip_sleep = false;
#if CONFIG_ESP_SLEEP_DEBUG
// The following three logs are used to confirm whether the digital domain and modem are powered off.
// Some CI tests depend on these three logs and it is best not to modify them.
ESP_EARLY_LOGD(TAG, "pd_lags %lu", pd_flags);
ESP_EARLY_LOGD(TAG, "PMU_SLEEP_PD_TOP: %s", (pd_flags & PMU_SLEEP_PD_TOP) ? "True":"False");
ESP_EARLY_LOGD(TAG, "PMU_SLEEP_PD_MODEM: %s", (pd_flags & PMU_SLEEP_PD_MODEM) ? "True":"False");
#endif
int64_t sleep_duration = (int64_t) s_config.sleep_duration - (int64_t) s_config.sleep_time_adjustment;
#if SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256

View File

@ -2,3 +2,5 @@ CONFIG_IDF_TARGET="esp32c6"
CONFIG_IDF_TARGET_ESP32C6=y
CONFIG_OPENTHREAD_NETWORK_CHANNEL=12
CONFIG_OPENTHREAD_NETWORK_MASTERKEY="aabbccddeeff00112233445566778899"
CONFIG_ESP_SLEEP_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y

View File

@ -2,3 +2,5 @@ CONFIG_IDF_TARGET="esp32h2"
CONFIG_IDF_TARGET_ESP32H2=y
CONFIG_OPENTHREAD_NETWORK_CHANNEL=12
CONFIG_OPENTHREAD_NETWORK_MASTERKEY="aabbccddeeff00112233445566778899"
CONFIG_ESP_SLEEP_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y

View File

@ -576,6 +576,8 @@ def test_ot_sleepy_device(dut: Tuple[IdfDut, IdfDut]) -> None:
ocf.clean_buffer(sleepy_device)
sleepy_device.serial.hard_reset()
sleepy_device.expect('detached -> child', timeout=20)
sleepy_device.expect('PMU_SLEEP_PD_TOP: True', timeout=10)
sleepy_device.expect('PMU_SLEEP_PD_MODEM: True', timeout=20)
ocf.clean_buffer(sleepy_device)
output = sleepy_device.expect(pexpect.TIMEOUT, timeout=5)
assert 'rst:' not in str(output) and 'boot:' not in str(output)