Skip to content

Commit

Permalink
Merge branch 'bugfix/btdm_modify_throught_demo_default_config_v3.1' i…
Browse files Browse the repository at this point in the history
…nto 'release/v3.1'

Component/bt: modify throughput demo default config for v3.1

See merge request idf/esp-idf!2600
  • Loading branch information
jack0c committed Jun 24, 2018
2 parents c59f768 + 6c87d10 commit 21fd581
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/bt/bluedroid/api/esp_gatts_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id,
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);

if (L2CA_CheckIsCongest(L2CAP_ATT_CID, conn_id)) {
LOG_ERROR("%s, the l2cap chanel is congest.", __func__);
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
return ESP_FAIL;
}

Expand Down
2 changes: 1 addition & 1 deletion components/bt/bluedroid/stack/gatt/att_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ tGATT_STATUS attp_send_msg_to_l2cap(tGATT_TCB *p_tcb, BT_HDR *p_toL2CAP)
}

if (l2cap_ret == L2CAP_DW_FAILED) {
GATT_TRACE_ERROR("ATT failed to pass msg:0x%0x to L2CAP",
GATT_TRACE_DEBUG("ATT failed to pass msg:0x%0x to L2CAP",
*((UINT8 *)(p_toL2CAP + 1) + p_toL2CAP->offset));
return GATT_INTERNAL_ERROR;
} else if (l2cap_ret == L2CAP_DW_CONGESTED) {
Expand Down
2 changes: 1 addition & 1 deletion components/bt/bluedroid/stack/l2cap/l2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ UINT16 L2CA_SendFixedChnlData (UINT16 fixed_cid, BD_ADDR rem_bda, BT_HDR *p_buf)

// If already congested, do not accept any more packets
if (p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent) {
L2CAP_TRACE_ERROR ("L2CAP - CID: 0x%04x cannot send, already congested\
L2CAP_TRACE_DEBUG ("L2CAP - CID: 0x%04x cannot send, already congested\
xmit_hold_q.count: %u buff_quota: %u", fixed_cid,
fixed_queue_length(p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q),
p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->buff_quota);
Expand Down
2 changes: 1 addition & 1 deletion components/bt/bluedroid/stack/l2cap/l2c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ UINT8 l2c_data_write (UINT16 cid, BT_HDR *p_data, UINT16 flags)

/* If already congested, do not accept any more packets */
if (p_ccb->cong_sent) {
L2CAP_TRACE_ERROR ("L2CAP - CID: 0x%04x cannot send, already congested xmit_hold_q.count: %u buff_quota: %u",
L2CAP_TRACE_DEBUG ("L2CAP - CID: 0x%04x cannot send, already congested xmit_hold_q.count: %u buff_quota: %u",
p_ccb->local_cid,
fixed_queue_length(p_ccb->xmit_hold_q),
p_ccb->buff_quota);
Expand Down
9 changes: 5 additions & 4 deletions examples/bluetooth/ble_throughput/throughput_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ ESP-IDF BLE throughput GATT CLIENT demo
========================

This is the demo used to test the BLE throughput, this demo should used with throughput server demo together.
The throughput of BLE can up to 720-767 bits/s between to ESP32 board.
The throughput of BLE can up to 720-767 Kbps between to ESP32 board.
Note:
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (make menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000));
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (make menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000)) and don't print too much log.
2. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput,
please set: make menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config ---> then select the 'test the gattc write throughput' option
3. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself.
4. Should change the CPU frequency to 240MHz in the make menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (240 MHz)
5. Should change the bluetooth controller and Bluedroid run in different Core in the make menuconfig --> Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU)) & Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU))
4. Should change the CPU frequency to 160MHZ or 240MHz in the make menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (240 MHz or 160 MHz).
5. Should change the bluetooth controller and Bluedroid run in different Core in the make menuconfig --> Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU)) & Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU)).
6. In order to maximize throughput, please test in a clean environment without many BLE devices working and both test devices are ESP32.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
CONFIG_BT_ENABLED=y
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=y
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=1
#
# Serial flasher config
#
CONFIG_MONITOR_BAUD_921600B=y
CONFIG_MONITOR_BAUD=921600
#
# ESP32-specific
#
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
CONFIG_CONSOLE_UART_BAUDRATE=921600
7 changes: 4 additions & 3 deletions examples/bluetooth/ble_throughput/throughput_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ ESP-IDF BLE throughput GATT SERVER demo
========================

This is the demo used to test the BLE throughput, this demo should used with throughput client demo together.
The throughput of BLE can up to 720-767 bits/s between to ESP32 board.
The throughput of BLE can up to 720-767 Kbps between to ESP32 board.
Note:
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (make menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000));
1. In order to maximize throughput, we need to set the uart print baud rate at 921600 or more (make menuconfig --> Component config --> ESP32-specific --> UART console baud rate --> 921600(or 1500000)) and don't print too much log;
2. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput,
please set: make menuconfig --> Component config --> Example 'GATT SERVER THROUGHPUT' Config ---> then select the 'test the gattc write throughput' option
3. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself.
4. Should change the CPU frequency to 240MHz in the make menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (240 MHz)
4. Should change the CPU frequency to 160MHz or 240MHz in the make menuconfig --> Component config ---> ESP32-specific ---> CPU frequency (160MHz or 240 MHz)
5. Should change the bluetooth controller and Bluedroid run in different Core in the make menuconfig --> Component config ---> Bluetooth ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU)) & Bluedroid Enable ---> The cpu core which Bluedroid run (Core 1 (APP CPU))
6. In order to maximize throughput, please test in a clean environment without many BLE devices working and both test devices are ESP32.

Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,6 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i
break;
case ESP_GATTS_CONF_EVT:
ESP_LOGI(GATTS_TAG, "ESP_GATTS_CONF_EVT, status %d", param->conf.status);
if (param->conf.status != ESP_GATT_OK){
esp_log_buffer_hex(GATTS_TAG, param->conf.value, param->conf.len);
}
#if (CONFIG_GATTC_WRITE_THROUGHPUT)
start_time = false;
current_time = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
CONFIG_BT_ENABLED=y
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=y
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=1
#
# Serial flasher config
#
CONFIG_MONITOR_BAUD_921600B=y
CONFIG_MONITOR_BAUD=921600
#
# ESP32-specific
#
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
CONFIG_CONSOLE_UART_BAUDRATE=921600

0 comments on commit 21fd581

Please sign in to comment.