Merge branch 'feature/test_for_ext_flash_HSPI_on_esp32s2' into 'master'

spi_flash: add unit tests for HSPI on esp32s2

See merge request espressif/esp-idf!10040
This commit is contained in:
Michael (XIAO Xufeng)
2020-10-12 10:06:49 +08:00

View File

@@ -149,7 +149,7 @@ flashtest_config_t config_list[] = {
// .speed = TEST_SPI_SPEED, // .speed = TEST_SPI_SPEED,
// .host_id = HSPI_HOST, // .host_id = HSPI_HOST,
// .cs_id = 0, // .cs_id = 0,
// // uses GPIO matrix on esp32s2 regardles if FORCE_GPIO_MATRIX // // uses GPIO matrix on esp32s2 regardless if FORCE_GPIO_MATRIX
// .cs_io_num = HSPI_PIN_NUM_CS, // .cs_io_num = HSPI_PIN_NUM_CS,
// .input_delay_ns = 20, // .input_delay_ns = 20,
// }, // },
@@ -174,16 +174,15 @@ flashtest_config_t config_list[] = {
.cs_io_num = FSPI_PIN_NUM_CS, .cs_io_num = FSPI_PIN_NUM_CS,
.input_delay_ns = 0, .input_delay_ns = 0,
}, },
// /* current runner doesn't have a flash on HSPI */ {
// { .io_mode = TEST_SPI_READ_MODE,
// .io_mode = TEST_SPI_READ_MODE, .speed = TEST_SPI_SPEED,
// .speed = TEST_SPI_SPEED, .host_id = HSPI_HOST,
// .host_id = HSPI_HOST, .cs_id = 0,
// .cs_id = 0, // uses GPIO matrix on esp32s2 regardless of FORCE_GPIO_MATRIX
// // uses GPIO matrix on esp32s2 regardles if FORCE_GPIO_MATRIX .cs_io_num = HSPI_PIN_NUM_CS,
// .cs_io_num = HSPI_PIN_NUM_CS, .input_delay_ns = 0,
// .input_delay_ns = 20, },
// },
}; };
#elif CONFIG_IDF_TARGET_ESP32S3 #elif CONFIG_IDF_TARGET_ESP32S3
flashtest_config_t config_list[] = { flashtest_config_t config_list[] = {
@@ -203,7 +202,7 @@ flashtest_config_t config_list[] = {
// .speed = TEST_SPI_SPEED, // .speed = TEST_SPI_SPEED,
// .host_id = HSPI_HOST, // .host_id = HSPI_HOST,
// .cs_id = 0, // .cs_id = 0,
// // uses GPIO matrix on esp32s2 regardles if FORCE_GPIO_MATRIX // // uses GPIO matrix on esp32s2 regardless if FORCE_GPIO_MATRIX
// .cs_io_num = HSPI_PIN_NUM_CS, // .cs_io_num = HSPI_PIN_NUM_CS,
// .input_delay_ns = 20, // .input_delay_ns = 20,
// }, // },
@@ -697,7 +696,6 @@ void test_permutations(flashtest_config_t* config)
write_large_buffer(chip, part, source_buf, length); write_large_buffer(chip, part, source_buf, length);
read_and_check(chip, part, source_buf, length); read_and_check(chip, part, source_buf, length);
teardown_test_chip(chip, cfg->host_id); teardown_test_chip(chip, cfg->host_id);
if (config->host_id != -1) { if (config->host_id != -1) {
esp_flash_speed_t speed = ESP_FLASH_SPEED_MIN; esp_flash_speed_t speed = ESP_FLASH_SPEED_MIN;
while (speed != ESP_FLASH_SPEED_MAX) { while (speed != ESP_FLASH_SPEED_MAX) {
@@ -707,16 +705,13 @@ void test_permutations(flashtest_config_t* config)
while (io_mode != SPI_FLASH_READ_MODE_MAX) { while (io_mode != SPI_FLASH_READ_MODE_MAX) {
cfg->io_mode = io_mode; cfg->io_mode = io_mode;
cfg->speed = speed; cfg->speed = speed;
setup_new_chip(cfg, &chip); if (io_mode > SPI_FLASH_FASTRD\
&& !SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(cfg->host_id)) {
spi_host_device_t host_id; io_mode++;
get_chip_host(chip, &host_id, NULL);
if (io_mode > SPI_FLASH_FASTRD
&& !SOC_SPI_PERIPH_SUPPORT_MULTILINE_MODE(host_id)) {
continue; continue;
} }
setup_new_chip(cfg, &chip);
ESP_LOGI(TAG, "test flash io mode: %d, speed: %d", io_mode, speed); ESP_LOGI(TAG, "test flash io mode: %d, speed: %d", io_mode, speed);
read_and_check(chip, part, source_buf, length); read_and_check(chip, part, source_buf, length);