Compare commits

...

11 Commits

Author SHA1 Message Date
Rahul Tank
8ea69f25e1 Merge branch 'feat/added_change_to_ble_spp_client_v5.1' into 'release/v5.1'
feat(nimble): Allow BLE SPP Client to subscribe to the server (v5.1)

See merge request espressif/esp-idf!37458
2025-03-05 17:59:59 +08:00
Island
9ca83ba4f4 Merge branch 'bugfix/fix_ble_kconfig_v5.1' into 'release/v5.1'
fix(ble/controller): Fix BLE Kconfig on ESP32 to avoid unexpected behavior (v5.1)

See merge request espressif/esp-idf!37419
2025-03-05 15:08:12 +08:00
Rahul Tank
fbec1c0964 Merge branch 'bugfix/fix_link_estab_compile_failure_v5.1' into 'release/v5.1'
fix(nimble): Handle probable release breaking change (v5.1)

See merge request espressif/esp-idf!37437
2025-03-05 14:56:02 +08:00
Shreeyash
d10462be9b feat(nimble): Allow BLE SPP Client to subscribe to the server 2025-03-05 11:43:43 +05:30
morris
7ee30e144b Merge branch 'fix/build_when_rom_patch_disable_v5.1' into 'release/v5.1'
fix(spi_flash): Fix build fail when rom_patch config disabled (backport v5.1)

See merge request espressif/esp-idf!37107
2025-03-05 10:12:07 +08:00
Wang Meng Yang
28035c9873 Merge branch 'bugfix/spp_mem_leak_v5.1' into 'release/v5.1'
fix(bt/bluedroid): fixed memory leaks in SPP callback mode (v5.1)

See merge request espressif/esp-idf!37388
2025-03-05 09:09:21 +08:00
C.S.M
3d30cae7d3 refactor(spi_flash): remove redundent flash suspend check 2025-03-04 13:18:30 +08:00
C.S.M
d14a627f2f fix(spi_flash): Fix build fail when rom_patch config disabled,
Closes https://github.com/espressif/esp-idf/issues/15229
2025-03-04 13:18:30 +08:00
Rahul Tank
e620fddc85 fix(nimble): Handle probable release breaking change
link_estab event may be handled by customers in application and the previous would break it.
Revert few changes so as to not break the customer's code
2025-03-03 12:47:09 +05:30
zhanghaipeng
5fc7854542 fix(ble/controller): Fix BLE Kconfig on ESP32 to avoid unexpected behavior 2025-03-03 11:19:07 +08:00
Jin Cheng
674036910a fix(bt/bluedroid): fixed memory leaks in SPP callback mode 2025-02-28 16:16:02 +08:00
7 changed files with 37 additions and 11 deletions

View File

