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:
Zhou Xiao
2026-04-14 13:13:47 +08:00
parent 6a16b680fc
commit 9a3b71f6cd
2 changed files with 10 additions and 0 deletions
@@ -37,7 +37,11 @@
#define BLE_LOG_INLINE inline
/* 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
#endif
/* Memory operation */
#define BLE_LOG_MEM_CAP (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT | MALLOC_CAP_DMA)