diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 345e0275ec..1a8e5e89a9 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -656,6 +656,12 @@ UT_C3_I2C: - ESP32C3_IDF - UT_T2_I2C +UT_C3_FLASH_SUSPEND: + extends: .unit_test_esp32c3_template + tags: + - ESP32C3_IDF + - UT_T1_Flash_Suspend + .integration_test_template: extends: - .target_test_job_template diff --git a/components/spi_flash/test/test_esp_flash.c b/components/spi_flash/test/test_esp_flash.c index d61294040a..3d65572488 100644 --- a/components/spi_flash/test/test_esp_flash.c +++ b/components/spi_flash/test/test_esp_flash.c @@ -664,7 +664,11 @@ static void test_flash_suspend_resume(const esp_partition_t* part) vTaskDelay(200); } -FLASH_TEST_CASE("SPI flash suspend and resume test", test_flash_suspend_resume); +TEST_CASE("SPI flash suspend and resume test", "[esp_flash][test_env=UT_T1_Flash_Suspend]") +{ + flash_test_func(test_flash_suspend_resume, 1 /* first index reserved for main flash */ ); +} + #endif //CONFIG_SPI_FLASH_AUTO_SUSPEND static void test_write_protection(const esp_partition_t* part) @@ -920,8 +924,8 @@ FLASH_TEST_CASE_3("Test esp_flash_write large RAM buffer", test_write_large_ram_ static void write_large_buffer(const esp_partition_t *part, const uint8_t *source, size_t length) { esp_flash_t* chip = part->flash_chip; - printf("Writing chip %p %p, %d bytes from source %p\n", chip, (void*)part->address, length, source); + printf("Writing chip %p %p, %d bytes from source %p\n", chip, (void*)part->address, length, source); ESP_ERROR_CHECK( esp_flash_erase_region(chip, part->address, (length + SPI_FLASH_SEC_SIZE) & ~(SPI_FLASH_SEC_SIZE - 1)) ); // note writing to unaligned address diff --git a/tools/unit-test-app/configs/spi_flash_suspend b/tools/unit-test-app/configs/spi_flash_suspend new file mode 100644 index 0000000000..c021dcbfa5 --- /dev/null +++ b/tools/unit-test-app/configs/spi_flash_suspend @@ -0,0 +1,3 @@ +CONFIG_IDF_TARGET="esp32c3" +TEST_COMPONENTS=spi_flash +CONFIG_SPI_FLASH_AUTO_SUSPEND=y