Merge branch 'docs/update_bluetooth_power_save_readme' into 'master'

Docs: update bluetooth power save readme

Closes FCS-1258

See merge request espressif/esp-idf!24562
This commit is contained in:
Xiong Wei Chao 2023-07-17 12:14:39 +08:00
commit 12d6268095
3 changed files with 25 additions and 12 deletions

View File

@ -38,6 +38,8 @@ In Deep-sleep mode, the CPUs, most of the RAM, and all digital peripherals that
In Deep-sleep and Light-sleep modes, the wireless peripherals are powered down. Before entering Deep-sleep or Light-sleep modes, the application must disable Wi-Fi and Bluetooth using the appropriate calls (i.e., :cpp:func:`esp_bluedroid_disable`, :cpp:func:`esp_bt_controller_disable`, :cpp:func:`esp_wifi_stop`). Wi-Fi and Bluetooth connections will not be maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.
If Wi-Fi/Bluetooth connections need to be maintained, enable Wi-Fi/Bluetooth Modem-sleep mode and automatic Light-sleep feature (see :doc:`Power Management APIs <power_management>`). This will allow the system to wake up from sleep automatically when required by the Wi-Fi/Bluetooth driver, thereby maintaining the connection.
.. only:: not SOC_BT_SUPPORTED
Wi-Fi and Sleep Modes
@ -45,7 +47,7 @@ In Deep-sleep mode, the CPUs, most of the RAM, and all digital peripherals that
In Deep-sleep and Light-sleep modes, the wireless peripherals are powered down. Before entering Deep-sleep or Light-sleep modes, applications must disable Wi-Fi using the appropriate calls (:cpp:func:`esp_wifi_stop`). Wi-Fi connections will not be maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.
If Wi-Fi connections need to be maintained, enable Wi-Fi Modem-sleep mode and automatic Light-sleep feature (see :doc:`Power Management APIs <power_management>`). This will allow the system to wake up from sleep automatically when required by the Wi-Fi driver, thereby maintaining a connection to the AP.
If Wi-Fi connections need to be maintained, enable Wi-Fi Modem-sleep mode and automatic Light-sleep feature (see :doc:`Power Management APIs <power_management>`). This will allow the system to wake up from sleep automatically when required by the Wi-Fi driver, thereby maintaining a connection to the AP.
.. _api-reference-wakeup-source:
@ -290,7 +292,11 @@ Application Example
-------------------
- :example:`protocols/sntp`: the implementation of basic functionality of Deep-sleep, where ESP module is periodically waken up to retrieve time from NTP server.
- :example:`wifi/power_save`: the implementation of modem sleep example.
- :example:`wifi/power_save`: the implementation of Wi-Fi Modem-sleep example.
.. only:: SOC_BT_SUPPORTED
- :example:`bluetooth/nimble/power_save`: the implementation of Bluetooth Modem-sleep example.
.. only:: SOC_ULP_SUPPORTED

View File

