Merge branch 'feat/ble-log-iram-optim_v5.3' into 'release/v5.3'

opt(bt): Move SPI Tx Callback to Flash When SPI ISR IN IRAM Disabled (5.3)

See merge request espressif/esp-idf!48921
This commit is contained in:
Island
2026-06-05 15:50:51 +08:00
2 changed files with 9 additions and 4 deletions

View File

@@ -17,8 +17,7 @@ if BLE_LOG_ENABLED
config BLE_LOG_LBM_TRANS_BUF_SIZE
int "Total buffer memory per common LBM (bytes)"
default 2048 if BT_BLUEDROID_ENABLED
default 4096 if BT_NIMBLE_ENABLED
default 2048
help
Total buffer memory allocated for each common pool log buffer
manager (LBM). This memory is divided equally among internal

View File

@@ -20,6 +20,12 @@
#define BLE_LOG_SPI_DMA_ALIGN_BYTES (4U)
#define BLE_LOG_SPI_ALIGN_LOG_PERIOD (256U)
#if CONFIG_SPI_MASTER_ISR_IN_IRAM
#define BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_IRAM_ATTR
#else
#define BLE_LOG_SPI_MASTER_DMA_CB_ATTR
#endif
/* VARIABLE */
BLE_LOG_STATIC bool prph_inited = false;
BLE_LOG_STATIC spi_device_handle_t dev_handle = NULL;
@@ -30,7 +36,7 @@ BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans);
BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans);
/* PRIVATE FUNCTION */
BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans)
BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans)
{
/* SPI slave performance issue workaround */
last_tx_done_ts = esp_timer_get_time();
@@ -43,7 +49,7 @@ BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_
__atomic_store_n(&trans->prph_owned, false, __ATOMIC_RELEASE);
}
BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans)
BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans)
{
/* SPI slave performance issue workaround */
while ((esp_timer_get_time() - last_tx_done_ts) < BLE_LOG_SPI_TRANS_ITVL_MIN_US) {}