From c4cccdedd0689e2e41903ea9c8365d9fea266ab6 Mon Sep 17 00:00:00 2001 From: Xiao Xufeng Date: Sat, 20 Apr 2024 00:56:01 +0800 Subject: [PATCH 1/4] fix(mmap): fixed spi_flash_cache2phys return addr in PSRAM issue When SPIRAM_FETCH_INSTRUCTIONS or SPIRAM_RODATA enabled --- components/spi_flash/flash_mmap.c | 89 ++++++++++++++++--------------- 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/components/spi_flash/flash_mmap.c b/components/spi_flash/flash_mmap.c index d7482f92b4..24a053c9ff 100644 --- a/components/spi_flash/flash_mmap.c +++ b/components/spi_flash/flash_mmap.c @@ -270,49 +270,6 @@ uint32_t spi_flash_mmap_get_free_pages(spi_flash_mmap_memory_t memory) return len / CONFIG_MMU_PAGE_SIZE; } - -size_t spi_flash_cache2phys(const void *cached) -{ - if (cached == NULL) { - return SPI_FLASH_CACHE2PHYS_FAIL; - } - - esp_err_t ret = ESP_FAIL; - uint32_t paddr = 0; - mmu_target_t target = 0; - -#if CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM //TODO: IDF-9049 - paddr = mmu_xip_psram_flash_vaddr_to_paddr(cached); - //SPI_FLASH_CACHE2PHYS_FAIL is UINT32_MAX - if (paddr != SPI_FLASH_CACHE2PHYS_FAIL) { - return paddr; - } -#endif - - ret = esp_mmu_vaddr_to_paddr((void *)cached, &paddr, &target); - if (ret != ESP_OK) { - return SPI_FLASH_CACHE2PHYS_FAIL; - } - - int offset = 0; - -#if !SOC_MMU_PER_EXT_MEM_TARGET //TODO: IDF-9049 -#if CONFIG_SPIRAM_RODATA - if ((uint32_t)cached >= (uint32_t)&_rodata_reserved_start && (uint32_t)cached <= (uint32_t)&_rodata_reserved_end) { - offset = rodata_flash2spiram_offset(); - } -#endif -#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS - if ((uint32_t)cached >= (uint32_t)&_instruction_reserved_start && (uint32_t)cached <= (uint32_t)&_instruction_reserved_end) { - offset = instruction_flash2spiram_offset(); - } -#endif -#endif //#if !SOC_MMU_PER_EXT_MEM_TARGET - - return paddr + offset * CONFIG_MMU_PAGE_SIZE; -} - - const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memory) { esp_err_t ret = ESP_FAIL; @@ -397,3 +354,49 @@ IRAM_ATTR bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length) return ret; } #endif //!CONFIG_SPI_FLASH_ROM_IMPL + +#if !CONFIG_SPI_FLASH_ROM_IMPL || CONFIG_SPIRAM_FETCH_INSTRUCTIONS || CONFIG_SPIRAM_RODATA +//The ROM implementation returns physical address of the PSRAM when the .text or .rodata is in the PSRAM. +//Always patch it when SPIRAM_FETCH_INSTRUCTIONS or SPIRAM_RODATA is set. +size_t spi_flash_cache2phys(const void *cached) +{ + if (cached == NULL) { + return SPI_FLASH_CACHE2PHYS_FAIL; + } + + esp_err_t ret = ESP_FAIL; + uint32_t paddr = 0; + mmu_target_t target = 0; + +#if CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM //TODO: IDF-9049 + paddr = mmu_xip_psram_flash_vaddr_to_paddr(cached); + //SPI_FLASH_CACHE2PHYS_FAIL is UINT32_MAX + if (paddr != SPI_FLASH_CACHE2PHYS_FAIL) { + return paddr; + } +#endif + + ret = esp_mmu_vaddr_to_paddr((void *)cached, &paddr, &target); + if (ret != ESP_OK) { + return SPI_FLASH_CACHE2PHYS_FAIL; + } + + int offset = 0; + +#if !SOC_MMU_PER_EXT_MEM_TARGET //TODO: IDF-9049 +#if CONFIG_SPIRAM_RODATA + if ((uint32_t)cached >= (uint32_t)&_rodata_reserved_start && (uint32_t)cached <= (uint32_t)&_rodata_reserved_end) { + offset = rodata_flash2spiram_offset(); + } +#endif +#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS + if ((uint32_t)cached >= (uint32_t)&_instruction_reserved_start && (uint32_t)cached <= (uint32_t)&_instruction_reserved_end) { + offset = instruction_flash2spiram_offset(); + } +#endif +#endif //#if !SOC_MMU_PER_EXT_MEM_TARGET + + return paddr + offset * CONFIG_MMU_PAGE_SIZE; +} + +#endif From a4886829f53e05e25d6b560cea06fcf81caa9b93 Mon Sep 17 00:00:00 2001 From: Xiao Xufeng Date: Sun, 8 Sep 2024 23:13:52 +0800 Subject: [PATCH 2/4] fix(mmap): fixed spi_flash_phys2cache return addr in PSRAM issue When SPIRAM_FETCH_INSTRUCTIONS or SPIRAM_RODATA enabled --- components/spi_flash/flash_mmap.c | 63 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/components/spi_flash/flash_mmap.c b/components/spi_flash/flash_mmap.c index 24a053c9ff..d82db7f811 100644 --- a/components/spi_flash/flash_mmap.c +++ b/components/spi_flash/flash_mmap.c @@ -270,38 +270,6 @@ uint32_t spi_flash_mmap_get_free_pages(spi_flash_mmap_memory_t memory) return len / CONFIG_MMU_PAGE_SIZE; } -const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memory) -{ - esp_err_t ret = ESP_FAIL; - void *ptr = NULL; - mmu_target_t target = MMU_TARGET_FLASH0; - - __attribute__((unused)) uint32_t phys_page = phys_offs / CONFIG_MMU_PAGE_SIZE; -#if !SOC_MMU_PER_EXT_MEM_TARGET -#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS - if (phys_page >= instruction_flash_start_page_get() && phys_page <= instruction_flash_end_page_get()) { - target = MMU_TARGET_PSRAM0; - phys_offs -= instruction_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE; - } -#endif - -#if CONFIG_SPIRAM_RODATA - if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_start_page_get()) { - target = MMU_TARGET_PSRAM0; - phys_offs -= rodata_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE; - } -#endif -#endif //#if !SOC_MMU_PER_EXT_MEM_TARGET - - mmu_vaddr_t type = (memory == SPI_FLASH_MMAP_DATA) ? MMU_VADDR_DATA : MMU_VADDR_INSTRUCTION; - ret = esp_mmu_paddr_to_vaddr(phys_offs, target, type, &ptr); - if (ret == ESP_ERR_NOT_FOUND) { - return NULL; - } - assert(ret == ESP_OK); - return (const void *)ptr; -} - static bool IRAM_ATTR is_page_mapped_in_cache(uint32_t phys_addr, const void **out_ptr) { *out_ptr = NULL; @@ -399,4 +367,35 @@ size_t spi_flash_cache2phys(const void *cached) return paddr + offset * CONFIG_MMU_PAGE_SIZE; } +const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memory) +{ + esp_err_t ret = ESP_FAIL; + void *ptr = NULL; + mmu_target_t target = MMU_TARGET_FLASH0; + + __attribute__((unused)) uint32_t phys_page = phys_offs / CONFIG_MMU_PAGE_SIZE; +#if !SOC_MMU_PER_EXT_MEM_TARGET +#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS + if (phys_page >= instruction_flash_start_page_get() && phys_page <= instruction_flash_end_page_get()) { + target = MMU_TARGET_PSRAM0; + phys_offs -= instruction_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE; + } #endif + +#if CONFIG_SPIRAM_RODATA + if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_start_page_get()) { + target = MMU_TARGET_PSRAM0; + phys_offs -= rodata_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE; + } +#endif +#endif //#if !SOC_MMU_PER_EXT_MEM_TARGET + + mmu_vaddr_t type = (memory == SPI_FLASH_MMAP_DATA) ? MMU_VADDR_DATA : MMU_VADDR_INSTRUCTION; + ret = esp_mmu_paddr_to_vaddr(phys_offs, target, type, &ptr); + if (ret == ESP_ERR_NOT_FOUND) { + return NULL; + } + assert(ret == ESP_OK); + return (const void *)ptr; +} +#endif //!CONFIG_SPI_FLASH_ROM_IMPL || CONFIG_SPIRAM_FETCH_INSTRUCTIONS || CONFIG_SPIRAM_RODATA From 4d75a8118fcbefed41778adbf88e41cd006711c3 Mon Sep 17 00:00:00 2001 From: Xiao Xufeng Date: Mon, 27 May 2024 01:45:02 +0800 Subject: [PATCH 3/4] ci(spi_flash): add tests for cache2phys with XIP --- .../test_apps/.build-test-rules.yml | 5 ++ .../app_update/test_apps/main/CMakeLists.txt | 2 +- .../app_update/test_apps/main/test_ota_ops.c | 9 ++++ .../test_apps/pytest_app_update_ut.py | 51 +++++++++++++------ .../test_apps/sdkconfig.ci.defaults | 2 + .../test_apps/sdkconfig.ci.xip_psram | 2 + .../sdkconfig.ci.xip_psram_with_rom_impl | 3 ++ .../spi_flash/test_apps/.build-test-rules.yml | 5 ++ .../flash_mmap/main/test_flash_mmap.c | 12 +++++ .../test_apps/flash_mmap/partitions.csv | 5 +- .../test_apps/flash_mmap/pytest_flash_mmap.py | 18 +++---- .../flash_mmap/sdkconfig.ci.xip_psram | 2 + .../flash_mmap/sdkconfig.ci.xip_psram_esp32s2 | 3 -- .../flash_mmap/sdkconfig.ci.xip_psram_esp32s3 | 3 -- .../sdkconfig.ci.xip_psram_with_rom_impl | 5 +- 15 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 components/app_update/test_apps/sdkconfig.ci.defaults create mode 100644 components/app_update/test_apps/sdkconfig.ci.xip_psram create mode 100644 components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl create mode 100644 components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram delete mode 100644 components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s2 delete mode 100644 components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s3 diff --git a/components/app_update/test_apps/.build-test-rules.yml b/components/app_update/test_apps/.build-test-rules.yml index 8c365fcc5e..442db84794 100644 --- a/components/app_update/test_apps/.build-test-rules.yml +++ b/components/app_update/test_apps/.build-test-rules.yml @@ -1,6 +1,11 @@ # Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps components/app_update/test_apps: + enable: + - if: CONFIG_NAME == "defaults" and IDF_TARGET != "linux" + - if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"] + # S2 doesn't have ROM for flash + - if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"] disable: - if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32c5"] temporary: true diff --git a/components/app_update/test_apps/main/CMakeLists.txt b/components/app_update/test_apps/main/CMakeLists.txt index 0011e70856..a83ae6af90 100644 --- a/components/app_update/test_apps/main/CMakeLists.txt +++ b/components/app_update/test_apps/main/CMakeLists.txt @@ -1,4 +1,4 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." - PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash + PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash esp_psram WHOLE_ARCHIVE) diff --git a/components/app_update/test_apps/main/test_ota_ops.c b/components/app_update/test_apps/main/test_ota_ops.c index b72142d6e1..0dbfabb76c 100644 --- a/components/app_update/test_apps/main/test_ota_ops.c +++ b/components/app_update/test_apps/main/test_ota_ops.c @@ -6,6 +6,7 @@ #include #include #include +#include "esp_log.h" #include #include #include @@ -113,3 +114,11 @@ TEST_CASE("esp_ota_get_partition_description", "[ota]") }; TEST_ESP_ERR(ESP_ERR_NOT_FOUND, bootloader_common_get_partition_description(¬_app_pos, &app_desc1)); } + +TEST_CASE("esp_ota_get_running_partition points to correct address", "[spi_flash]") +{ + const esp_partition_t *factory = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "factory"); + const esp_partition_t* part = esp_ota_get_running_partition(); + ESP_LOGI("running bin", "0x%p", (void*)part->address); + TEST_ASSERT_EQUAL_HEX32(factory->address, part->address); +} diff --git a/components/app_update/test_apps/pytest_app_update_ut.py b/components/app_update/test_apps/pytest_app_update_ut.py index 594bdbf2f3..80fccb8d11 100644 --- a/components/app_update/test_apps/pytest_app_update_ut.py +++ b/components/app_update/test_apps/pytest_app_update_ut.py @@ -9,24 +9,43 @@ DEFAULT_TIMEOUT = 20 TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n') -def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None: - for stage in range(1, stages + 1): - dut.write(str(test_case_num)) - dut.expect(TEST_SUBMENU_PATTERN_PYTEST, timeout=DEFAULT_TIMEOUT) - dut.write(str(stage)) - if stage != stages: - dut.expect_exact('Press ENTER to see the list of tests.') +@pytest.mark.supported_targets +@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2'], reason='c6/h2 support TBD') +@pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + 'defaults', + ], + indirect=True, +) +def test_app_update(dut: Dut) -> None: + dut.run_all_single_board_cases(timeout=90) @pytest.mark.supported_targets @pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2'], reason='c6/h2 support TBD') @pytest.mark.generic -def test_app_update(dut: Dut) -> None: - extra_data = dut.parse_test_menu() - for test_case in extra_data: - if test_case.type != 'multi_stage': - dut.write(str(test_case.index)) - else: - run_multiple_stages(dut, test_case.index, len(test_case.subcases)) - dut.expect_unity_test_output(timeout=90) - dut.expect_exact("Enter next test, or 'enter' to see menu") +@pytest.mark.parametrize( + 'config', + [ + 'xip_psram', + ], + indirect=True, +) +def test_app_update_xip_psram(dut: Dut) -> None: + dut.run_all_single_board_cases(timeout=90) + + +@pytest.mark.supported_targets +@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2'], reason='c6/h2 support TBD') +@pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + 'xip_psram_with_rom_impl', + ], + indirect=True, +) +def test_app_update_xip_psram_rom_impl(dut: Dut) -> None: + dut.run_all_single_board_cases(timeout=90) diff --git a/components/app_update/test_apps/sdkconfig.ci.defaults b/components/app_update/test_apps/sdkconfig.ci.defaults new file mode 100644 index 0000000000..250a29bc45 --- /dev/null +++ b/components/app_update/test_apps/sdkconfig.ci.defaults @@ -0,0 +1,2 @@ +# don't delete. +# used for CI to compile a default config when 'sdkconfig.ci.xxxx' is exist diff --git a/components/app_update/test_apps/sdkconfig.ci.xip_psram b/components/app_update/test_apps/sdkconfig.ci.xip_psram new file mode 100644 index 0000000000..358f51460b --- /dev/null +++ b/components/app_update/test_apps/sdkconfig.ci.xip_psram @@ -0,0 +1,2 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_XIP_FROM_PSRAM=y diff --git a/components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl b/components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl new file mode 100644 index 0000000000..80c30b1fe6 --- /dev/null +++ b/components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl @@ -0,0 +1,3 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_XIP_FROM_PSRAM=y +CONFIG_SPI_FLASH_ROM_IMPL=y diff --git a/components/spi_flash/test_apps/.build-test-rules.yml b/components/spi_flash/test_apps/.build-test-rules.yml index 01b9231ef6..3ef2a94b52 100644 --- a/components/spi_flash/test_apps/.build-test-rules.yml +++ b/components/spi_flash/test_apps/.build-test-rules.yml @@ -39,6 +39,11 @@ components/spi_flash/test_apps/flash_mmap: depends_components: - esp_mm - spi_flash + enable: + - if: CONFIG_NAME in ["release", "rom_impl"] and IDF_TARGET != "linux" + - if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"] + # S2 doesn't have ROM for flash + - if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"] components/spi_flash/test_apps/flash_suspend: disable: diff --git a/components/spi_flash/test_apps/flash_mmap/main/test_flash_mmap.c b/components/spi_flash/test_apps/flash_mmap/main/test_flash_mmap.c index 3f36d6bf34..42c1b0c550 100644 --- a/components/spi_flash/test_apps/flash_mmap/main/test_flash_mmap.c +++ b/components/spi_flash/test_apps/flash_mmap/main/test_flash_mmap.c @@ -7,6 +7,7 @@ #include #include #include +#include "esp_log.h" #include #include #include @@ -517,3 +518,14 @@ TEST_CASE("no stale data read post mmap and write partition", "[spi_flash][mmap] TEST_ASSERT_EQUAL(0, memcmp(buf, read_data, sizeof(buf))); #endif } + +TEST_CASE("spi_flash_cache2phys points to correct address", "[spi_flash]") +{ + //_rodata_start, which begins with appdesc, is always the first segment of the bin. + extern int _rodata_start; + size_t addr = spi_flash_cache2phys(&_rodata_start); + + const esp_partition_t *factory = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "factory"); + ESP_LOGI("running bin", "0x%p", (void*)addr); + TEST_ASSERT_HEX32_WITHIN(CONFIG_MMU_PAGE_SIZE/2, factory->address + CONFIG_MMU_PAGE_SIZE/2, addr); +} diff --git a/components/spi_flash/test_apps/flash_mmap/partitions.csv b/components/spi_flash/test_apps/flash_mmap/partitions.csv index c941d8f4f1..0f0d5d8a32 100644 --- a/components/spi_flash/test_apps/flash_mmap/partitions.csv +++ b/components/spi_flash/test_apps/flash_mmap/partitions.csv @@ -1,5 +1,6 @@ # Name, Type, SubType, Offset, Size, Flags # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap nvs, data, nvs, 0x9000, 0x6000, -factory, 0, 0, 0x10000, 1M -flash_test, data, fat, , 528K +flash_test, data, fat, 0x10000, 528K +# This partition is placed to this weird address intentionally to test spi_flash_cache2phys +factory, 0, 0, 0xF0000, 1M diff --git a/components/spi_flash/test_apps/flash_mmap/pytest_flash_mmap.py b/components/spi_flash/test_apps/flash_mmap/pytest_flash_mmap.py index 782d0091b2..de8fd80f44 100644 --- a/components/spi_flash/test_apps/flash_mmap/pytest_flash_mmap.py +++ b/components/spi_flash/test_apps/flash_mmap/pytest_flash_mmap.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 - import pytest from pytest_embedded import Dut @@ -35,19 +34,20 @@ def test_flash_mmap_rom_impl(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=30) -XIP_CONFIGS = [ - pytest.param('xip_psram_esp32s2', marks=[pytest.mark.esp32s2]), - pytest.param('xip_psram_esp32s3', marks=[pytest.mark.esp32s3]), -] - - +@pytest.mark.supported_targets @pytest.mark.generic -@pytest.mark.parametrize('config', XIP_CONFIGS, indirect=True) +@pytest.mark.parametrize( + 'config', + [ + 'xip_psram', + ], + indirect=True, +) def test_flash_mmap_xip_psram(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=30) -@pytest.mark.esp32s3 +@pytest.mark.supported_targets @pytest.mark.generic @pytest.mark.parametrize( 'config', diff --git a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram new file mode 100644 index 0000000000..358f51460b --- /dev/null +++ b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram @@ -0,0 +1,2 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_XIP_FROM_PSRAM=y diff --git a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s2 b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s2 deleted file mode 100644 index f802481b37..0000000000 --- a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s2 +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_IDF_TARGET="esp32s2" -CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y -CONFIG_SPIRAM_RODATA=y diff --git a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s3 b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s3 deleted file mode 100644 index cd228b8f50..0000000000 --- a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_esp32s3 +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_IDF_TARGET="esp32s3" -CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y -CONFIG_SPIRAM_RODATA=y diff --git a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_with_rom_impl b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_with_rom_impl index 2bca42b0de..80c30b1fe6 100644 --- a/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_with_rom_impl +++ b/components/spi_flash/test_apps/flash_mmap/sdkconfig.ci.xip_psram_with_rom_impl @@ -1,4 +1,3 @@ -CONFIG_IDF_TARGET="esp32s3" -CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y -CONFIG_SPIRAM_RODATA=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_XIP_FROM_PSRAM=y CONFIG_SPI_FLASH_ROM_IMPL=y From 91964c9ad5da92a2210c162342847fc39348a180 Mon Sep 17 00:00:00 2001 From: Xiao Xufeng Date: Sun, 8 Sep 2024 23:17:31 +0800 Subject: [PATCH 4/4] ci(app_update): move test_apps to subfolder with a name --- .../test_apps/{ => test_app_update}/.build-test-rules.yml | 2 +- .../app_update/test_apps/{ => test_app_update}/CMakeLists.txt | 0 components/app_update/test_apps/{ => test_app_update}/README.md | 0 .../test_apps/{ => test_app_update}/main/CMakeLists.txt | 0 .../app_update/test_apps/{ => test_app_update}/main/app_main.c | 0 .../test_apps/{ => test_app_update}/main/test_ota_ops.c | 0 .../test_apps/{ => test_app_update}/main/test_switch_ota.c | 2 +- .../{ => test_app_update}/partition_table_unit_test_two_ota.csv | 0 .../partition_table_unit_test_two_ota_2m.csv | 0 .../test_apps/{ => test_app_update}/pytest_app_update_ut.py | 0 .../test_apps/{ => test_app_update}/sdkconfig.ci.defaults | 0 .../test_apps/{ => test_app_update}/sdkconfig.ci.xip_psram | 0 .../{ => test_app_update}/sdkconfig.ci.xip_psram_with_rom_impl | 0 .../test_apps/{ => test_app_update}/sdkconfig.defaults | 0 .../test_apps/{ => test_app_update}/sdkconfig.defaults.esp32 | 0 .../test_apps/{ => test_app_update}/sdkconfig.defaults.esp32c2 | 0 .../test_apps/{ => test_app_update}/sdkconfig.defaults.esp32c3 | 0 .../test_apps/{ => test_app_update}/sdkconfig.defaults.esp32s2 | 0 .../test_apps/test_app_update/sdkconfig.defaults.esp32s3 | 2 ++ components/spi_flash/test_apps/.build-test-rules.yml | 2 +- 20 files changed, 5 insertions(+), 3 deletions(-) rename components/app_update/test_apps/{ => test_app_update}/.build-test-rules.yml (88%) rename components/app_update/test_apps/{ => test_app_update}/CMakeLists.txt (100%) rename components/app_update/test_apps/{ => test_app_update}/README.md (100%) rename components/app_update/test_apps/{ => test_app_update}/main/CMakeLists.txt (100%) rename components/app_update/test_apps/{ => test_app_update}/main/app_main.c (100%) rename components/app_update/test_apps/{ => test_app_update}/main/test_ota_ops.c (100%) rename components/app_update/test_apps/{ => test_app_update}/main/test_switch_ota.c (99%) rename components/app_update/test_apps/{ => test_app_update}/partition_table_unit_test_two_ota.csv (100%) rename components/app_update/test_apps/{ => test_app_update}/partition_table_unit_test_two_ota_2m.csv (100%) rename components/app_update/test_apps/{ => test_app_update}/pytest_app_update_ut.py (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.ci.defaults (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.ci.xip_psram (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.ci.xip_psram_with_rom_impl (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.defaults (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.defaults.esp32 (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.defaults.esp32c2 (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.defaults.esp32c3 (100%) rename components/app_update/test_apps/{ => test_app_update}/sdkconfig.defaults.esp32s2 (100%) create mode 100644 components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s3 diff --git a/components/app_update/test_apps/.build-test-rules.yml b/components/app_update/test_apps/test_app_update/.build-test-rules.yml similarity index 88% rename from components/app_update/test_apps/.build-test-rules.yml rename to components/app_update/test_apps/test_app_update/.build-test-rules.yml index 442db84794..ebd5c21fba 100644 --- a/components/app_update/test_apps/.build-test-rules.yml +++ b/components/app_update/test_apps/test_app_update/.build-test-rules.yml @@ -7,6 +7,6 @@ components/app_update/test_apps: # S2 doesn't have ROM for flash - if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"] disable: - - if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32c5"] + - if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32c5", "esp32c61"] temporary: true reason: target esp32c6, esp32h2 esp32c5 is not supported yet # TODO: [ESP32C5] IDF-8638 diff --git a/components/app_update/test_apps/CMakeLists.txt b/components/app_update/test_apps/test_app_update/CMakeLists.txt similarity index 100% rename from components/app_update/test_apps/CMakeLists.txt rename to components/app_update/test_apps/test_app_update/CMakeLists.txt diff --git a/components/app_update/test_apps/README.md b/components/app_update/test_apps/test_app_update/README.md similarity index 100% rename from components/app_update/test_apps/README.md rename to components/app_update/test_apps/test_app_update/README.md diff --git a/components/app_update/test_apps/main/CMakeLists.txt b/components/app_update/test_apps/test_app_update/main/CMakeLists.txt similarity index 100% rename from components/app_update/test_apps/main/CMakeLists.txt rename to components/app_update/test_apps/test_app_update/main/CMakeLists.txt diff --git a/components/app_update/test_apps/main/app_main.c b/components/app_update/test_apps/test_app_update/main/app_main.c similarity index 100% rename from components/app_update/test_apps/main/app_main.c rename to components/app_update/test_apps/test_app_update/main/app_main.c diff --git a/components/app_update/test_apps/main/test_ota_ops.c b/components/app_update/test_apps/test_app_update/main/test_ota_ops.c similarity index 100% rename from components/app_update/test_apps/main/test_ota_ops.c rename to components/app_update/test_apps/test_app_update/main/test_ota_ops.c diff --git a/components/app_update/test_apps/main/test_switch_ota.c b/components/app_update/test_apps/test_app_update/main/test_switch_ota.c similarity index 99% rename from components/app_update/test_apps/main/test_switch_ota.c rename to components/app_update/test_apps/test_app_update/main/test_switch_ota.c index bbeb036c12..3152cd2574 100644 --- a/components/app_update/test_apps/main/test_switch_ota.c +++ b/components/app_update/test_apps/test_app_update/main/test_switch_ota.c @@ -842,7 +842,7 @@ static void test_flow6(void) TEST_CASE_MULTIPLE_STAGES("Switching between factory, OTA0 using esp_ota_write_with_offset", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow6, test_flow6); //IDF-5145 -TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_INVALID when image is ivalid", "[partitions]") +TEST_CASE("Test bootloader_common_get_sha256_of_partition returns ESP_ERR_IMAGE_INVALID when image is invalid", "[partitions]") { const esp_partition_t *cur_app = esp_ota_get_running_partition(); ESP_LOGI(TAG, "copy current app to next part"); diff --git a/components/app_update/test_apps/partition_table_unit_test_two_ota.csv b/components/app_update/test_apps/test_app_update/partition_table_unit_test_two_ota.csv similarity index 100% rename from components/app_update/test_apps/partition_table_unit_test_two_ota.csv rename to components/app_update/test_apps/test_app_update/partition_table_unit_test_two_ota.csv diff --git a/components/app_update/test_apps/partition_table_unit_test_two_ota_2m.csv b/components/app_update/test_apps/test_app_update/partition_table_unit_test_two_ota_2m.csv similarity index 100% rename from components/app_update/test_apps/partition_table_unit_test_two_ota_2m.csv rename to components/app_update/test_apps/test_app_update/partition_table_unit_test_two_ota_2m.csv diff --git a/components/app_update/test_apps/pytest_app_update_ut.py b/components/app_update/test_apps/test_app_update/pytest_app_update_ut.py similarity index 100% rename from components/app_update/test_apps/pytest_app_update_ut.py rename to components/app_update/test_apps/test_app_update/pytest_app_update_ut.py diff --git a/components/app_update/test_apps/sdkconfig.ci.defaults b/components/app_update/test_apps/test_app_update/sdkconfig.ci.defaults similarity index 100% rename from components/app_update/test_apps/sdkconfig.ci.defaults rename to components/app_update/test_apps/test_app_update/sdkconfig.ci.defaults diff --git a/components/app_update/test_apps/sdkconfig.ci.xip_psram b/components/app_update/test_apps/test_app_update/sdkconfig.ci.xip_psram similarity index 100% rename from components/app_update/test_apps/sdkconfig.ci.xip_psram rename to components/app_update/test_apps/test_app_update/sdkconfig.ci.xip_psram diff --git a/components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl b/components/app_update/test_apps/test_app_update/sdkconfig.ci.xip_psram_with_rom_impl similarity index 100% rename from components/app_update/test_apps/sdkconfig.ci.xip_psram_with_rom_impl rename to components/app_update/test_apps/test_app_update/sdkconfig.ci.xip_psram_with_rom_impl diff --git a/components/app_update/test_apps/sdkconfig.defaults b/components/app_update/test_apps/test_app_update/sdkconfig.defaults similarity index 100% rename from components/app_update/test_apps/sdkconfig.defaults rename to components/app_update/test_apps/test_app_update/sdkconfig.defaults diff --git a/components/app_update/test_apps/sdkconfig.defaults.esp32 b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32 similarity index 100% rename from components/app_update/test_apps/sdkconfig.defaults.esp32 rename to components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32 diff --git a/components/app_update/test_apps/sdkconfig.defaults.esp32c2 b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32c2 similarity index 100% rename from components/app_update/test_apps/sdkconfig.defaults.esp32c2 rename to components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32c2 diff --git a/components/app_update/test_apps/sdkconfig.defaults.esp32c3 b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32c3 similarity index 100% rename from components/app_update/test_apps/sdkconfig.defaults.esp32c3 rename to components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32c3 diff --git a/components/app_update/test_apps/sdkconfig.defaults.esp32s2 b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s2 similarity index 100% rename from components/app_update/test_apps/sdkconfig.defaults.esp32s2 rename to components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s2 diff --git a/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s3 b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s3 new file mode 100644 index 0000000000..126da50470 --- /dev/null +++ b/components/app_update/test_apps/test_app_update/sdkconfig.defaults.esp32s3 @@ -0,0 +1,2 @@ +CONFIG_IDF_TARGET="esp32s3" +CONFIG_BOOTLOADER_NUM_PIN_APP_TEST=18 diff --git a/components/spi_flash/test_apps/.build-test-rules.yml b/components/spi_flash/test_apps/.build-test-rules.yml index 3ef2a94b52..76a29da063 100644 --- a/components/spi_flash/test_apps/.build-test-rules.yml +++ b/components/spi_flash/test_apps/.build-test-rules.yml @@ -40,7 +40,7 @@ components/spi_flash/test_apps/flash_mmap: - esp_mm - spi_flash enable: - - if: CONFIG_NAME in ["release", "rom_impl"] and IDF_TARGET != "linux" + - if: CONFIG_NAME in ["release", "rom_impl"] and IDF_TARGET not in ["linux", "esp32c61"] - if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"] # S2 doesn't have ROM for flash - if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"]