@ -38,6 +38,8 @@
在 Light-sleep 和 Deep-sleep 模式下,无线外设会被断电。因此,在进入这两种睡眠模式前,应用程序必须调用恰当的函数(:cpp:func:`esp_bluedroid_disable`:cpp:func:`esp_bt_controller_disable`:cpp:func:`esp_wifi_stop`)来禁用 Wi-Fi 和 Bluetooth。在 Light-sleep 或 Deep-sleep 模式下,即使不调用这些函数也无法连接 Wi-Fi 和 Bluetooth。
如需保持 Wi-Fi 和 Bluetooth 连接,请启用 Wi-Fi 和 Bluetooth Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`。在这两种模式下Wi-Fi 和 Bluetooth 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持连接。
.. only:: not SOC_BT_SUPPORTED
睡眠模式下的 Wi-Fi 功能
@ -45,7 +47,7 @@
在 Light-sleep 和 Deep-sleep 模式下,无线外设会被断电。因此,在进入这两种睡眠模式前,应用程序必须调用恰当的函数 (:cpp:func:`esp_wifi_stop`) 来禁用 Wi-Fi。在 Light-sleep 或 Deep-sleep 模式下,即使不调用此函数也无法连接 Wi-Fi。
如需保持 Wi-Fi 连接,请启用 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`。在这两种模式下Wi-Fi 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持与 AP 的连接。
如需保持 Wi-Fi 连接,请启用 Wi-Fi Modem-sleep 模式和自动 Light-sleep 模式(请参阅 :doc:`电源管理 API <power_management>`。在这两种模式下Wi-Fi 驱动程序发出请求时,系统将自动从睡眠中被唤醒,从而保持与 AP 的连接。
.. _api-reference-wakeup-source:
@ -293,7 +295,11 @@ UART 输出处理
-------------------
- :example:`protocols/sntp`:如何实现 Deep-sleep 模式的基本功能,周期性唤醒 ESP 模块,以从 NTP 服务器获取时间。
- :example:`wifi/power_save`:如何实现 Modem-sleep 模式。
- :example:`wifi/power_save`:如何实现 Wi-Fi Modem-sleep 模式。
.. only:: SOC_BT_SUPPORTED
- :example:`bluetooth/nimble/power_save`:如何实现 Bluetooth Modem-sleep 模式。
.. only:: SOC_ULP_SUPPORTED

View File

@ -8,8 +8,9 @@ This example is based on the [bleprph](../bleprph) example to show how to use th
If the modem sleep mode is enabled, bluetooth will switch periodically between active and sleep.
In sleep state, RF, PHY and BB are turned off in order to reduce power consumption.
For more information about sleep modes, please refer to [Sleep Modes](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/sleep_modes.html).
This example contains five build configurations. For each configuration, a few configuration options are set:
This example contains some build configurations. For each configuration, a few configuration options are set:
- `sdkconfig.defaults.esp32`: ESP32 uses 32kHz XTAL as low power clock in light sleep enabled.
- `sdkconfig.defaults.esp32c3`: ESP32C3 uses 32kHz XTAL as low power clock in light sleep enabled.
- `sdkconfig.40m.esp32c3`: ESP32C3 uses main XTAL as low power clock in light sleep enabled.
@ -18,7 +19,7 @@ This example contains five build configurations. For each configuration, a few c
- `sdkconfig.defaults.esp32s3`: ESP32S3 uses 32kHz XTAL as low power clock in light sleep enabled.
- `sdkconfig.40m.esp32s3`: ESP32S3 uses main XTAL as low power clock in light sleep enabled.
- `sdkconfig.defaults.esp32h2`: ESP32H2 uses 32kHz XTAL as low power clock in light sleep enabled.
- `sdkconfig.40m.esp32h2`: ESP32H2 uses main XTAL as low power clock in light sleep enabled.
- `sdkconfig.32m.esp32h2`: ESP32H2 uses main XTAL as low power clock in light sleep enabled.
## How to use example
### Hardware Required
@ -40,7 +41,7 @@ idf.py menuconfig
- `(1000) configTICK_RATE_HZ`
- `[*] configUSE_TICKLESS_IDLE`
- `(3) configEXPECTED_IDLE_TIME_BEFORE_SLEEP`
#### For Chip ESP32/ESP32-C3/ESP32-S3:
#### For Chip ESP32/ESP32-C3/ESP32-S3
4. Enable power down MAC and baseband:
- `Component config > PHY > [*] Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled`
@ -59,14 +60,14 @@ idf.py menuconfig
- `Component config > Bluetooth > Controller Options`
- `[*] Enable BLE sleep`
5. Configure bluetooth low power clock:
- `Component config → Bluetooth → Controller Options → BLE low power clock source`
- `Component config > Bluetooth > Controller Options > BLE low power clock source`
- Use main XTAL as low power clock source during light sleep:
- `(X) Use main XTAL as RTC clock source`
- Use RTC clock source as low power clock sourceduring light sleep:
- `(X) Use system RTC slow clock source`
6. Power down flash during light sleep:
* `Component config → Hardware Settings → Sleep Config`
* `[*] Power down flash in light sleep when there is no SPIRAM`
- `Component config > Hardware Settings > Sleep Config`
- `[*] Power down flash in light sleep when there is no SPIRAM`
### Build and Flash
@ -128,8 +129,8 @@ I (463) NimBLE:
| ESP32C3 | 262 mA | 12 mA | 2.3 mA | 140 uA |
| ESP32S3 | 240 mA | 17.9 mA | 3.3 mA | 230 uA |
| ESP32C6 | 240 mA | 22 mA | 3.3 mA | 34 uA |
| ESP32H2 | 82 mA | 16.0 mA | 4.0 mA | 24 uA |
X: This feature is currently not supported.
| ESP32H2 | 82 mA | 16.0 mA | 4.0 mA | 24 uA |
X: This feature is currently not supported.
## Example Breakdown