@ -491,7 +491,7 @@ config BTDM_BLE_VS_QA_SUPPORT
This enables BLE vendor HCI command and event for QA. This enables BLE vendor HCI command and event for QA.
config BTDM_CTRL_CONTROLLER_DEBUG_MODE_1 config BTDM_CTRL_CONTROLLER_DEBUG_MODE_1
bool "Enable Bluetooth controller debugging mode 1 (for internal use only)" if n bool "Enable Bluetooth controller debugging mode 1 (for internal use only)"
default n default n
depends on BT_ENABLED depends on BT_ENABLED
help help

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -909,6 +909,9 @@ static void btc_spp_write(btc_spp_args_t *arg)
} else { } else {
if (fixed_queue_enqueue(slot->tx.queue, arg->write.p_data, 0)) { if (fixed_queue_enqueue(slot->tx.queue, arg->write.p_data, 0)) {
BTA_JvRfcommWrite(arg->write.handle, slot->id, arg->write.len, arg->write.p_data); BTA_JvRfcommWrite(arg->write.handle, slot->id, arg->write.len, arg->write.p_data);
// The TX queue of SPP will handle this memory properly.
// Set it to NULL here to prevent deep free handler from releasing it.
arg->write.p_data = NULL;
} else { } else {
ret = ESP_SPP_NO_RESOURCE; ret = ESP_SPP_NO_RESOURCE;
} }
@ -966,6 +969,13 @@ void btc_spp_arg_deep_free(btc_msg_t *msg)
case BTC_SPP_ACT_START_DISCOVERY: case BTC_SPP_ACT_START_DISCOVERY:
if (arg->start_discovery.p_uuid_list) { if (arg->start_discovery.p_uuid_list) {
osi_free(arg->start_discovery.p_uuid_list); osi_free(arg->start_discovery.p_uuid_list);
arg->start_discovery.p_uuid_list = NULL;
}
break;
case BTC_SPP_ACT_WRITE:
if (arg->write.p_data) {
osi_free(arg->write.p_data);
arg->write.p_data = NULL;
} }
break; break;
default: default:

@ -1 +1 @@
Subproject commit 56bb929ce7c8dba24a0d60493e0627f0fb3f20b5 Subproject commit 4ebc169ca60071f4bfe35b992d3a770bbd86d36e

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -18,8 +18,6 @@
#define SPI_IDX 1 #define SPI_IDX 1
#if CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32
extern esp_rom_spiflash_chip_t g_rom_spiflash_chip; extern esp_rom_spiflash_chip_t g_rom_spiflash_chip;
@ -105,6 +103,12 @@ __attribute__((__unused__)) esp_rom_spiflash_result_t esp_rom_spiflash_clear_bp(
} }
esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void) __attribute__((alias("esp_rom_spiflash_clear_bp"))); esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void) __attribute__((alias("esp_rom_spiflash_clear_bp")));
#endif // CONFIG_IDF_TARGET_ESP32
#if CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
#if CONFIG_IDF_TARGET_ESP32
static esp_rom_spiflash_result_t esp_rom_spiflash_enable_write(esp_rom_spiflash_chip_t *spi); static esp_rom_spiflash_result_t esp_rom_spiflash_enable_write(esp_rom_spiflash_chip_t *spi);
//only support spi1 //only support spi1

View File

@ -829,11 +829,6 @@ esp_err_t spi_flash_common_set_io_mode(esp_flash_t *chip, esp_flash_wrsr_func_t
esp_err_t spi_flash_chip_generic_suspend_cmd_conf(esp_flash_t *chip) esp_err_t spi_flash_chip_generic_suspend_cmd_conf(esp_flash_t *chip)
{ {
// Only XMC support auto-suspend
if (chip->chip_id >> 16 != 0x20) {
ESP_EARLY_LOGE(TAG, "The flash you use doesn't support auto suspend, only \'XMC\' is supported");
return ESP_ERR_NOT_SUPPORTED;
}
spi_flash_sus_cmd_conf sus_conf = { spi_flash_sus_cmd_conf sus_conf = {
.sus_mask = 0x80, .sus_mask = 0x80,
.cmd_rdsr = CMD_RDSR2, .cmd_rdsr = CMD_RDSR2,

View File

@ -0,0 +1 @@
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=n

View File

@ -67,11 +67,27 @@ static void
ble_spp_client_set_handle(const struct peer *peer) ble_spp_client_set_handle(const struct peer *peer)
{ {
const struct peer_chr *chr; const struct peer_chr *chr;
const struct peer_dsc *dsc;
uint8_t value[2];
chr = peer_chr_find_uuid(peer, chr = peer_chr_find_uuid(peer,
BLE_UUID16_DECLARE(GATT_SPP_SVC_UUID), BLE_UUID16_DECLARE(GATT_SPP_SVC_UUID),
BLE_UUID16_DECLARE(GATT_SPP_CHR_UUID)); BLE_UUID16_DECLARE(GATT_SPP_CHR_UUID));
attribute_handle[peer->conn_handle] = chr->chr.val_handle; attribute_handle[peer->conn_handle] = chr->chr.val_handle;
MODLOG_DFLT(INFO, "attribute_handle %x\n", attribute_handle[peer->conn_handle]);
dsc = peer_dsc_find_uuid(peer,
BLE_UUID16_DECLARE(GATT_SPP_SVC_UUID),
BLE_UUID16_DECLARE(GATT_SPP_CHR_UUID),
BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16));
if (dsc == NULL) {
MODLOG_DFLT(ERROR, "Error: Peer lacks a CCCD for the subscribable characteristic\n");
return;
}
value[0] = 1;
value[1] = 0;
ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle,
value, sizeof(value), NULL, NULL);
} }