Skip to content

Commit d1f4a0c

Browse files
committed
Merge branch 'docs/ble_add_low_power_intro_v5.5' into 'release/v5.5'
Added BLE Low Power Mode Introduction (v5.5) See merge request espressif/esp-idf!42995
2 parents 8410210 + eec06b4 commit d1f4a0c

File tree

14 files changed

+300
-9
lines changed

14 files changed

+300
-9
lines changed

docs/conf_common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
'api-guides/ble/get-started/ble-connection.rst',
4040
'api-guides/ble/get-started/ble-data-exchange.rst',
4141
'api-guides/ble/smp.rst',
42+
'api-guides/low-power-mode/low-power-mode-ble.rst',
4243
'api-reference/bluetooth/bt_le.rst',
4344
'api-reference/bluetooth/esp_gap_ble.rst',
4445
'api-reference/bluetooth/esp_gatt_defs.rst',

docs/en/api-guides/ble/ble-feature-support-status.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ If none of our chip series meet your needs, please contact `customer support tea
407407
please consult `SIG Bluetooth Product Database <https://qualification.bluetooth.com/Listings/Search>`__.
408408
409409
For certain features, if the majority of the development is completed on the Controller, the Host's support status will be limited by the Controller's support status.
410-
If you want BLE Controller and Host to run on different Espressif chips, the functionality of the Host will not be limited by the Controller's support status on the chip running the Host,
410+
If you want Bluetooth LE Controller and Host to run on different Espressif chips, the functionality of the Host will not be limited by the Controller's support status on the chip running the Host,
411411
please check the :doc:`ESP Host Feature Support Status Table <host-feature-support-status>` .
412412

413413
It is important to clarify that this document is not a binding commitment to our customers.

docs/en/api-guides/ble/get-started/ble-data-exchange.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ If you have not completed the ESP-IDF development environment setup, please refe
296296
Try It Out
297297
^^^^^^^^^^^^^^^^^^
298298

299-
Please refer to :ref:`BLE Introduction Try It Out <nimble_gatt_server_practice>`
299+
Please refer to :ref:`Bluetooth LE Introduction Try It Out <nimble_gatt_server_practice>`.
300300

301301

302302
Code Explanation

docs/en/api-guides/ble/host-feature-support-status.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ESP Host Major Feature Support Status
66
:link_to_translation:`zh_CN:[中文]`
77

88
The table below shows the support status of major features on ESP-Bluedroid and ESP-NimBLE Host.
9-
If you plan to run the BLE Controller and Host on {IDF_TARGET_NAME} together, the functionality of the Host may be limited by the support status of the Controller,
9+
If you plan to run the Bluetooth LE Controller and Host on {IDF_TARGET_NAME} together, the functionality of the Host may be limited by the support status of the Controller,
1010
please check the :doc:`{IDF_TARGET_NAME} Major Feature Support Status Table <ble-feature-support-status>` .
1111

1212
|supported_def| **This feature has completed development and internal testing.** [1]_

docs/en/api-guides/ble/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Overview
1313
overview
1414
ble-feature-support-status
1515
ble-qualification
16+
Low Power Mode Introduction <../low-power-mode/low-power-mode-ble>
1617

1718
***************
1819
Get Started

docs/en/api-guides/low-power-mode/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ The standby power consumption plays an important role in embedded IoT applicatio
1313

