Merge branch 'bugfix/fix_spi_master_iram_safe_env' into 'master'

spi_master: fix whole master driver iram safe enviroenment

Closes IDF-6848

See merge request espressif/esp-idf!22401
This commit is contained in:
Wan Lei
2023-02-24 14:54:03 +08:00
10 changed files with 161 additions and 27 deletions
@@ -541,6 +541,10 @@ Cache Miss
The default config puts only the ISR into the IRAM. Other SPI related functions, including the driver itself and the callback, might suffer from cache misses and will need to wait until the code is read from flash. Select :ref:`CONFIG_SPI_MASTER_IN_IRAM` to put the whole SPI driver into IRAM and put the entire callback(s) and its callee functions into IRAM to prevent cache misses.
.. note::
SPI driver implementation is based on FreeRTOS APIs, to use :ref:`CONFIG_SPI_MASTER_IN_IRAM`, you should not enable :ref:`CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH`.
For an interrupt transaction, the overall cost is *20+8n/Fspi[MHz]* [us] for n bytes transferred in one transaction. Hence, the transferring speed is: *n/(20+8n/Fspi)*. An example of transferring speed at 8 MHz clock speed is given in the following table.
+-----------+----------------------+--------------------+------------+-------------+