Skip to content

Commit 10d86e7

Browse files
committed
feat: release classic-BT controller memory on original ESP32 during BLE initialization
1 parent 6193fc1 commit 10d86e7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

firmware_core/ble/rivr_ble.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,17 @@ void rivr_ble_init(void)
391391

392392
RIVR_LOGI(TAG, "rivr_ble_init: initialising Bluedroid BLE stack");
393393

394+
#if CONFIG_IDF_TARGET_ESP32
395+
/* Release classic-BT controller memory on original ESP32 only.
396+
* ESP32-S3, C3, H2, C6 are BLE-only chips — classic BT memory does not
397+
* exist; calling mem_release() with ESP_BT_MODE_CLASSIC_BT on those
398+
* targets returns ESP_ERR_NOT_SUPPORTED and would abort BLE init. */
394399
err = esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
395400
if (err != ESP_OK && err != ESP_ERR_INVALID_STATE) {
396401
ESP_LOGE(TAG, "esp_bt_controller_mem_release failed: %s", esp_err_to_name(err));
397402
return;
398403
}
404+
#endif
399405

400406
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
401407
err = esp_bt_controller_init(&bt_cfg);

0 commit comments

Comments
 (0)