forked from espressif/esp-idf
feat(ble): support ble light sleep on esp32c61
This commit is contained in:
@@ -43,12 +43,9 @@
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "bt_osi_mem.h"
|
||||
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#include "esp_private/sleep_modem.h"
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
@@ -643,11 +640,15 @@ esp_err_t controller_sleep_init(void)
|
||||
goto error;
|
||||
}
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
#if CONFIG_BT_LE_SLEEP_ENABLE && !CONFIG_MAC_BB_PD
|
||||
#if CONFIG_BT_LE_SLEEP_ENABLE && SOC_PM_RETENTION_HAS_CLOCK_BUG && !CONFIG_MAC_BB_PD
|
||||
#error "CONFIG_MAC_BB_PD required for BLE light sleep to run properly"
|
||||
#endif // CONFIG_BT_LE_SLEEP_ENABLE && !CONFIG_MAC_BB_PD
|
||||
#endif // CONFIG_BT_LE_SLEEP_ENABLE && SOC_PM_RETENTION_HAS_CLOCK_BUG && !CONFIG_MAC_BB_PD
|
||||
/* Create a new regdma link for BLE related register restoration */
|
||||
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
rc = sleep_modem_ble_mac_modem_state_init(1);
|
||||
#else
|
||||
rc = sleep_modem_ble_mac_modem_state_init(0);
|
||||
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
|
||||
assert(rc == 0);
|
||||
esp_sleep_enable_bt_wakeup();
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
|
||||
|
Submodule components/bt/controller/lib_esp32c6/esp32c6-bt-lib updated: 3f15aa1d60...69f16a7a63
@@ -827,6 +827,10 @@ config SOC_PM_SUPPORT_BEACON_WAKEUP
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_PM_SUPPORT_BT_WAKEUP
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_PM_SUPPORT_EXT1_WAKEUP
|
||||
bool
|
||||
default y
|
||||
|
@@ -418,7 +418,7 @@
|
||||
/*-------------------------- Power Management CAPS ----------------------------*/
|
||||
#define SOC_PM_SUPPORT_WIFI_WAKEUP (1)
|
||||
#define SOC_PM_SUPPORT_BEACON_WAKEUP (1)
|
||||
// #define SOC_PM_SUPPORT_BT_WAKEUP (1)
|
||||
#define SOC_PM_SUPPORT_BT_WAKEUP (1)
|
||||
#define SOC_PM_SUPPORT_EXT1_WAKEUP (1)
|
||||
#define SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN (1) /*!<Supports one bit per pin to configure the EXT1 trigger level */
|
||||
#define SOC_PM_SUPPORT_CPU_PD (1)
|
||||
|
@@ -200,10 +200,6 @@ examples/bluetooth/nimble/blecent:
|
||||
<<: *bt_default_depends
|
||||
disable:
|
||||
- if: SOC_BLE_SUPPORTED != 1
|
||||
disable_test:
|
||||
- if: IDF_TARGET in ["esp32c61"]
|
||||
temporary: true
|
||||
reason: Not supported yet
|
||||
depends_components:
|
||||
- bt
|
||||
- esp_phy
|
||||
@@ -252,7 +248,6 @@ examples/bluetooth/nimble/power_save:
|
||||
<<: *bt_default_depends
|
||||
disable:
|
||||
- if: SOC_BLE_SUPPORTED != 1
|
||||
- if: IDF_TARGET in ["esp32c61"]
|
||||
depends_components:
|
||||
- bt
|
||||
- esp_phy
|
||||
|
@@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- |
|
||||
|
||||
Bluetooth Power Save Example
|
||||
=================================
|
||||
@@ -24,6 +24,8 @@ This example contains some build configurations. For each configuration, a few c
|
||||
- `sdkconfig.26m.esp32c2`: ESP32C2 uses main XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.defaults.esp32c5`: ESP32C5 uses 32kHz XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.48m.esp32c5`: ESP32C5 uses main XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.defaults.esp32c61`: ESP32C61 uses 32kHz XTAL as low power clock in light sleep enabled.
|
||||
- `sdkconfig.40m.esp32c61`: ESP32C61 uses main XTAL as low power clock in light sleep enabled.
|
||||
|
||||
## How to use example
|
||||
|
||||
|
22
examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32c61
Normal file
22
examples/bluetooth/nimble/power_save/sdkconfig.40m.esp32c61
Normal file
@@ -0,0 +1,22 @@
|
||||
CONFIG_IDF_TARGET="esp32c61"
|
||||
|
||||
# Bluetooth Low Power Config
|
||||
CONFIG_BT_LE_SLEEP_ENABLE=y
|
||||
CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL=y
|
||||
|
||||
#
|
||||
# Power Management
|
||||
#
|
||||
CONFIG_PM_ENABLE=y
|
||||
CONFIG_PM_DFS_INIT_AUTO=y
|
||||
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
|
||||
# end of Power Management
|
||||
|
||||
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
|
||||
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
@@ -0,0 +1,29 @@
|
||||
CONFIG_IDF_TARGET="esp32c61"
|
||||
|
||||
# Bluetooth Low Power Config
|
||||
CONFIG_BT_LE_SLEEP_ENABLE=y
|
||||
CONFIG_BT_LE_LP_CLK_SRC_DEFAULT=y
|
||||
|
||||
#
|
||||
# Power Management
|
||||
#
|
||||
CONFIG_PM_ENABLE=y
|
||||
CONFIG_PM_DFS_INIT_AUTO=y
|
||||
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
|
||||
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
|
||||
# end of Power Management
|
||||
|
||||
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
|
||||
|
||||
#
|
||||
# Sleep Config
|
||||
#
|
||||
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
|
||||
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
|
||||
# end of Sleep Config
|
||||
|
||||
#
|
||||
# RTC Clock Config
|
||||
#
|
||||
CONFIG_RTC_CLK_SRC_EXT_CRYS=y
|
||||
# end of RTC Clock Config
|
@@ -14,6 +14,7 @@ from pytest_embedded_idf.dut import IdfDut
|
||||
@pytest.mark.esp32c3
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.esp32c5
|
||||
@pytest.mark.esp32c61
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.wifi_two_dut
|
||||
@pytest.mark.parametrize(
|
||||
|
Reference in New Issue
Block a user