From c11bb1ddd0b729594a565eaf153ea67fddef900f Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 10:39:13 +0800 Subject: [PATCH 01/10] change(ble): [AUTO_MR] Update lib_esp32h2 to 76549818 --- components/bt/controller/lib_esp32h2/esp32h2-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index a3192174a9..dcbae97062 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit a3192174a9aef015a9ceca983acdb9fd1a198445 +Subproject commit dcbae9706293e7c062a0b2b4a0bdddbd401f77a7 From 18bffab9b4adba3bce070f369d48cc406cbd5d5a Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 10:40:00 +0800 Subject: [PATCH 02/10] change(ble): [AUTO_MR] Update lib_esp32c5 to 76549818 --- components/bt/controller/lib_esp32c5/esp32c5-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib index 4ff56a052a..c107946baf 160000 --- a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib +++ b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib @@ -1 +1 @@ -Subproject commit 4ff56a052ab888be3b4abe548f86052fa314d10c +Subproject commit c107946bafb89d3239d724b74662537ee63313b3 From e2d1a5509ed86c6ed29af91aab2913e908c348e5 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 10:40:34 +0800 Subject: [PATCH 03/10] change(ble): [AUTO_MR] Update lib_esp32c6 to 76549818 --- components/bt/controller/lib_esp32c6/esp32c6-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index 246541ab93..73812a3edc 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit 246541ab93e853eba1591784a5253b219c0414f9 +Subproject commit 73812a3edcbc4f5b65d4ec381f82e32633482409 From 09467baed02d2cf4a23c6406bfe5eb50a8eb770e Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 10:41:09 +0800 Subject: [PATCH 04/10] change(ble): [AUTO_MR] Update lib_esp32c2 to fca2b9ea --- components/bt/controller/lib_esp32c2/esp32c2-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib index c0d98a9a03..a69fafcc0a 160000 --- a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib +++ b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib @@ -1 +1 @@ -Subproject commit c0d98a9a03c266828a25bed38c0174ecfc882aea +Subproject commit a69fafcc0a002a63f757bd4741a5d844d5e8dbf2 From ce4e012c8b925f3f330ebbe3813870d4be0eeb21 Mon Sep 17 00:00:00 2001 From: cjin Date: Fri, 11 Apr 2025 11:37:34 +0800 Subject: [PATCH 05/10] feat(ble): use new section for ble sleep on ESP32-C2 --- components/bt/controller/esp32c2/Kconfig.in | 5 +++++ components/bt/controller/esp32c2/bt.c | 17 +++++------------ components/bt/linker_esp32c2.lf | 9 +++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/components/bt/controller/esp32c2/Kconfig.in b/components/bt/controller/esp32c2/Kconfig.in index 00ea9b04bb..f4417f16a0 100644 --- a/components/bt/controller/esp32c2/Kconfig.in +++ b/components/bt/controller/esp32c2/Kconfig.in @@ -682,6 +682,11 @@ config BT_LE_PLACE_CONN_RELATED_INTO_IRAM depends on BT_CTRL_RUN_IN_FLASH_ONLY default n +config BT_LE_PLACE_SLEEP_RELATED_INTO_IRAM + bool + depends on BT_CTRL_RUN_IN_FLASH_ONLY && BT_LE_SLEEP_ENABLE + default y + config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS bool "Enable enhanced Access Address check in CONNECT_IND" default n diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index 2364eeb3a0..bd2cc4425e 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -592,13 +592,6 @@ static int esp_intr_free_wrapper(void **ret_handle) return rc; } -#if CONFIG_FREERTOS_USE_TICKLESS_IDLE -void sleep_modem_light_sleep_overhead_set(uint32_t overhead) -{ - esp_ble_set_wakeup_overhead(overhead); -} -#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ - modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void) { return s_bt_lpclk_src; @@ -613,7 +606,7 @@ void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src) s_bt_lpclk_src = clk_src; } -IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg) +void controller_sleep_cb(uint32_t enable_tick, void *arg) { if (!s_ble_active) { return; @@ -626,7 +619,7 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg) s_ble_active = false; } -IRAM_ATTR void controller_wakeup_cb(void *arg) +void controller_wakeup_cb(void *arg) { if (s_ble_active) { return; @@ -666,7 +659,7 @@ esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src) esp_sleep_enable_bt_wakeup(); ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer"); - rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set); + rc = esp_pm_register_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead); if (rc != ESP_OK) { goto error; } @@ -676,7 +669,7 @@ esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src) error: #if CONFIG_FREERTOS_USE_TICKLESS_IDLE esp_sleep_disable_bt_wakeup(); - esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set); + esp_pm_unregister_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead); #endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ /*lock should release first and then delete*/ if (s_pm_lock != NULL) { @@ -693,7 +686,7 @@ void controller_sleep_deinit(void) r_ble_rtc_wake_up_state_clr(); esp_sleep_disable_bt_wakeup(); esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO); - esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set); + esp_pm_unregister_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead); #endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE #ifdef CONFIG_PM_ENABLE /*lock should release first and then delete*/ diff --git a/components/bt/linker_esp32c2.lf b/components/bt/linker_esp32c2.lf index 75f0d59680..c9ab4c2e49 100644 --- a/components/bt/linker_esp32c2.lf +++ b/components/bt/linker_esp32c2.lf @@ -10,6 +10,10 @@ entries: entries: .conn_iram1+ +[sections:bt_sleep_iram_text] +entries: + .sleep_iram1+ + [sections:bt_bss] entries: .bss+ @@ -39,6 +43,10 @@ entries: else: bt_conn_iram_text -> flash_text bt_isr_iram_text -> flash_text + if BT_LE_PLACE_SLEEP_RELATED_INTO_IRAM = y: + bt_sleep_iram_text -> iram0_bt_text + else: + bt_sleep_iram_text -> flash_text else: bt_iram_text -> iram0_bt_text bt_bss -> dram0_bt_bss @@ -47,6 +55,7 @@ entries: bt_conn_iram_text -> iram0_bt_text bt_isr_iram_text -> iram0_bt_text + bt_sleep_iram_text -> iram0_bt_text # For the following fragments, order matters for # 'ALIGN(4) ALIGN(4, post) SURROUND(sym)', which generates: From 4937d3c8836b7958766d6169c542f4dab9b67a1d Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 1 Apr 2025 11:52:26 +0800 Subject: [PATCH 06/10] feat(ble): support configurable rxbuf opt feat on ESP32-H2 --- components/bt/controller/esp32h2/Kconfig.in | 4 ++++ components/bt/controller/esp32h2/ble.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/components/bt/controller/esp32h2/Kconfig.in b/components/bt/controller/esp32h2/Kconfig.in index b07e4783a8..524785e45f 100644 --- a/components/bt/controller/esp32h2/Kconfig.in +++ b/components/bt/controller/esp32h2/Kconfig.in @@ -822,3 +822,7 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX When this option is enabled, auxiliary packets will be present in the events of 'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0. If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0. + +config BT_LE_RXBUF_OPT_ENABLED + bool "Enable rxbuf optimization feature" + default y diff --git a/components/bt/controller/esp32h2/ble.c b/components/bt/controller/esp32h2/ble.c index caa8d85543..8aef45a9a8 100644 --- a/components/bt/controller/esp32h2/ble.c +++ b/components/bt/controller/esp32h2/ble.c @@ -44,6 +44,9 @@ void adv_stack_enableScanReqRxdVsEvent(bool en); void conn_stack_enableChanMapUpdCompVsEvent(bool en); void sleep_stack_enableWakeupVsEvent(bool en); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED +extern void mmgmt_enableRxbufOptFeature(void); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED /* Local functions definition *************************************************************************** @@ -137,6 +140,10 @@ int ble_stack_enable(void) ble_stack_enableVsEvents(true); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED + mmgmt_enableRxbufOptFeature(); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED + return 0; } From 5fbbec86551ac6d015045a5c5d6b2e293b8e9b1a Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 14 Apr 2025 11:35:20 +0800 Subject: [PATCH 07/10] feat(ble): support configurable rxbuf opt feat on ESP32-C6 --- components/bt/controller/esp32c6/Kconfig.in | 4 ++++ components/bt/controller/esp32c6/ble.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in index a9e59ae032..d0120d6f82 100644 --- a/components/bt/controller/esp32c6/Kconfig.in +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -818,3 +818,7 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX When this option is enabled, auxiliary packets will be present in the events of 'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0. If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0. + +config BT_LE_RXBUF_OPT_ENABLED + bool "Enable rxbuf optimization feature" + default y diff --git a/components/bt/controller/esp32c6/ble.c b/components/bt/controller/esp32c6/ble.c index f93f15e9b8..a1eb137489 100644 --- a/components/bt/controller/esp32c6/ble.c +++ b/components/bt/controller/esp32c6/ble.c @@ -47,6 +47,9 @@ void adv_stack_enableScanReqRxdVsEvent(bool en); void conn_stack_enableChanMapUpdCompVsEvent(bool en); void sleep_stack_enableWakeupVsEvent(bool en); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED +extern void mmgmt_enableRxbufOptFeature(void); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED /* Local functions definition *************************************************************************** @@ -143,6 +146,10 @@ int ble_stack_enable(void) ble_stack_enableVsEvents(true); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED + mmgmt_enableRxbufOptFeature(); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED + return 0; } From a5c32a5fb72709beeee206887b0b67105be54184 Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 14 Apr 2025 11:35:45 +0800 Subject: [PATCH 08/10] feat(ble): support configurable rxbuf opt feat on ESP32-C5 --- components/bt/controller/esp32c5/Kconfig.in | 4 ++++ components/bt/controller/esp32c5/ble.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/components/bt/controller/esp32c5/Kconfig.in b/components/bt/controller/esp32c5/Kconfig.in index fbd1269355..521860f8b4 100644 --- a/components/bt/controller/esp32c5/Kconfig.in +++ b/components/bt/controller/esp32c5/Kconfig.in @@ -784,3 +784,7 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX When this option is enabled, auxiliary packets will be present in the events of 'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0. If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0. + +config BT_LE_RXBUF_OPT_ENABLED + bool "Enable rxbuf optimization feature" + default y diff --git a/components/bt/controller/esp32c5/ble.c b/components/bt/controller/esp32c5/ble.c index caa8d85543..8aef45a9a8 100644 --- a/components/bt/controller/esp32c5/ble.c +++ b/components/bt/controller/esp32c5/ble.c @@ -44,6 +44,9 @@ void adv_stack_enableScanReqRxdVsEvent(bool en); void conn_stack_enableChanMapUpdCompVsEvent(bool en); void sleep_stack_enableWakeupVsEvent(bool en); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED +extern void mmgmt_enableRxbufOptFeature(void); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED /* Local functions definition *************************************************************************** @@ -137,6 +140,10 @@ int ble_stack_enable(void) ble_stack_enableVsEvents(true); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_RXBUF_OPT_ENABLED + mmgmt_enableRxbufOptFeature(); +#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED + return 0; } From 7c3b9fa56f8463f498a6fb8d4b72a6ed3dda7e85 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 13:59:05 +0800 Subject: [PATCH 09/10] change(ble): bugs fixed on spi ble log * removed spi master in iram select for flash only firmware * fixed memory issue in transaction init function * fixed memory issue in transaction deinit function --- components/bt/common/Kconfig.in | 1 - .../bt/common/ble_log/ble_log_spi_out.c | 28 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/components/bt/common/Kconfig.in b/components/bt/common/Kconfig.in index fb17bbb9ff..0f466d798d 100644 --- a/components/bt/common/Kconfig.in +++ b/components/bt/common/Kconfig.in @@ -9,7 +9,6 @@ config BT_ALARM_MAX_NUM config BT_BLE_LOG_SPI_OUT_ENABLED bool "Output ble logs to SPI bus (Experimental)" default n - select SPI_MASTER_IN_IRAM help Output ble logs to SPI bus diff --git a/components/bt/common/ble_log/ble_log_spi_out.c b/components/bt/common/ble_log/ble_log_spi_out.c index 992df1cb7c..9dd114cf03 100644 --- a/components/bt/common/ble_log/ble_log_spi_out.c +++ b/components/bt/common/ble_log/ble_log_spi_out.c @@ -140,14 +140,16 @@ static int spi_out_init_trans(spi_out_trans_cb_t **trans_cb, uint16_t buf_size) if (!(*trans_cb)) { return -1; } + memset(*trans_cb, 0, sizeof(spi_out_trans_cb_t)); + uint8_t *buf = (uint8_t *)spi_bus_dma_memory_alloc(SPI_OUT_BUS, (size_t)buf_size, 0); if (!buf) { free(*trans_cb); + *trans_cb = NULL; return -1; } // Initialization - memset(*trans_cb, 0, sizeof(spi_out_trans_cb_t)); (*trans_cb)->buf_size = buf_size; (*trans_cb)->trans.tx_buffer = buf; return 0; @@ -158,8 +160,13 @@ static void spi_out_deinit_trans(spi_out_trans_cb_t **trans_cb) if (!(*trans_cb)) { return; } + if ((*trans_cb)->trans.tx_buffer) { + // Do not free buffer until recycled + while ((*trans_cb)->flag == SPI_OUT_TRANS_CB_FLAG_IN_QUEUE) {} + free((uint8_t *)(*trans_cb)->trans.tx_buffer); + (*trans_cb)->trans.tx_buffer = NULL; + } - free((uint8_t *)(*trans_cb)->trans.tx_buffer); free(*trans_cb); *trans_cb = NULL; return; @@ -174,7 +181,7 @@ IRAM_ATTR static void spi_out_tx_done_cb(spi_transaction_t *ret_trans) IRAM_ATTR static inline int spi_out_append_trans(spi_out_trans_cb_t *trans_cb) { - if (trans_cb->flag != SPI_OUT_TRANS_CB_FLAG_NEED_QUEUE) { + if (trans_cb->flag != SPI_OUT_TRANS_CB_FLAG_NEED_QUEUE || !trans_cb->length) { return -1; } @@ -185,6 +192,8 @@ IRAM_ATTR static inline int spi_out_append_trans(spi_out_trans_cb_t *trans_cb) trans_cb->flag = SPI_OUT_TRANS_CB_FLAG_IN_QUEUE; return 0; } else { + trans_cb->length = 0; + trans_cb->flag = SPI_OUT_TRANS_CB_FLAG_AVAILABLE; return -1; } } @@ -224,6 +233,7 @@ static void spi_out_log_cb_deinit(spi_out_log_cb_t **log_cb) } } free(*log_cb); + *log_cb = NULL; return; } @@ -578,7 +588,7 @@ static void spi_out_ts_sync_deinit(void) } // CRITICAL: This function is called in ESP Timer task -IRAM_ATTR static void esp_timer_cb_ts_sync(void) +static void esp_timer_cb_ts_sync(void) { // Initialize variables uint32_t lc_ts = 0; @@ -627,7 +637,9 @@ int ble_log_spi_out_init(void) .quadwp_io_num = -1, .quadhd_io_num = -1, .max_transfer_sz = SPI_OUT_MAX_TRANSFER_SIZE, +#if CONFIG_SPI_MASTER_ISR_IN_IRAM .intr_flags = ESP_INTR_FLAG_IRAM +#endif // CONFIG_SPI_MASTER_ISR_IN_IRAM }; spi_device_interface_config_t dev_config = { .clock_speed_hz = SPI_MASTER_FREQ_20M, @@ -782,7 +794,7 @@ IRAM_ATTR void ble_log_spi_out_ll_log_ev_proc(void) } #endif // CONFIG_BT_BLE_LOG_SPI_OUT_LL_ENABLED -IRAM_ATTR int ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len) +int ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len) { if (!ul_log_inited) { return -1; @@ -798,7 +810,7 @@ IRAM_ATTR int ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_ return ret; } -IRAM_ATTR int ble_log_spi_out_printf(uint8_t source, const char *format, ...) +int ble_log_spi_out_printf(uint8_t source, const char *format, ...) { if (!ul_log_inited) { return -1; @@ -845,7 +857,7 @@ IRAM_ATTR int ble_log_spi_out_printf(uint8_t source, const char *format, ...) return ret; } -IRAM_ATTR int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...) +int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...) { if (!ul_log_inited) { return -1; @@ -897,7 +909,7 @@ IRAM_ATTR int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const ch return ret; } -IRAM_ATTR int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len) +int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len) { if (!ul_log_inited) { return -1; From ece108c0bfee179651cb0c563869a229e5fa123f Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Mon, 14 Apr 2025 17:10:42 +0800 Subject: [PATCH 10/10] fix(ble): remove null pointer assert in npl event deinit --- components/bt/porting/npl/freertos/src/npl_os_freertos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/bt/porting/npl/freertos/src/npl_os_freertos.c b/components/bt/porting/npl/freertos/src/npl_os_freertos.c index 9e5c9863c3..73f425262f 100644 --- a/components/bt/porting/npl/freertos/src/npl_os_freertos.c +++ b/components/bt/porting/npl/freertos/src/npl_os_freertos.c @@ -110,7 +110,9 @@ IRAM_ATTR npl_freertos_event_init(struct ble_npl_event *ev, ble_npl_event_fn *fn void IRAM_ATTR npl_freertos_event_deinit(struct ble_npl_event *ev) { - BLE_LL_ASSERT(ev->event); + if (!ev->event) { + return; + } #if OS_MEM_ALLOC os_memblock_put(&ble_freertos_ev_pool,ev->event); #else