Skip to content

Commit eec06b4

Browse files
committed
docs(ble): Optimized the BLE low power guide
1 parent 9f56f16 commit eec06b4

File tree

4 files changed

+63
-145
lines changed

4 files changed

+63
-145
lines changed

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:`Bluetooth LE 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/low-power-mode/low-power-mode-ble.rst

Lines changed: 33 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,51 @@ This section introduces clock source selection in low power modes for Bluetooth
88
Clock Source Selection in Low Power Mode
99
--------------------------------------------
1010

11-
According to the Bluetooth specification, the sleep clock accuracy must be within 500 PPM, so make sure the clock source selected for Bluetooth LE low power mode should meet that requirement. Otherwise Bluetooth LE may not perform normally and cause a series of problem such as ACL connection establishment failure or ACL connection timeout, etc.
12-
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.
1312

1413
Selecting Main XTAL
1514
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1615

1716
To select the main XTAL as the Bluetooth LE internal clock source, configure the following option:
1817

19-
.. only:: esp32 or esp32c3 or esp32s3
20-
21-
**Configuration Path:**
18+
.. only:: esp32
2219

23-
``Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock``
20+
:ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` = Main crystal (`CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL`)
2421

25-
**Configuration Option:**
22+
.. only:: esp32c3 or esp32s3
2623

27-
- \ (X) Main crystal
24+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = Main crystal (`CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL`)
2825

2926
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
3027

31-
**Configuration Path:**
32-
33-
``Component config → Bluetooth → Controller Options → BLE low power clock source``
34-
35-
**Configuration Option:**
28+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use main XTAL as RTC clock source (`CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL`)
3629

37-
- \ (X) Use main XTAL as RTC clock source
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.
3831

39-
When this is selected, the main XTAL remains powered on during light-sleep, resulting in higher current consumption.
40-
Please refer :example_file:`Power Save README <bluetooth/nimble/power_save/README.md>` for the typical current consumption in light-sleep using XTAL versus a 32kHz external crystal.
41-
42-
Selecting 32kHz External Crystal
32+
Selecting 32 kHz External Crystal
4333
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4434

45-
To use a 32kHz external crystal as the Bluetooth LE internal clock source, configure the following options:
35+
To use a 32 kHz external crystal as the Bluetooth LE internal clock source, configure the following options:
4636

47-
.. only:: esp32 or esp32c3 or esp32s3
37+
**Configuration Path 1:**
4838

49-
**Configuration Path 1:**
39+
.. only:: esp32
5040

51-
``Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock``
41+
:ref:`CONFIG_BTDM_CTRL_LOW_POWER_CLOCK` = External 32 kHz crystal/oscillator (`CONFIG_BTDM_CTRL_LPCLK_SEL_EXT_32K_XTAL`)
5242

53-
**Configuration Option:**
43+
.. only:: esp32c3 or esp32s3
5444

55-
- \ (X) External 32kHz crystal/oscillator
45+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = External 32 kHz crystal/oscillator (`CONFIG_BT_CTRL_LPCLK_SEL_EXT_32K_XTAL`)
5646

5747
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
5848

59-
**Configuration Path 1:**
60-
61-
``Component config → Bluetooth → Controller Options → BLE low power clock source``
62-
63-
**Configuration Option:**
64-
65-
- \ (X) Use system RTC slow clock source
49+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use system RTC slow clock source (`CONFIG_BT_LE_LP_CLK_SRC_DEFAULT`)
6650

6751
**Configuration Path 2:**
6852

69-
``Component config → Hardware Settings → RTC Clock Config → RTC clock source``
70-
71-
**Configuration Option:**
72-
73-
- \ (X) External 32 kHz crystal
74-
75-
**Note:** Even if 32kHz 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.
53+
:ref:`CONFIG_RTC_CLK_SRC` = External 32 kHz crystal (`CONFIG_RTC_CLK_SRC_EXT_CRYS`)
7654

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.
7756

7857
Selecting 136 kHz RC Oscillator
7958
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,11 +63,7 @@ Selecting 136 kHz RC Oscillator
8463

8564
**Configuration Path 1:**
8665