1414
low-power-mode-soc
1515
:SOC_WIFI_SUPPORTED: low-power-mode-wifi
16+
:SOC_BLE_SUPPORTED: low-power-mode-ble
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
Introduction to Low Power Mode in Bluetooth\ :sup:`®` Low Energy Scenarios
2+
================================================================================
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
This section introduces clock source selection in low power modes for Bluetooth Low Energy (Bluetooth LE), along with common related issues.
7+
8+
Clock Source Selection in Low Power Mode
9+
--------------------------------------------
10+
11+
According to the Bluetooth specification, the sleep clock accuracy must be within 500 PPM. Make sure the clock source selected for Bluetooth LE low power mode meets this requirement. Otherwise, Bluetooth LE may not perform normally and can cause a series of problems, such as ACL connection establishment failure or ACL connection timeout.
12+
13+
Selecting Main XTAL
14+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
16+
To select the main XTAL as the Bluetooth LE internal clock source, configure the following option:
17+
18+
.. only:: esp32
19+
20+
:ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` = Main crystal (`CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL`)
21+
22+
.. only:: esp32c3 or esp32s3
23+
24+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = Main crystal (`CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL`)
25+
26+
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
27+
28+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use main XTAL as RTC clock source (`CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL`)
29+
30+
When this is selected, the main XTAL remains powered on during light-sleep, resulting in higher current consumption. Please refer to :example_file:`Power Save README <bluetooth/nimble/power_save/README.md>` for the typical current consumption in light-sleep using XTAL versus a 32 kHz external crystal.
31+
32+
Selecting 32 kHz External Crystal
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
35+
To use a 32 kHz external crystal as the Bluetooth LE internal clock source, configure the following options:
36+
37+
**Configuration Path 1:**
38+
39+
.. only:: esp32
40+
41+
:ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` = External 32 kHz crystal/oscillator (`CONFIG_BTDM_CTRL_LPCLK_SEL_EXT_32K_XTAL`)
42+
43+
.. only:: esp32c3 or esp32s3
44+
45+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = External 32 kHz crystal/oscillator (`CONFIG_BT_CTRL_LPCLK_SEL_EXT_32K_XTAL`)
46+
47+
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
48+
49+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use system RTC slow clock source (`CONFIG_BT_LE_LP_CLK_SRC_DEFAULT`)
50+
51+
**Configuration Path 2:**
52+
53+
:ref:`CONFIG_RTC_CLK_SRC` = External 32 kHz crystal (`CONFIG_RTC_CLK_SRC_EXT_CRYS`)
54+
55+
**Note:** Even if 32 kHz is selected in menuconfig, the system will fall back to the main XTAL if the external crystal is not detected during Bluetooth LE initialization. This may lead to unexpected current consumption in light-sleep mode.
56+
57+
Selecting 136 kHz RC Oscillator
58+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59+
60+
.. only:: esp32c3 or esp32s3
61+
62+
To use a 136 kHz internal RC oscillator as the Bluetooth LE internal clock source, configure the following option:
63+
64+
**Configuration Path 1:**
65+
66+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = Internal 136kHz RC oscillator (`CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW`)
67+
68+
Generally, the 136 kHz RC oscillator cannot meet the accuracy requirement of Bluetooth LE. It is only suitable for scenarios with low clock accuracy requirements, such as legacy advertising (ADV) or scanning. It does not support connections in central or peripheral roles.
69+
70+
.. only:: esp32
71+
72+
**Note:** ESP32 does not support using 136 kHz RC oscillator as the Bluetooth LE clock source.
73+
74+
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
75+
76+
To use a 136 kHz internal RC oscillator as the Bluetooth LE internal clock source, configure the following options:
77+
78+
**Configuration Path 1:**
79+
80+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use system RTC slow clock source (`CONFIG_BT_LE_LP_CLK_SRC_DEFAULT`)
81+
82+
.. only:: not esp32
83+
84+
**Configuration Path 2:**
85+
86+
:ref:`CONFIG_RTC_CLK_SRC` = Internal 136 kHz RC oscillator (`CONFIG_RTC_CLK_SRC_INT_RC`)
87+
88+
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
89+
90+
If low current consumption is required but there is no access to the External 32 kHz Crystal, this clock source is recommended. However, this clock source has a sleep clock accuracy exceeding 500 PPM, which is only supported when pairing with another ESP chip. For non-ESP peer devices, the following Bluetooth LE features are not supported:
91+
92+
1. Central role of Connection
93+
2. Advertiser of Periodic Advertising
94+
95+
If the peer device also uses 136 kHz RC as the clock source, the following configuration should be set:
96+
97+
**Configuration Path:**
98+
99+
- :ref:`CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE` = y
100+
- :ref:`CONFIG_BT_LE_LL_PEER_SCA` = 3000
101+
102+
**Note:** Using the 136 kHz RC oscillator may occasionally cause issues such as connection establishment failures or connection timeouts.
103+
104+
105+
How to Check the Current Clock Source Used by Bluetooth LE
106+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
107+
108+
You can check the current Bluetooth LE clock source from the initialization logs:
109+
110+
.. list-table:: Bluetooth LE Initialization Logs and Clock Sources
111+
:widths: 50 50
112+
:header-rows: 1
113+
114+
* - Log Message
115+
- Clock Source
116+
* - Using main XTAL as clock source
117+
- Main XTAL
118+
* - Using 136 kHz RC as clock source
119+
- Internal 136 kHz RC oscillator
120+
* - Using external 32.768 kHz crystal as clock source
121+
- External 32 kHz crystal
122+
* - Using external 32.768 kHz oscillator at 32K_XP pin as clock source
123+
- External 32 kHz oscillator at 32K_XP pin
124+
125+
126+
FAQ
127+
--------------------------------------
128+
129+
1. Bluetooth LE ACL Connection Fails or Disconnects in Low Power Mode
130+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131+
132+
As explained in the clock source selection section above, when ACL connections fail to establish or unexpectedly disconnect in low power mode, first verify whether the current clock source meets Bluetooth LE accuracy requirements.
133+
134+
135+
2. Measured light-sleep Current Higher Than Expected
136+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
137+
138+
As described in the clock source selection section above, if the main XTAL is used as the clock source, it remains powered on during light-sleep, resulting in higher current consumption than other clock sources. The average current may vary depending on the specific application, Bluetooth LE configuration, and the duration spent in light-sleep. Some applications may have higher average current because Bluetooth LE is active for a larger proportion of the time transmitting and receiving.
139+
140+
3. Unable to Enter light-sleep Mode
141+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
143+
If Auto light-sleep is enabled but the device fails to enter light-sleep, it's usually due to insufficient IDLE time, which prevents the automatic entry conditions from being met. This can be caused by excessive logging or Bluetooth LE configurations that reduce IDLE time, such as continuous scanning.

