|
| 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 (BLE), 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, so make sure the clock source selected for BLE low power mode should meet that requirement. Otherwise BLE may not perform normally and cause a series of problem such as ACL connection establishment failure or ACL connection timeout, etc. |
| 12 | + |
| 13 | + |
| 14 | +Selecting Main XTAL |
| 15 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 16 | + |
| 17 | +To select the main XTAL as the BLE internal clock source, configure the following option: |
| 18 | + |
| 19 | +.. only:: esp32 or esp32c3 or esp32s3 |
| 20 | + |
| 21 | + **Configuration Path:** |
| 22 | + |
| 23 | + ``Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock`` |
| 24 | + |
| 25 | + **Configuration Option:** |
| 26 | + |
| 27 | + - \ (X) Main crystal |
| 28 | + |
| 29 | +.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61 |
| 30 | + |
| 31 | + **Configuration Path:** |
| 32 | + |
| 33 | + ``Component config → Bluetooth → Controller Options → BLE low power clock source`` |
| 34 | + |
| 35 | + **Configuration Option:** |
| 36 | + |
| 37 | + - \ (X) Use main XTAL as RTC clock source |
| 38 | + |
| 39 | +When this is selected, the main XTAL remains powered on during light-sleep, resulting in higher current consumption. The current reference for light-sleep using XTAL versus a 32kHz external crystal is shown below: |
| 40 | + |
| 41 | +.. list-table:: Current Reference Values for Different Clock Sources in Light-sleep Mode |
| 42 | + :widths: auto |
| 43 | + :header-rows: 1 |
| 44 | + |
| 45 | + * - Clock Source |
| 46 | + - Typical Light-sleep Current |
| 47 | + * - Main XTAL |
| 48 | + - 3.3 mA |
| 49 | + * - 32kHz External Crystal / 136 kHz RC |
| 50 | + - 34 uA |
| 51 | + |
| 52 | + |
| 53 | +Selecting 32kHz External Crystal |
| 54 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 55 | + |
| 56 | +To use a 32kHz external crystal as the BLE internal clock source, configure the following options: |
| 57 | + |
| 58 | +.. only:: esp32 or esp32c3 or esp32s3 |
| 59 | + |
| 60 | + **Configuration Path:** |
| 61 | + |
| 62 | + ``Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock`` |
| 63 | + |
| 64 | + **Configuration Option:** |
| 65 | + |
| 66 | + - \ (X) External 32kHz crystal/oscillator |
| 67 | + |
| 68 | +.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61 |
| 69 | + |
| 70 | + **Configuration Path 1:** |
| 71 | + |
| 72 | + ``Component config → Bluetooth → Controller Options → BLE low power clock source`` |
| 73 | + |
| 74 | + **Configuration Option:** |
| 75 | + |
| 76 | + - \ (X) Use system RTC slow clock source |
| 77 | + |
| 78 | + **Configuration Path 2:** |
| 79 | + |
| 80 | + ``Component config → Hardware Settings → RTC Clock Config → RTC clock source`` |
| 81 | + |
| 82 | + **Configuration Option:** |
| 83 | + |
| 84 | + - \ (X) External 32 kHz crystal |
| 85 | + |
| 86 | +**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 BLE initialization. This may lead to unexpected current consumption in light-sleep mode. |
| 87 | + |
| 88 | + |
| 89 | +Selecting 136 kHz RC Oscillator |
| 90 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 91 | + |
| 92 | +.. only:: esp32c3 or esp32s3 |
| 93 | + |
| 94 | + To use a 136 kHz internal RC oscillator as the BLE internal clock source, configure the following option: |
| 95 | + |
| 96 | + **Configuration Path:** ` |
| 97 | + |
| 98 | + `Component config → Bluetooth → Controller Options → MODEM SLEEP Options → Bluetooth modem sleep → Bluetooth Modem sleep Mode 1 → Bluetooth low power clock`` |
| 99 | + |
| 100 | + **Configuration Option:** |
| 101 | + |
| 102 | + - \ (X) Internal 136kHz RC oscillator |
| 103 | + |
| 104 | + Generally, the 136 kHz RC oscillator cannot meet the accuracy requirement of BLE. It is only suitable for scenarios with low clock accuracy requirements, such as legacy advertising (ADV) or scanning. |
| 105 | + |
| 106 | + However, for testing purposes, if the peer device also uses 136 kHz RC as the clock source, BLE can function under a 136 kHz RC clock through the following configuration: |
| 107 | + |
| 108 | + **Configuration Path:** |
| 109 | + |
| 110 | + ``Component config → Bluetooth → Controller Options`` |
| 111 | + |
| 112 | + **Configuration Options:** |
| 113 | + |
| 114 | + - \ [*] Enable to set constant peer SCA |
| 115 | + - \ (3000) Constant peer sleep clock accuracy value |
| 116 | + |
| 117 | + **Note:** Using the 136 kHz RC oscillator may cause rare issues like connection drops or failures to establish a connection. |
| 118 | + |
| 119 | +.. only:: esp32 |
| 120 | + |
| 121 | + **Note:** ESP32 does not support using 136 kHz RC oscillator as the BLE clock source. |
| 122 | + |
| 123 | +.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61 |
| 124 | + |
| 125 | + To use a 136 kHz internal RC oscillator as the BLE internal clock source, configure the following options: |
| 126 | + |
| 127 | + **Configuration Path 1:** |
| 128 | + |
| 129 | + ``Component config → Bluetooth → Controller Options → BLE low power clock source`` |
| 130 | + |
| 131 | + **Configuration Option:** |
| 132 | + |
| 133 | + - \ (X) Use system RTC slow clock source |
| 134 | + |
| 135 | + **Configuration Path 2:** |
| 136 | + |
| 137 | + ``Component config → Hardware Settings → RTC Clock Config → RTC clock source`` |
| 138 | + |
| 139 | + **Configuration Option:** |
| 140 | + |
| 141 | + - \ (X) Internal 136 kHz RC oscillator |
| 142 | + |
| 143 | + Generally, the 136 kHz RC oscillator cannot meet the accuracy requirement of BLE. It is only suitable for scenarios with low clock accuracy requirements, such as legacy advertising (ADV) or scanning. |
| 144 | + |
| 145 | + If low curent 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 BLE event not supported: |
| 146 | + |
| 147 | + 1. Central role of Connection |
| 148 | + 2. Advertiser of Periodic Advertising |
| 149 | + |
| 150 | + If the peer device also uses 136 kHz RC as the clock source, the following configuration should be set: |
| 151 | + |
| 152 | + **Configuration Path:** |
| 153 | + |
| 154 | + ``Component config → Bluetooth → Controller Options`` |
| 155 | + |
| 156 | + **Configuration Options:** |
| 157 | + |
| 158 | + - \ [*] Enable to set constant peer SCA |
| 159 | + - \ (3000) Constant peer sleep clock accuracy value |
| 160 | + |
| 161 | + **Note:** Using the 136 kHz RC oscillator may cause rare issues like connection establishment failure or connection timeout. |
| 162 | + |
| 163 | + |
| 164 | +**How to Check the Current Clock Source Used by BLE** |
| 165 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 166 | + |
| 167 | +You can determine the BLE clock source from the logs during BLE initialization: |
| 168 | + |
| 169 | +.. list-table:: BLE Initialization Log Messages and Clock Source Correspondence |
| 170 | + :widths: 50 50 |
| 171 | + :header-rows: 1 |
| 172 | + |
| 173 | + * - Log Message |
| 174 | + - Clock Source |
| 175 | + * - Using main XTAL as clock source |
| 176 | + - Main XTAL |
| 177 | + * - Using 136 kHz RC as clock source |
| 178 | + - Internal 136 kHz RC oscillator |
| 179 | + * - Using external 32.768 kHz crystal as clock source |
| 180 | + - External 32 kHz crystal |
| 181 | + * - Using external 32.768 kHz oscillator at 32K_XP pin as clock source |
| 182 | + - External 32 kHz oscillator at 32K_XP pin |
| 183 | + |
| 184 | + |
| 185 | +FAQ |
| 186 | +-------------------------------------- |
| 187 | + |
| 188 | +**1. BLE ACL Connection Fails or Disconnects in Low Power Mode** |
| 189 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 190 | + |
| 191 | +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 BLE accuracy requirements. |
| 192 | + |
| 193 | + |
| 194 | +**2. Measured light-sleep Current Is Higher Than Expected** |
| 195 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 196 | + |
| 197 | +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. |
| 198 | + |
| 199 | +Also, BLE operates in Auto Light-sleep mode, meaning the system decides whether to enter sleep after entering IDLE. During advertising or scanning, current will be significantly higher than during light-sleep. |
| 200 | + |
| 201 | +Thus, the average current in low power mode is somewhere between light-sleep current and peak current (usually TX current). |
| 202 | + |
| 203 | +The average current can be application specific, and depends on the BLE configuration and the period of time in light-sleep mode. Some application may have larger average currrent because it has BLE taking a larger ratio of time transmitting and receiving. |
| 204 | + |
| 205 | +**3. Unable to Enter light-sleep Mode** |
| 206 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 207 | + |
| 208 | +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. |
| 209 | + |
| 210 | +This could be caused by excessive logging or BLE configuration that prevents sufficient IDLE time, such as continuous scan mode. |
0 commit comments