From 2859a9b24ae882593bd7124adf573f4a24598974 Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Wed, 24 Jun 2026 15:49:47 +0200 Subject: [PATCH] docs(sleep): Update light-sleep USB wake-up source --- .../soc/esp32p4/include/soc/Kconfig.soc_caps.in | 4 ++-- components/soc/esp32p4/include/soc/soc_caps.h | 2 +- .../soc/esp32s31/include/soc/Kconfig.soc_caps.in | 4 ++-- components/soc/esp32s31/include/soc/soc_caps.h | 2 +- docs/en/api-reference/system/sleep_modes.rst | 15 +++++++++++++++ docs/zh_CN/api-reference/system/sleep_modes.rst | 15 +++++++++++++++ 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in index 7d98a99699f..a79897368c0 100644 --- a/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32p4/include/soc/Kconfig.soc_caps.in @@ -1164,8 +1164,8 @@ config SOC_USB_UTMI_PHY_NUM default 1 config SOC_PM_SUPPORT_USB_WAKEUP - int - default 1 + bool + default y config SOC_PARLIO_TX_UNIT_MAX_DATA_WIDTH int diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index c4662f38251..d291d16232b 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -429,7 +429,7 @@ // USB PHY Caps #define SOC_USB_UTMI_PHY_NUM (1U) -#define SOC_PM_SUPPORT_USB_WAKEUP (1U) +#define SOC_PM_SUPPORT_USB_WAKEUP 1 /*-------------------------- PARLIO CAPS --------------------------------------*/ #define SOC_PARLIO_TX_UNIT_MAX_DATA_WIDTH 16 /*!< Number of data lines of the TX unit */ diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 859d988ab56..5b7f26e9c00 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -392,8 +392,8 @@ config SOC_USB_UTMI_PHY_NUM default 1 config SOC_PM_SUPPORT_USB_WAKEUP - int - default 1 + bool + default y config SOC_PHY_SUPPORTED bool diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index 14829dee032..2eaa4a8e255 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -129,7 +129,7 @@ #define SOC_USB_OTG_PERIPH_NUM (1U) #define SOC_USB_FSLS_PHY_NUM (0U) #define SOC_USB_UTMI_PHY_NUM (1U) -#define SOC_PM_SUPPORT_USB_WAKEUP (1U) +#define SOC_PM_SUPPORT_USB_WAKEUP 1 #define SOC_PHY_SUPPORTED 1 #define SOC_WIFI_SUPPORTED 1 diff --git a/docs/en/api-reference/system/sleep_modes.rst b/docs/en/api-reference/system/sleep_modes.rst index 09102817046..6cd6cac07b9 100644 --- a/docs/en/api-reference/system/sleep_modes.rst +++ b/docs/en/api-reference/system/sleep_modes.rst @@ -284,6 +284,21 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi :cpp:func:`esp_sleep_enable_ulp_wakeup` function can be used to enable this wakeup source. +.. only:: SOC_PM_SUPPORT_USB_WAKEUP + + USB Wakeup (Light-sleep Only) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + {IDF_TARGET_NAME} can wake up from Light-sleep when activity is detected on the USB 2.0 High-Speed OTG bus. This wakeup source is intended for USB device applications that enter Light-sleep while the USB host has suspended the bus, and wake up when the host resumes the bus. + + This wakeup source is available only on USB-OTG capable targets with High-Speed USB support. It is not supported by USB Serial/JTAG peripherals. + + The power domain for the high-speed connectivity peripherals (``ESP_PD_DOMAIN_CNNT``) must remain powered on during sleep. Use :cpp:func:`esp_sleep_pd_config` to configure this:: + + esp_sleep_pd_config(ESP_PD_DOMAIN_CNNT, ESP_PD_OPTION_ON); + + :cpp:func:`esp_sleep_enable_usb_wakeup` function can be used to enable this wakeup source. + .. only:: SOC_RTCIO_WAKE_SUPPORTED GPIO Wakeup from Light-sleep diff --git a/docs/zh_CN/api-reference/system/sleep_modes.rst b/docs/zh_CN/api-reference/system/sleep_modes.rst index 45fe0f00ee4..b94895a9f3f 100644 --- a/docs/zh_CN/api-reference/system/sleep_modes.rst +++ b/docs/zh_CN/api-reference/system/sleep_modes.rst @@ -284,6 +284,21 @@ RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒 可调用 :cpp:func:`esp_sleep_enable_ulp_wakeup` 函数来启用此唤醒源。 +.. only:: SOC_PM_SUPPORT_USB_WAKEUP + + USB 唤醒(仅限 Light-sleep 模式) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + 当检测到 USB 2.0 高速 OTG 总线有活动时,{IDF_TARGET_NAME} 从 Light-sleep 模式中唤醒。该唤醒源适用于这样的 USB 设备应用:当 USB 主机将总线挂起时进入 Light-sleep 模式,在主机恢复总线时唤醒。 + + 该唤醒源仅在具备 USB-OTG 功能且支持高速 USB 的目标芯片上可用。USB Serial/JTAG 外设不支持该功能。 + + 休眠期间,高速连接类外设的电源域(``ESP_PD_DOMAIN_CNNT``)必须保持上电。可以使用 :cpp:func:`esp_sleep_pd_config` 函数进行配置:: + + esp_sleep_pd_config(ESP_PD_DOMAIN_CNNT, ESP_PD_OPTION_ON); + + 可以使用 :cpp:func:`esp_sleep_enable_usb_wakeup` 函数来启用该唤醒源。 + .. only:: SOC_RTCIO_WAKE_SUPPORTED Light-sleep 模式下的 GPIO 唤醒