mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(ble_log): ensure BLE Log IRAM functions are placed in IRAM on ESP32C2
On ESP32C2 with BT_CTRL_RUN_IN_FLASH_ONLY, the bt_default linker scheme
routes .iram1 sections to flash_text, causing BLE_LOG_IRAM_ATTR functions
to end up in flash instead of IRAM. Define a dedicated .ble_log_iram1
section for ESP32C2 and route it to iram0_bt_text unconditionally.
(cherry picked from commit a9b93ca0e5)
Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
This commit is contained in:
@@ -37,7 +37,11 @@
|
|||||||
#define BLE_LOG_INLINE inline
|
#define BLE_LOG_INLINE inline
|
||||||
|
|
||||||
/* Section */
|
/* Section */
|
||||||
|
#if defined(CONFIG_IDF_TARGET_ESP32C2)
|
||||||
|
#define BLE_LOG_IRAM_ATTR _SECTION_ATTR_IMPL(".ble_log_iram1", __COUNTER__)
|
||||||
|
#else
|
||||||
#define BLE_LOG_IRAM_ATTR IRAM_ATTR
|
#define BLE_LOG_IRAM_ATTR IRAM_ATTR
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Memory operation */
|
/* Memory operation */
|
||||||
#define BLE_LOG_MEM_CAP (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT | MALLOC_CAP_DMA)
|
#define BLE_LOG_MEM_CAP (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT | MALLOC_CAP_DMA)
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ entries:
|
|||||||
entries:
|
entries:
|
||||||
.sleep_iram1+
|
.sleep_iram1+
|
||||||
|
|
||||||
|
[sections:bt_ble_log_iram_text]
|
||||||
|
entries:
|
||||||
|
.ble_log_iram1+
|
||||||
|
|
||||||
[sections:bt_bss]
|
[sections:bt_bss]
|
||||||
entries:
|
entries:
|
||||||
.bss+
|
.bss+
|
||||||
@@ -33,6 +37,7 @@ entries:
|
|||||||
entries:
|
entries:
|
||||||
if BT_CTRL_RUN_IN_FLASH_ONLY = y:
|
if BT_CTRL_RUN_IN_FLASH_ONLY = y:
|
||||||
bt_iram_text -> flash_text
|
bt_iram_text -> flash_text
|
||||||
|
bt_ble_log_iram_text -> iram0_bt_text
|
||||||
bt_bss -> dram0_bt_bss
|
bt_bss -> dram0_bt_bss
|
||||||
bt_common -> dram0_bt_bss
|
bt_common -> dram0_bt_bss
|
||||||
bt_data -> dram0_bt_data
|
bt_data -> dram0_bt_data
|
||||||
@@ -49,6 +54,7 @@ entries:
|
|||||||
bt_sleep_iram_text -> flash_text
|
bt_sleep_iram_text -> flash_text
|
||||||
else:
|
else:
|
||||||
bt_iram_text -> iram0_bt_text
|
bt_iram_text -> iram0_bt_text
|
||||||
|
bt_ble_log_iram_text -> iram0_bt_text
|
||||||
bt_bss -> dram0_bt_bss
|
bt_bss -> dram0_bt_bss
|
||||||
bt_common -> dram0_bt_bss
|
bt_common -> dram0_bt_bss
|
||||||
bt_data -> dram0_bt_data
|
bt_data -> dram0_bt_data
|
||||||
|
|||||||
Reference in New Issue
Block a user