diff --git a/tools/cmakev2/test/components/component1/CMakeLists.txt b/tools/cmakev2/test/components/component1/CMakeLists.txt deleted file mode 100644 index 7f126c75dc6..00000000000 --- a/tools/cmakev2/test/components/component1/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_library(${COMPONENT_TARGET} component1.c) -target_include_directories(${COMPONENT_TARGET} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) diff --git a/tools/cmakev2/test/components/component1/Kconfig b/tools/cmakev2/test/components/component1/Kconfig deleted file mode 100644 index 747f971d653..00000000000 --- a/tools/cmakev2/test/components/component1/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menu "component1 configuration" - config COMPONENT1_OPTION - prompt "component1 option" - bool -endmenu diff --git a/tools/cmakev2/test/components/component1/component1.c b/tools/cmakev2/test/components/component1/component1.c deleted file mode 100644 index 682fc662cdf..00000000000 --- a/tools/cmakev2/test/components/component1/component1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include - -void component1_func(void) -{ - printf("component1\n"); -} diff --git a/tools/cmakev2/test/components/component1/component1.h b/tools/cmakev2/test/components/component1/component1.h deleted file mode 100644 index 3157eb52d3b..00000000000 --- a/tools/cmakev2/test/components/component1/component1.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef _COMPONENT1_H_ -#define _COMPONENT1_H_ -void component1_func(void); -#endif diff --git a/tools/cmakev2/test/components/component2/CMakeLists.txt b/tools/cmakev2/test/components/component2/CMakeLists.txt deleted file mode 100644 index 2471d235114..00000000000 --- a/tools/cmakev2/test/components/component2/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -idf_component_include(component1 INTERFACE component1) - -add_library(${COMPONENT_TARGET} component2.c) -target_include_directories(${COMPONENT_TARGET} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) -target_link_libraries(${COMPONENT_TARGET} PRIVATE ${component1}) diff --git a/tools/cmakev2/test/components/component2/Kconfig b/tools/cmakev2/test/components/component2/Kconfig deleted file mode 100644 index e047729a8b7..00000000000 --- a/tools/cmakev2/test/components/component2/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menu "component2 configuration" - config COMPONENT2_OPTION - prompt "component2 option" - bool -endmenu diff --git a/tools/cmakev2/test/components/component2/component2.c b/tools/cmakev2/test/components/component2/component2.c deleted file mode 100644 index 6bcd9f3526d..00000000000 --- a/tools/cmakev2/test/components/component2/component2.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include "component1.h" - -void component2_func(void) -{ - component1_func(); - printf("component2\n"); -} diff --git a/tools/cmakev2/test/components/component2/component2.h b/tools/cmakev2/test/components/component2/component2.h deleted file mode 100644 index 0eb7756fcd9..00000000000 --- a/tools/cmakev2/test/components/component2/component2.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef _COMPONENT2_H_ -#define _COMPONENT2_H_ - -void component2_func(void); -#endif diff --git a/tools/cmakev2/test/components/fatfs_example/CMakeLists.txt b/tools/cmakev2/test/components/fatfs_example/CMakeLists.txt deleted file mode 100644 index 25c6ce0b7c8..00000000000 --- a/tools/cmakev2/test/components/fatfs_example/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -idf_component_register(SRCS "fatfs_getting_started_main.c" - PRIV_REQUIRES vfs fatfs lwip - INCLUDE_DIRS ".") diff --git a/tools/cmakev2/test/components/fatfs_example/fatfs_getting_started_main.c b/tools/cmakev2/test/components/fatfs_example/fatfs_getting_started_main.c deleted file mode 100644 index 2b93095d1ce..00000000000 --- a/tools/cmakev2/test/components/fatfs_example/fatfs_getting_started_main.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include -#include "esp_vfs.h" -#include "esp_vfs_fat.h" -#include "sdkconfig.h" - -static const char *TAG = "example"; - -// Mount path for the partition -const char *base_path = "/spiflash"; - -// Handle of the wear levelling library instance -static wl_handle_t s_wl_handle = WL_INVALID_HANDLE; - -void app_main(void) -{ - ESP_LOGI(TAG, "Mounting FAT filesystem"); - // To mount device we need name of device partition, define base_path - // and allow format partition in case if it is new one and was not formatted before - const esp_vfs_fat_mount_config_t mount_config = { - .max_files = 4, // Number of files that can be open at a time - .format_if_mount_failed = true, // If true, try to format the partition if mount fails - .allocation_unit_size = CONFIG_WL_SECTOR_SIZE, // Size of allocation unit, cluster size. - .use_one_fat = false, // Use only one FAT table (reduce memory usage), but decrease reliability of file system in case of power failure. - }; - - // Mount FATFS filesystem located on "storage" partition in read-write mode - esp_err_t err = esp_vfs_fat_spiflash_mount_rw_wl(base_path, "storage", &mount_config, &s_wl_handle); - if (err != ESP_OK) { - ESP_LOGE(TAG, "Failed to mount FATFS (%s)", esp_err_to_name(err)); - return; - } - - ESP_LOGI(TAG, "Filesystem mounted"); - - ESP_LOGI(TAG, "Opening file"); - - const char *filename = "/spiflash/example.txt"; - - FILE *f = fopen(filename, "wb"); - if (f == NULL) { - perror("fopen"); // Print reason why fopen failed - ESP_LOGE(TAG, "Failed to open file for writing"); - return; - } - - fprintf(f, "Hello World!\n"); - fclose(f); - - ESP_LOGI(TAG, "File written"); - - // Open file for reading - ESP_LOGI(TAG, "Reading file"); - - f = fopen(filename, "r"); - if (f == NULL) { - ESP_LOGE(TAG, "Failed to open file for reading"); - return; - } - - char line[128]; - - fgets(line, sizeof(line), f); - fclose(f); - - // strip newline - char *pos = strchr(line, '\n'); - if (pos) { - *pos = '\0'; - } - - ESP_LOGI(TAG, "Read from file: '%s'", line); - - // Unmount FATFS - ESP_LOGI(TAG, "Unmounting FAT filesystem"); - - ESP_ERROR_CHECK(esp_vfs_fat_spiflash_unmount_rw_wl(base_path, s_wl_handle)); - - ESP_LOGI(TAG, "Done"); -} diff --git a/tools/cmakev2/test/components/hello_world_example/CMakeLists.txt b/tools/cmakev2/test/components/hello_world_example/CMakeLists.txt deleted file mode 100644 index 28ab405bd66..00000000000 --- a/tools/cmakev2/test/components/hello_world_example/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -idf_component_register(SRCS "hello_world_main.c" - PRIV_REQUIRES spi_flash - INCLUDE_DIRS "") diff --git a/tools/cmakev2/test/components/hello_world_example/hello_world_main.c b/tools/cmakev2/test/components/hello_world_example/hello_world_main.c deleted file mode 100644 index 95cab254a1a..00000000000 --- a/tools/cmakev2/test/components/hello_world_example/hello_world_main.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include "sdkconfig.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_chip_info.h" -#include "esp_flash.h" -#include "esp_system.h" - -void app_main(void) -{ - printf("Hello world!\n"); - - /* Print chip information */ - esp_chip_info_t chip_info; - uint32_t flash_size; - esp_chip_info(&chip_info); - printf("This is %s chip with %d CPU core(s), %s%s%s%s, ", - CONFIG_IDF_TARGET, - chip_info.cores, - (chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "WiFi/" : "", - (chip_info.features & CHIP_FEATURE_BT) ? "BT" : "", - (chip_info.features & CHIP_FEATURE_BLE) ? "BLE" : "", - (chip_info.features & CHIP_FEATURE_IEEE802154) ? ", 802.15.4 (Zigbee/Thread)" : ""); - - unsigned major_rev = chip_info.revision / 100; - unsigned minor_rev = chip_info.revision % 100; - printf("silicon revision v%d.%d, ", major_rev, minor_rev); - if (esp_flash_get_size(NULL, &flash_size) != ESP_OK) { - printf("Get flash size failed"); - return; - } - - printf("%" PRIu32 "MB %s flash\n", flash_size / (uint32_t)(1024 * 1024), - (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); - - printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); - - for (int i = 10; i >= 0; i--) { - printf("Restarting in %d seconds...\n", i); - vTaskDelay(1000 / portTICK_PERIOD_MS); - } - printf("Restarting now.\n"); - fflush(stdout); - esp_restart(); -} diff --git a/tools/cmakev2/test/components/main/CMakeLists.txt b/tools/cmakev2/test/components/main/CMakeLists.txt deleted file mode 100644 index 28ab405bd66..00000000000 --- a/tools/cmakev2/test/components/main/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -idf_component_register(SRCS "hello_world_main.c" - PRIV_REQUIRES spi_flash - INCLUDE_DIRS "") diff --git a/tools/cmakev2/test/components/main/hello_world_main.c b/tools/cmakev2/test/components/main/hello_world_main.c deleted file mode 100644 index 95cab254a1a..00000000000 --- a/tools/cmakev2/test/components/main/hello_world_main.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -#include -#include -#include "sdkconfig.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_chip_info.h" -#include "esp_flash.h" -#include "esp_system.h" - -void app_main(void) -{ - printf("Hello world!\n"); - - /* Print chip information */ - esp_chip_info_t chip_info; - uint32_t flash_size; - esp_chip_info(&chip_info); - printf("This is %s chip with %d CPU core(s), %s%s%s%s, ", - CONFIG_IDF_TARGET, - chip_info.cores, - (chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "WiFi/" : "", - (chip_info.features & CHIP_FEATURE_BT) ? "BT" : "", - (chip_info.features & CHIP_FEATURE_BLE) ? "BLE" : "", - (chip_info.features & CHIP_FEATURE_IEEE802154) ? ", 802.15.4 (Zigbee/Thread)" : ""); - - unsigned major_rev = chip_info.revision / 100; - unsigned minor_rev = chip_info.revision % 100; - printf("silicon revision v%d.%d, ", major_rev, minor_rev); - if (esp_flash_get_size(NULL, &flash_size) != ESP_OK) { - printf("Get flash size failed"); - return; - } - - printf("%" PRIu32 "MB %s flash\n", flash_size / (uint32_t)(1024 * 1024), - (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); - - printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); - - for (int i = 10; i >= 0; i--) { - printf("Restarting in %d seconds...\n", i); - vTaskDelay(1000 / portTICK_PERIOD_MS); - } - printf("Restarting now.\n"); - fflush(stdout); - esp_restart(); -}