docs/en/api-reference/system/power_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The following drivers hold the ``ESP_PM_APB_FREQ_MAX`` lock while the driver is
116116
- **Ethernet**: between calls to :cpp:func:`esp_eth_driver_install` and :cpp:func:`esp_eth_driver_uninstall`.
117117
:SOC_WIFI_SUPPORTED: - **WiFi**: between calls to :cpp:func:`esp_wifi_start` and :cpp:func:`esp_wifi_stop`. If modem sleep is enabled, the lock will be released for the periods of time when radio is disabled.
118118
:SOC_TWAI_SUPPORTED: - **TWAI**: between calls to :cpp:func:`twai_driver_install` and :cpp:func:`twai_driver_uninstall` (only when the clock source is set to :cpp:enumerator:`TWAI_CLK_SRC_APB`).
119-
:SOC_BT_SUPPORTED and esp32: - **Bluetooth**: between calls to :cpp:func:`esp_bt_controller_enable` and :cpp:func:`esp_bt_controller_disable`. If Bluetooth Modem-sleep is enabled, the ``ESP_PM_APB_FREQ_MAX`` lock will be released for the periods of time when radio is disabled. However the ``ESP_PM_NO_LIGHT_SLEEP`` lock will still be held, unless :ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` option is set to "External 32kHz crystal".
119+
:SOC_BT_SUPPORTED and esp32: - **Bluetooth**: between calls to :cpp:func:`esp_bt_controller_enable` and :cpp:func:`esp_bt_controller_disable`. If Bluetooth Modem-sleep is enabled, the ``ESP_PM_APB_FREQ_MAX`` lock will be released for the periods of time when radio is disabled. However the ``ESP_PM_NO_LIGHT_SLEEP`` lock will still be held, unless :ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` option is set to "External 32 kHz crystal".
120120
:SOC_BT_SUPPORTED and not esp32: - **Bluetooth**: between calls to :cpp:func:`esp_bt_controller_enable` and :cpp:func:`esp_bt_controller_disable`. If Bluetooth Modem-sleep is enabled, the ``ESP_PM_APB_FREQ_MAX`` lock will be released for the periods of time when radio is disabled. However the ``ESP_PM_NO_LIGHT_SLEEP`` lock will still be held.
121121
:SOC_PCNT_SUPPORTED: - **PCNT**: between calls to :cpp:func:`pcnt_unit_enable` and :cpp:func:`pcnt_unit_disable`.
122122
:SOC_SDM_SUPPORTED: - **Sigma-delta**: between calls to :cpp:func:`sdm_channel_enable` and :cpp:func:`sdm_channel_disable`.

docs/zh_CN/api-guides/ble/blufi.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ ACK 帧格式 (8 bit):
435435
-
436436

437437
* - 0x8 (b’001000)
438-
- 断开 BLE GATT 连接。
438+
- 断开低功耗蓝牙 GATT 连接。
439439
-
440-
- ESP 设备收到该指令后主动断开 BLE GATT 连接。
440+
- ESP 设备收到该指令后主动断开低功耗蓝牙 GATT 连接。
441441

442442
* - 0x9 (b’001001)
443443
- 获取 Wi-Fi 列表。

docs/zh_CN/api-guides/ble/get-started/ble-data-exchange.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ GATT 数据操作
296296
动手试试
297297
^^^^^^^^^^^^^^^^^^
298298

299-
请参考 :ref:`BLE 介绍 动手试试 <nimble_gatt_server_practice>` 。
299+
请参考 :ref:`低功耗蓝牙介绍 动手试试 <nimble_gatt_server_practice>` 。
300300

301301

302302
代码详解

0 commit comments

Comments
 (0)