Skip to content

Commit 31e3b1f

Browse files
authored
Merge branch 'espressif:release/v5.5' into release/v5.5
2 parents e6accf7 + 8d036f2 commit 31e3b1f

File tree

144 files changed

+7568
-6692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+7568
-6692
lines changed

components/bootloader/Kconfig.projbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ menu "Security features"
967967

968968
config SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA
969969
bool "Skip write-protection of SECURE_FLASH_PSEUDO_ROUND_FUNC_STRENGTH"
970-
default y if SECURE_FLASH_PSEUDO_ROUND_FUNC
970+
default y if SECURE_FLASH_PSEUDO_ROUND_FUNC && !SECURE_FLASH_ENCRYPTION_MODE_RELEASE
971971
default n
972972
depends on SOC_ECDSA_SUPPORT_CURVE_P384 && SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND
973973
help

components/bt/common/ble_log/Kconfig.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ config BLE_LOG_ENABLED
55
Enable BLE Log Module
66

77
if BLE_LOG_ENABLED
8+
config BLE_LOG_TASK_STACK_SIZE
9+
int "Stack size for BLE Log Task"
10+
default 1024 if IDF_TARGET_ARCH_RISCV
11+
default 2048 if IDF_TARGET_ARCH_XTENSA
12+
default 1024
13+
help
14+
Stack size for BLE Log Task
15+
816
config BLE_LOG_LBM_TRANS_SIZE
917
int "Buffer size for each peripheral transport"
1018
default 512

components/bt/common/ble_log/ble_log_spi_out.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@
4141
#define SPI_OUT_LOG_STR_BUF_SIZE (100)
4242
#define SPI_OUT_MALLOC(size) heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
4343
#define SPI_OUT_TASK_PRIORITY (ESP_TASK_PRIO_MAX - 1)
44+
45+
#if CONFIG_IDF_TARGET_ARCH_RISCV
4446
#define SPI_OUT_TASK_STACK_SIZE (1024)
47+
#elif CONFIG_IDF_TARGET_ARCH_XTENSA
48+
#define SPI_OUT_TASK_STACK_SIZE (2048)
49+
#else
50+
static_assert(false, "BLE Log SPI Out: Unsupported target architecture");
51+
#endif /* CONFIG_IDF_TARGET_ARCH_RISCV */
4552

4653
#if SPI_OUT_TS_SYNC_ENABLED
4754
#define SPI_OUT_TS_SYNC_TIMEOUT_MS (1000)
@@ -247,9 +254,9 @@ extern uint32_t r_ble_lll_timer_current_tick_get(void);
247254
#elif defined(CONFIG_IDF_TARGET_ESP32C2)
248255
extern uint32_t r_os_cputime_get32(void);
249256
#define SPI_OUT_GET_LC_TIME r_os_cputime_get32()
250-
// #elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
251-
// extern uint32_t lld_read_clock_us(void);
252-
// #define SPI_OUT_GET_LC_TIME lld_read_clock_us()
257+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
258+
extern uint32_t lld_read_clock_us(void);
259+
#define SPI_OUT_GET_LC_TIME lld_read_clock_us()
253260
#else
254261
#define SPI_OUT_GET_LC_TIME esp_timer_get_time()
255262
#endif
@@ -1365,12 +1372,13 @@ int ble_log_spi_out_hci_write(uint8_t source, const uint8_t *addr, uint16_t len)
13651372
return -1;
13661373
}
13671374

