refactor(spi_flash): optimize flash functions to save iram memory

This commit is contained in:
C.S.M
2025-02-26 18:28:49 +08:00
parent 8014ffa225
commit b66e140fbc
11 changed files with 139 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytest_embedded import Dut

View File

@@ -206,7 +206,10 @@ TEST_CASE("flash suspend test", "[spi_flash][suspend]")
ESP_LOGI(TAG, "During Erase, ISR interval time:\n\t\t%0.2f us", GET_US_BY_CCOUNT(s_isr_interval_time / (times - 1)));
ESP_LOGI(TAG, "The tsus value which passes the test is:\n\t\t%ld us", isr_interval_time - isr_duration_time);
// 15 stands for threshold. We allow the interval time minus duration time is little bit larger than TSUS value
#if CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM
// Don't check the performance because it should be slow.
TEST_ASSERT_LESS_THAN(CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US + 15, isr_interval_time - isr_duration_time);
#endif
ESP_LOGI(TAG, "Reasonable value!");
ESP_LOGI(TAG, "Finish");

View File

@@ -11,6 +11,7 @@ from pytest_embedded import Dut
[
'release',
'i2c_isr_flash',
'text_in_flash_when_suspend',
],
indirect=True,
)

View File

@@ -0,0 +1,2 @@
CONFIG_SPI_FLASH_AUTO_SUSPEND=y
CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=n