87-
`Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock``
88-
89-
**Configuration Option:**
90-
91-
- \ (X) Internal 136kHz RC oscillator
66+
:ref:`CONFIG_BT_CTRL_LOW_POWER_CLOCK` = Internal 136kHz RC oscillator (`CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW`)
9267

9368
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.
9469

@@ -102,25 +77,17 @@ Selecting 136 kHz RC Oscillator
10277

10378
**Configuration Path 1:**
10479

105-
``Component config → Bluetooth → Controller Options → BLE low power clock source``
106-
107-
**Configuration Option:**
108-
109-
- \ (X) Use system RTC slow clock source
80+
:ref:`CONFIG_BT_LE_LP_CLK_SRC` = Use system RTC slow clock source (`CONFIG_BT_LE_LP_CLK_SRC_DEFAULT`)
11081

11182
.. only:: not esp32
11283

11384
**Configuration Path 2:**
11485

115-
``Component config → Hardware Settings → RTC Clock Config → RTC clock source``
116-
117-
**Configuration Option:**
118-
119-
- \ (X) Internal 136 kHz RC oscillator
86+
:ref:`CONFIG_RTC_CLK_SRC` = Internal 136 kHz RC oscillator (`CONFIG_RTC_CLK_SRC_INT_RC`)
12087

12188
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
12289

123-
If low current consumption is required but have no access to the External 32kHz Crystal, then this clock source is recommended. However, selecting this clock source will have the sleep clock accuracy larger than 500 PPM, which is supported if the peer device is also an ESP chip. If the peer device is not an ESP chip, here's some Bluetooth LE event not supported:
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:
12491

12592
1. Central role of Connection
12693
2. Advertiser of Periodic Advertising
@@ -129,22 +96,18 @@ Selecting 136 kHz RC Oscillator
12996

13097
**Configuration Path:**
13198

132-
``Component config → Bluetooth → Controller Options``
133-
134-
**Configuration Options:**
135-
136-
- \ [*] Enable to set constant peer SCA
137-
- \ (3000) Constant peer sleep clock accuracy value
99+
- :ref:`CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE` = y
100+
- :ref:`CONFIG_BT_LE_LL_PEER_SCA` = 3000
138101

139-
**Note:** Using the 136 kHz RC oscillator may cause rare issues like connection establishment failure or connection timeout.
102+
**Note:** Using the 136 kHz RC oscillator may occasionally cause issues such as connection establishment failures or connection timeouts.
140103

141104

142-
**How to Check the Current Clock Source Used by Bluetooth LE**
105+
How to Check the Current Clock Source Used by Bluetooth LE
143106
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144107

145-
You can determine the Bluetooth LE clock source from the logs during Bluetooth LE initialization:
108+
You can check the current Bluetooth LE clock source from the initialization logs:
146109

147-
.. list-table:: Bluetooth LE Initialization Log Messages and Clock Source Correspondence
110+
.. list-table:: Bluetooth LE Initialization Logs and Clock Sources
148111
:widths: 50 50
149112
:header-rows: 1
150113

@@ -163,22 +126,18 @@ You can determine the Bluetooth LE clock source from the logs during Bluetooth L
163126
FAQ
164127
--------------------------------------
165128

166-
**1. Bluetooth LE ACL Connection Fails or Disconnects in Low Power Mode**
129+
1. Bluetooth LE ACL Connection Fails or Disconnects in Low Power Mode
167130
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168131

169132
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.
170133

171134

172-
**2. Measured light-sleep Current Is Higher Than Expected**
173-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174-
175-
As introduced in the clock source selection section above, if the main XTAL is used as the clock source, it will remain powered on during light-sleep, resulting in higher current consumption than other clock sources.
135+
2. Measured light-sleep Current Higher Than Expected
136+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176137

177-
The average current can be application specific, and depends on the Bluetooth LE configuration and the period of time in light-sleep mode. Some application may have larger average current because it has Bluetooth LE taking a larger ratio of time transmitting and receiving.
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.
178139

179-
**3. Unable to Enter light-sleep Mode**
140+
3. Unable to Enter light-sleep Mode
180141
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
181142

182-
When Auto light-sleep is enabled but the device fails to enter light-sleep, it's often due to insufficient IDLE duration, which prevents meeting the automatic light-sleep entry conditions.
183-
184-
This could be caused by excessive logging or Bluetooth LE configuration that prevents sufficient IDLE time, such as continuous scan mode.
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`.

0 commit comments

Comments
 (0)