1368-
if (source == BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM) {
13691375
#if SPI_OUT_LL_ENABLED
1376+
if (source == BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM) {
13701377
ble_log_spi_out_ll_write(len, addr, 0, NULL, BIT(LL_LOG_FLAG_HCI_UPSTREAM));
1371-
#endif // SPI_OUT_LL_ENABLED
13721378
}
1373-
if (source == BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM) {
1379+
if (source == BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM)
1380+
#endif /* SPI_OUT_LL_ENABLED */
1381+
{
13741382
spi_out_log_cb_t *log_cb;
13751383
bool fallback = false;
13761384
if (!spi_out_get_task_mapping(LOG_MODULE_TASK_MAP(hci),

components/bt/common/ble_log/src/internal_include/ble_log_rt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/* MACRO */
2323
#define BLE_LOG_TASK_PRIO (ESP_TASK_PRIO_MAX - 1)
24-
#define BLE_LOG_TASK_STACK_SIZE (1024)
24+
#define BLE_LOG_TASK_STACK_SIZE CONFIG_BLE_LOG_TASK_STACK_SIZE
2525
#define BLE_LOG_TASK_HOOK_TIMEOUT_MS (1000)
2626

2727
/* INTERFACE */

components/bt/common/osi/allocator.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,5 @@ void *osi_calloc_func(size_t size)
241241

242242
void osi_free_func(void *ptr)
243243
{
244-
#if HEAP_MEMORY_DEBUG
245-
osi_mem_dbg_clean(ptr, __func__, __LINE__);
246-
#endif
247-
free(ptr);
244+
osi_free(ptr);
248245
}

components/bt/controller/esp32c3/Kconfig.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,15 +616,15 @@ menu "Controller debug log Options (Experimental)"
616616

617617
config BT_CTRL_LE_LOG_MODE_EN
618618
depends on BT_CTRL_LE_LOG_EN
619-
int "Enable log for specified BLE mode"
620-
range 0 4095
621-
default 4093
619+
hex "Enable log for specified BLE mode"
620+
range 0 0xFFFF
621+
default 0xDB7F
622622

623623
config BT_CTRL_LE_LOG_LEVEL
624624
depends on BT_CTRL_LE_LOG_EN
625625
int "The level of BLE log"
626626
range 0 5
627-
default 2
627+
default 1
628628

629629
config BT_CTRL_LE_LOG_BUF1_SIZE
630630
depends on BT_CTRL_LE_LOG_EN

components/bt/controller/esp32c3/bt.c

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ struct osi_funcs_t {
241241
};
242242

243243
#if CONFIG_BT_CTRL_LE_LOG_EN
244-
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
244+
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
245+
246+
enum {
247+
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
248+
BLE_LOG_INTERFACE_FLAG_END,
249+
};
245250
#endif // CONFIG_BT_CTRL_LE_LOG_EN
246251

247252
/* External functions or values
@@ -304,11 +309,14 @@ extern void btdm_aa_check_enhance_enable(void);
304309

305310
/* BLE Log module */
306311
#if CONFIG_BT_CTRL_LE_LOG_EN
312+
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
313+
extern void r_ble_log_deinit_simple(void);
307314
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
308315
extern int r_ble_log_deinit_async(void);
309316
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
310317
extern void r_ble_log_async_output_dump_all(bool output);
311318
extern void esp_panic_handler_feed_wdts(void);
319+
extern int r_ble_log_ctrl_level_and_mod(uint8_t level, uint32_t mod_en);
312320
#endif // CONFIG_BT_CTRL_LE_LOG_EN
313321
#if (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED)
314322
extern void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
@@ -399,12 +407,13 @@ static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end);
399407
static void bt_controller_deinit_internal(void);
400408

401409
#if CONFIG_BT_CTRL_LE_LOG_EN
402-
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
410+
#if !CONFIG_BT_CTRL_LE_LOG_MODE_BLE_LOG_V2
403411
#if CONFIG_BT_CTRL_LE_LOG_STORAGE_EN
404412
void esp_bt_read_ctrl_log_from_flash(bool output);
405413
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end);
406414
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
407-
#endif // #if CONFIG_BT_CTRL_LE_LOG_STORAGE_EN
415+
#endif // CONFIG_BT_CTRL_LE_LOG_STORAGE_EN
416+
#endif // !CONFIG_BT_CTRL_LE_LOG_MODE_BLE_LOG_V2
408417
#endif // CONFIG_BT_CTRL_LE_LOG_EN
409418

410419
/* Local variable definition
@@ -538,18 +547,14 @@ static bool is_filled = false;
538547
#endif // CONFIG_BT_CTRL_LE_LOG_STORAGE_EN
539548

540549
#if CONFIG_BT_CTRL_LE_LOG_MODE_BLE_LOG_V2
541-
static IRAM_ATTR void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
542-
{
543-
ble_log_write_hex_ll(len, addr, 0, NULL, 0);
544-
}
545-
546550
void esp_ble_controller_log_dump_all(bool output)
547551
{
548552
ble_log_dump_to_console();
549553
}
550554
#else /* !CONFIG_BT_CTRL_LE_LOG_MODE_BLE_LOG_V2 */
551-
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
555+
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
552556
{
557+
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
553558
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
554559
#if CONFIG_BT_CTRL_LE_LOG_STORAGE_EN
555560
esp_bt_controller_log_storage(len, addr, end);
@@ -558,24 +563,19 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
558563
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
559564
portENTER_CRITICAL_SAFE(&spinlock);
560565
esp_panic_handler_feed_wdts();
561-
for (int i = 0; i < len; i++) {
562-
esp_rom_printf("%02x ", addr[i]);
563-
}
564566

565-
if (end) {
566-
esp_rom_printf("\n");
567+
if (len && addr) {
568+
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
569+
}
570+
if (len_append && addr_append) {
571+
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
567572
}
573+
if (end) { esp_rom_printf("\n"); }
574+
568575
portEXIT_CRITICAL_SAFE(&spinlock);
569576
}
570577
}
571578

572-
#if CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
573-
static IRAM_ATTR void esp_bt_controller_spi_log_interface(uint32_t len, const uint8_t *addr, bool end)
574-
{
575-
ble_log_spi_out_ll_write(len, addr, 0, NULL, 0);
576-
}
577-
#endif // CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
578-
579579
void esp_ble_controller_log_dump_all(bool output)
580580
{
581581
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
@@ -612,16 +612,13 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
612612
}
613613

614614
esp_err_t ret = ESP_OK;
615-
uint8_t buffers = 0;
616615

617-
#if CONFIG_BT_CTRL_LE_LOG_EN
618-
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
619-
#endif // CONFIG_BT_CTRL_LE_LOG_EN
620-
#if CONFIG_BT_CTRL_LE_HCI_LOG_EN
621-
buffers |= ESP_BLE_LOG_BUF_HCI;
622-
#endif // CONFIG_BT_CTRL_LE_HCI_LOG_EN
616+
ret = r_ble_log_init_simple(ble_log_write_hex_ll, NULL);
617+
if (ret != ESP_OK) {
618+
return ret;
619+
}
623620

624-
ret = r_ble_log_init_async(esp_bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
621+
ret = r_ble_log_ctrl_level_and_mod(BLE_LOG_LEVEL, BLE_LOG_MODE_EN);
625622
if (ret == ESP_OK) {
626623
log_is_inited = true;
627624
}
@@ -664,14 +661,19 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
664661
case LOG_SPI_OUT:
665662
task_create = true;
666663
#if CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
667-
bt_controller_log_interface = esp_bt_controller_spi_log_interface;
664+
bt_controller_log_interface = ble_log_spi_out_ll_write;
668665
#endif // CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
669666
break;
670667
default:
671668
assert(0);
672669
}
673670

674671
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
672+
if (ret != ESP_OK) {
673+
return ret;
674+
}
675+
676+
ret = r_ble_log_ctrl_level_and_mod(BLE_LOG_LEVEL, BLE_LOG_MODE_EN);
675677
if (ret == ESP_OK) {
676678
log_is_inited = true;
677679
}

components/bt/esp_ble_mesh/core/bluedroid_host/adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void bt_mesh_ble_ext_adv_report(tBTM_BLE_EXT_ADV_REPORT *ext_adv_report)
223223
memcpy(adv_rpt.dir_addr, ext_adv_report->dir_addr, BLE_MESH_ADDR_LEN);
224224

225225
adv_rpt.addr_type = ext_adv_report->addr_type;
226-
adv_rpt.data = ext_adv_report->adv_data;
226+
adv_rpt.data = ext_adv_report->adv_data_len ? ext_adv_report->adv_data : NULL;
227227
adv_rpt.length = ext_adv_report->adv_data_len;
228228
adv_rpt.rssi = ext_adv_report->rssi;
229229
adv_rpt.event_type = ext_adv_report->event_type;

components/bt/esp_ble_mesh/core/nimble_host/adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ void bt_mesh_ble_ext_adv_report(struct ble_gap_ext_disc_desc *desc)
474474

475475
/* Here, only a shallow copy needs to be implemented;
476476
* deep copying behavior occurs in btc_ble_mesh_ble_copy_req_data. */
477-
adv_rpt.data = desc->data;
477+
adv_rpt.data = desc->length_data ? desc->data : NULL;
478478

479479
adv_rpt.event_type = desc->props;
480480
adv_rpt.addr_type = desc->addr.type;

0 commit comments

Comments
 (0)