Skip to content

Commit

Permalink
Merge branch 'bugfix/ble_update_lib_20231201_v5.2' into 'release/v5.2'
Browse files Browse the repository at this point in the history
update lib on release/v5.2

See merge request espressif/esp-idf!27588
  • Loading branch information
Isl2017 committed Dec 22, 2023
2 parents 0056ab4 + 5c72943 commit 4e09c6e
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 24 deletions.
29 changes: 25 additions & 4 deletions components/bt/controller/esp32c2/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task

config BT_LE_CONTROLLER_LOG_ENABLED
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Expand All @@ -264,21 +264,42 @@ config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
Enable controller log module

config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
Enable hci log module

config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
Only operate in dump mode

config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the first BLE controller LOG buffer.

config BT_LE_LOG_CTRL_BUF2_SIZE
int "size of the second BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 1024
help
Configure the size of the second BLE controller LOG buffer.

config BT_LE_LOG_HCI_BUF_SIZE
int "size of the BLE HCI LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the BLE HCI LOG buffer.

config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
Expand Down
7 changes: 4 additions & 3 deletions components/bt/controller/esp32c2/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED


/* Types definition
************************************************************************
*/
Expand Down Expand Up @@ -127,6 +126,7 @@ extern int ble_controller_init(esp_bt_controller_config_t *cfg);
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_deinit_async(void);
extern void ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
Expand Down Expand Up @@ -201,7 +201,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;

#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {2048, 1024, 1024};
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

/* This variable tells if BLE is running */
Expand Down Expand Up @@ -1013,9 +1013,10 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b

void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock;
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;

portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
Expand Down
29 changes: 25 additions & 4 deletions components/bt/controller/esp32c6/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task

config BT_LE_CONTROLLER_LOG_ENABLED
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Expand All @@ -280,21 +280,42 @@ config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
Enable controller log module

config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
Enable hci log module

config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
Only operate in dump mode

config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the first BLE controller LOG buffer.

config BT_LE_LOG_CTRL_BUF2_SIZE
int "size of the second BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 1024
help
Configure the size of the second BLE controller LOG buffer.

config BT_LE_LOG_HCI_BUF_SIZE
int "size of the BLE HCI LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the BLE HCI LOG buffer.

config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
Expand Down
6 changes: 4 additions & 2 deletions components/bt/controller/esp32c6/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool
extern int ble_log_deinit_async(void);
extern void ble_log_async_select_dump_buffers(uint8_t buffers);
extern void ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
Expand Down Expand Up @@ -202,7 +203,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;

#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {6144, 1024, 2048};
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

/* This variable tells if BLE is running */
Expand Down Expand Up @@ -1185,9 +1186,10 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b

void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock;
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;

portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
Expand Down
29 changes: 25 additions & 4 deletions components/bt/controller/esp32h2/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task

config BT_LE_CONTROLLER_LOG_ENABLED
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Expand All @@ -271,21 +271,42 @@ config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
Enable controller log module

config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
Enable hci log module

config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
Only operate in dump mode

config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the first BLE controller LOG buffer.

config BT_LE_LOG_CTRL_BUF2_SIZE
int "size of the second BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 1024
help
Configure the size of the second BLE controller LOG buffer.

config BT_LE_LOG_HCI_BUF_SIZE
int "size of the BLE HCI LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the BLE HCI LOG buffer.

config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
Expand Down
6 changes: 4 additions & 2 deletions components/bt/controller/esp32h2/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool
extern int ble_log_deinit_async(void);
extern void ble_log_async_select_dump_buffers(uint8_t buffers);
extern void ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
Expand Down Expand Up @@ -196,7 +197,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;

#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {6144, 1024, 2048};
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

/* This variable tells if BLE is running */
Expand Down Expand Up @@ -1157,9 +1158,10 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b

void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock;
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;

portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32c2/esp32c2-bt-lib
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32c6/esp32c6-bt-lib
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32h2/esp32h2-bt-lib
4 changes: 2 additions & 2 deletions components/bt/include/esp32c2/include/esp_bt.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ typedef struct {
uint8_t cca_drop_mode; /*!< CCA drop mode */
int8_t cca_low_tx_pwr; /*!< Low TX power setting for CCA */
uint8_t main_xtal_freq; /*!< Main crystal frequency */
uint32_t version_num; /*!< Version number */
uint8_t version_num; /*!< Version number */
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
uint32_t config_magic; /*!< Configuration magic value */
} esp_bt_controller_config_t;
Expand Down Expand Up @@ -275,7 +275,7 @@ typedef struct {
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
.ble_scan_classify_filter_enable = 0, \
.main_xtal_freq = CONFIG_XTAL_FREQ, \
.version_num = efuse_hal_chip_revision(), \
.version_num = esp_ble_get_chip_rev_version(), \
.ignore_wl_for_direct_adv = 0, \
.config_magic = CONFIG_MAGIC, \
}
Expand Down
6 changes: 6 additions & 0 deletions components/bt/porting/npl/freertos/src/npl_os_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ npl_freertos_eventq_init(struct ble_npl_eventq *evq)
memset(eventq, 0, sizeof(*eventq));
eventq->q = xQueueCreate(ble_freertos_total_event_cnt, sizeof(struct ble_npl_eventq *));
BLE_LL_ASSERT(eventq->q);
} else {
eventq = (struct ble_npl_eventq_freertos*)evq->eventq;
xQueueReset(eventq->q);
}
#else
if(!evq->eventq) {
Expand All @@ -142,6 +145,9 @@ npl_freertos_eventq_init(struct ble_npl_eventq *evq)
memset(eventq, 0, sizeof(*eventq));
eventq->q = xQueueCreate(ble_freertos_total_event_cnt, sizeof(struct ble_npl_eventq *));
BLE_LL_ASSERT(eventq->q);
} else {
eventq = (struct ble_npl_eventq_freertos*)evq->eventq;
xQueueReset(eventq->q);
}
#endif
}
Expand Down

0 comments on commit 4e09c6e

Please sign in to comment.