From 44e40500da4423474cd85e2bd3b4cbcae2f51660 Mon Sep 17 00:00:00 2001 From: wangcheng Date: Wed, 28 Oct 2020 19:05:12 +0800 Subject: [PATCH 1/2] components/bt: fix assert(10, 9), when the AFPM happens. fix tx_prog insert error. --- components/bt/controller/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib b/components/bt/controller/lib index 85be5e8cf1..fc5dd70b42 160000 --- a/components/bt/controller/lib +++ b/components/bt/controller/lib @@ -1 +1 @@ -Subproject commit 85be5e8cf1e0465ff8c104c1e0b77f837f446ef7 +Subproject commit fc5dd70b422f514d18c10e23847fe712f7c6e537 From 138e1319b1e7724140b828be107c0f022b592010 Mon Sep 17 00:00:00 2001 From: wangcheng Date: Mon, 26 Oct 2020 15:56:55 +0800 Subject: [PATCH 2/2] components/bt: fixed memory damage caused by bluetooth memory release --- components/bt/controller/bt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/bt/controller/bt.c b/components/bt/controller/bt.c index 6660c9bc02..632bd0dfaf 100644 --- a/components/bt/controller/bt.c +++ b/components/bt/controller/bt.c @@ -1176,6 +1176,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) esp_err_t err; uint32_t btdm_cfg_mask = 0; + //if all the bt available memory was already released, cannot initialize bluetooth controller + if (btdm_dram_available_region[0].mode == ESP_BT_MODE_IDLE) { + return ESP_ERR_INVALID_STATE; + } + osi_funcs_p = (struct osi_funcs_t *)malloc_internal_wrapper(sizeof(struct osi_funcs_t)); if (osi_funcs_p == NULL) { return ESP_ERR_NO_MEM; @@ -1190,11 +1195,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) return ESP_ERR_INVALID_STATE; } - //if all the bt available memory was already released, cannot initialize bluetooth controller - if (btdm_dram_available_region[0].mode == ESP_BT_MODE_IDLE) { - return ESP_ERR_INVALID_STATE; - } - if (cfg == NULL) { return ESP_ERR_INVALID_ARG; }