|
| 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. |
0 commit comments