diff --git a/components/esp_phy/esp32c5/include/btbb_retention_reg.h b/components/esp_phy/esp32c5/include/btbb_retention_reg.h index 69a6d6618d..2b60af5895 100644 --- a/components/esp_phy/esp32c5/include/btbb_retention_reg.h +++ b/components/esp_phy/esp32c5/include/btbb_retention_reg.h @@ -12,6 +12,7 @@ extern "C" { // btbb sleep retention reg +#define BB_PART_CNT 3 #define BB_PART_0_SIZE 128 #define BB_PART_1_SIZE 68 #define BB_PART_2_SIZE 19 diff --git a/components/esp_phy/esp32c6/include/btbb_retention_reg.h b/components/esp_phy/esp32c6/include/btbb_retention_reg.h index 54a3b3d193..e99f3d04a2 100644 --- a/components/esp_phy/esp32c6/include/btbb_retention_reg.h +++ b/components/esp_phy/esp32c6/include/btbb_retention_reg.h @@ -12,6 +12,7 @@ extern "C" { // btbb sleep retention reg +#define BB_PART_CNT 3 #define BB_PART_0_SIZE 93 #define BB_PART_1_SIZE 62 #define BB_PART_2_SIZE 19 diff --git a/components/esp_phy/esp32c61/include/btbb_retention_reg.h b/components/esp_phy/esp32c61/include/btbb_retention_reg.h index fbb3997296..391c61a6cb 100644 --- a/components/esp_phy/esp32c61/include/btbb_retention_reg.h +++ b/components/esp_phy/esp32c61/include/btbb_retention_reg.h @@ -12,12 +12,11 @@ extern "C" { // btbb sleep retention reg -#define BB_PART_0_SIZE 93 -#define BB_PART_1_SIZE 62 -#define BB_PART_2_SIZE 19 +#define BB_PART_CNT 2 +#define BB_PART_0_SIZE 128 +#define BB_PART_1_SIZE 68 #define BB_PART_0_ADDR 0x600A2000 #define BB_PART_1_ADDR 0x600A2800 -#define BB_PART_2_ADDR 0x600A2C00 #ifdef __cplusplus } diff --git a/components/esp_phy/esp32h2/include/btbb_retention_reg.h b/components/esp_phy/esp32h2/include/btbb_retention_reg.h index 54a3b3d193..e99f3d04a2 100644 --- a/components/esp_phy/esp32h2/include/btbb_retention_reg.h +++ b/components/esp_phy/esp32h2/include/btbb_retention_reg.h @@ -12,6 +12,7 @@ extern "C" { // btbb sleep retention reg +#define BB_PART_CNT 3 #define BB_PART_0_SIZE 93 #define BB_PART_1_SIZE 62 #define BB_PART_2_SIZE 19 diff --git a/components/esp_phy/src/btbb_init.c b/components/esp_phy/src/btbb_init.c index 88e0df7573..a21bfe212a 100644 --- a/components/esp_phy/src/btbb_init.c +++ b/components/esp_phy/src/btbb_init.c @@ -33,7 +33,9 @@ static esp_err_t btbb_sleep_retention_init(void *arg) const static sleep_retention_entries_config_t btbb_regs_retention[] = { [0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEM_BT_BB_LINK(0x00), BB_PART_0_ADDR, BB_PART_0_ADDR, BB_PART_0_SIZE, 0, 0), .owner = BTBB_LINK_OWNER }, [1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEM_BT_BB_LINK(0x01), BB_PART_1_ADDR, BB_PART_1_ADDR, BB_PART_1_SIZE, 0, 0), .owner = BTBB_LINK_OWNER }, +#if BB_PART_CNT > 2 [2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(REGDMA_MODEM_BT_BB_LINK(0x02), BB_PART_2_ADDR, BB_PART_2_ADDR, BB_PART_2_SIZE, 0, 0), .owner = BTBB_LINK_OWNER }, +#endif // BB_PART_CNT > 2 }; esp_err_t err = sleep_retention_entries_create(btbb_regs_retention, ARRAY_SIZE(btbb_regs_retention), REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BT_BB); ESP_RETURN_ON_ERROR(err, TAG, "failed to allocate memory for btbb retention");