test(vfs): Test changes regarding VFS register incorrect check fix and fix VFS host test not being run at all (v6.1)
See merge request espressif/esp-idf!49945
freq_limit was declared at the top of the #if SPI_LL_SUPPORT_TIME_TUNING
block and only consumed by HAL_EARLY_LOGE inside an inner if(). When the
log macro expands to nothing (e.g. log component absent from the build
closure, as in g0_components, or log level set below ERROR), the
variable became unused and tripped -Wunused-variable, failing builds
under --check-warnings.
Move the declaration into the inner if() that calls HAL_EARLY_LOGE so
it shares the same scope and lifetime as its consumer.
main/{esp32s2,esp32c3,esp32s3}/test_panic.c uses WDT registers from
esp_hal_wdt. Declare it explicitly so the build works under cmakev2's
strict component isolation.
flash_encrypt.c is in the unconditional source list and includes
esp_security/esp_key_mgr.h whenever SOC_KEY_MANAGER_SUPPORTED is set.
Move the esp_security PRIV_REQUIRES declaration outside the
BOOTLOADER_BUILD branch so every build variant that compiles
flash_encrypt.c gets the dependency consistently.
Three host_test CMakeLists.txt files relied on idioms tied to a
specific build system layout. Make them portable:
- spiffs/host_test and esp_partition/host_test/partition_api_test
passed a hard-coded "<project>.elf" target name to add_dependencies().
Use ${project_elf}, the canonical variable that resolves to the live
executable target name in either build system.
- nvs_flash/host_test/nvs_page_test linked --coverage using the plain
signature of target_link_libraries. CMake forbids mixing plain and
keyword signatures on the same target; the component library link
already uses the keyword form. Switch the --coverage link to the
keyword signature.
stdio_vfs.c (the sole definition of esp_vfs_include_console_register)
is only added to the source list on non-Linux targets. The trailing
target_link_libraries(... -u esp_vfs_include_console_register) was
applied whenever CONFIG_VFS_SUPPORT_IO was enabled, including on the
Linux host build where the symbol is not part of the link. Constrain
the force-undef to the same condition that opts the defining source
in.
dns_over_https/main includes time_sync.h, nvs_flash.h, esp_event.h,
esp_timer.h, and mbedtls headers. Declare nvs_flash, esp_event,
esp_timer, mbedtls and time_sync in PRIV_REQUIRES so the build is
self-describing under any build system.
Also move esp_netif from PRIV_REQUIRES to REQUIRES in
protocol_examples_common, since its public header exposes esp_netif.h.
Also add the PRIVATE keyword to target_link_libraries in the
dns_over_https component — CMake rejects mixed keyword/plain
signatures on the same target.
Public headers (notably esp_wifi_default.h) include esp_event.h,
esp_netif.h and esp_phy.h. Declare these in REQUIRES so the headers
are visible to consumers — same interface as the WiFi-enabled
registration at the bottom of this file.
Also declare wpa_supplicant as PRIV_REQUIRES so the remote/ EAP
stubs can include esp_eap_client.h when the stub registration is
compiled.
spinlock.h used #else to include riscv/rv_utils.h for all non-Xtensa
targets. On Linux host (neither __XTENSA__ nor __riscv defined), this
pulls in a non-existent header. Change to #elif __riscv, matching
esp_cpu.h's existing pattern.
On the Linux target the host's C library is used directly; none of the
LibC menu options apply. Mark the entire "LibC" menu as `depends on
!IDF_TARGET_LINUX` so its symbols (LIBC_NEWLIB, LIBC_PICOLIBC, …) stay
undefined on Linux builds.
Also gate the picolibc-specific include in components/console/linenoise/
linenoise.c under `!CONFIG_IDF_TARGET_LINUX` so the file does not try to
pull <stdio-bufio.h> on the host even if CONFIG_LIBC_PICOLIBC is set by
some other build path.
The test app set priv_requires as a single quoted string ("esp_event unity")
instead of separate list items. The v1 build system silently splits on
spaces, but the v2 compat layer treats it as a single component name.
esp_crypto_shared_gdma_done() polled the AXI RX raw interrupt status
(in_done) but never cleared it, so after the first transfer the set bit
made every subsequent call return immediately without waiting.