diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 8dba84db1b..82b29a703e 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -119,6 +119,7 @@ /components/esp_tee/ @esp-idf-codeowners/security /components/esp_timer/ @esp-idf-codeowners/system /components/esp-tls/ @esp-idf-codeowners/app-utilities +/components/esp_usb_cdc_rom_console/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals/usb /components/esp_vfs_*/ @esp-idf-codeowners/storage /components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system /components/esp_wifi/ @esp-idf-codeowners/wifi diff --git a/components/console/CMakeLists.txt b/components/console/CMakeLists.txt index a6c7632830..05de4c204a 100644 --- a/components/console/CMakeLists.txt +++ b/components/console/CMakeLists.txt @@ -38,6 +38,7 @@ idf_component_register(SRCS ${srcs} REQUIRES "${requires}" PRIV_REQUIRES esp_driver_uart esp_driver_usb_serial_jtag + esp_usb_cdc_rom_console ) if(CONFIG_COMPILER_STATIC_ANALYZER AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # TODO IDF-10085 diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index 07f9159c7a..59fcc1680e 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -76,7 +76,7 @@ else() # [refactor-todo] requirements due to init code, # should be removable once using component init functions # link-time registration is used. - bootloader_support esp_pm + bootloader_support esp_pm esp_usb_cdc_rom_console LDFRAGMENTS "linker.lf" "app.lf") add_subdirectory(port) diff --git a/components/esp_system/Kconfig b/components/esp_system/Kconfig index 098d01ec0f..d8e7f4731b 100644 --- a/components/esp_system/Kconfig +++ b/components/esp_system/Kconfig @@ -25,7 +25,6 @@ menu "ESP System Settings" - Unified Behavior Sanitizer (UBSAN) hook - Interrupt watchdog handler - XTAL32K watchdog timer - - USB CDC functions for the esp_rom_printf (if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF=y) - IPC and IPC ISR choice ESP_SYSTEM_PANIC diff --git a/components/esp_system/linker.lf b/components/esp_system/linker.lf index 51b6cff9e2..6b4f880a80 100644 --- a/components/esp_system/linker.lf +++ b/components/esp_system/linker.lf @@ -34,20 +34,6 @@ entries: if COMPILER_STACK_CHECK = y: stack_check:__stack_chk_fail (noflash) - if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF: - usb_console:esp_usb_console_write_char (noflash) - usb_console:esp_usb_console_write_buf (noflash) - usb_console:esp_usb_console_flush_internal (noflash) - usb_console:esp_usb_console_osglue_wait_proc (noflash) - usb_console:esp_usb_console_osglue_dis_int (noflash) - usb_console:esp_usb_console_osglue_ena_int (noflash) - usb_console:esp_usb_console_interrupt (noflash) - usb_console:esp_usb_console_poll_interrupts (noflash) - usb_console:esp_usb_console_cdc_acm_cb (noflash) - usb_console:esp_usb_console_dfu_detach_cb (noflash) - usb_console:esp_usb_console_before_restart (noflash) - usb_console:esp_usb_console_on_restart_timeout (noflash) - if APP_BUILD_TYPE_RAM = n: image_process (noflash) diff --git a/components/esp_system/panic.c b/components/esp_system/panic.c index 38044b70d9..e9defe2006 100644 --- a/components/esp_system/panic.c +++ b/components/esp_system/panic.c @@ -12,7 +12,6 @@ #include "esp_compiler.h" #include "esp_private/system_internal.h" -#include "esp_private/usb_console.h" #include "esp_cpu.h" #include "soc/rtc.h" @@ -64,6 +63,10 @@ #include "hal/usb_serial_jtag_ll.h" #endif +#if CONFIG_ESP_CONSOLE_USB_CDC +#include "esp_private/usb_console.h" +#endif + #ifdef __XTENSA__ #include "xtensa/semihosting.h" #elif __riscv diff --git a/components/esp_system/port/CMakeLists.txt b/components/esp_system/port/CMakeLists.txt index 8ba4c6fce8..d3adc03954 100644 --- a/components/esp_system/port/CMakeLists.txt +++ b/components/esp_system/port/CMakeLists.txt @@ -12,10 +12,6 @@ if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) list(APPEND srcs "image_process.c") endif() -if(CONFIG_ESP_CONSOLE_USB_CDC) - list(APPEND srcs "usb_console.c") -endif() - if(CONFIG_ESP_IPC_ISR_ENABLE) list(APPEND srcs "esp_ipc_isr.c") if(CONFIG_IDF_TARGET_ARCH_XTENSA) diff --git a/components/esp_system/system_init_fn.txt b/components/esp_system/system_init_fn.txt index 5e1b1c308c..f5b74cd689 100644 --- a/components/esp_system/system_init_fn.txt +++ b/components/esp_system/system_init_fn.txt @@ -55,9 +55,10 @@ CORE: 105: init_newlib_time in components/esp_system/startup_funcs.c on BIT(0) CORE: 110: init_vfs_uart in components/esp_driver_uart/src/uart_vfs.c on BIT(0) CORE: 111: init_vfs_usj in components/esp_driver_usb_serial_jtag/src/usb_serial_jtag_vfs.c on BIT(0) CORE: 112: init_vfs_usj_sec in components/esp_driver_usb_serial_jtag/src/usb_serial_jtag_vfs.c on BIT(0) -CORE: 113: init_vfs_nullfs in components/vfs/nullfs.c on BIT(0) -CORE: 114: init_vfs_console in components/esp_vfs_console/vfs_console.c on BIT(0) -CORE: 115: init_libc_stdio in components/newlib/src/init.c on BIT(0) +CORE: 113: init_vfs_usb_cdc_rom_console in components/esp_usb_cdc_rom_console/vfs_cdcacm.c on BIT(0) +CORE: 118: init_vfs_nullfs in components/vfs/nullfs.c on BIT(0) +CORE: 119: init_vfs_console in components/esp_vfs_console/vfs_console.c on BIT(0) +CORE: 120: init_libc_stdio in components/newlib/src/init.c on BIT(0) CORE: 130: init_flash in components/esp_system/startup_funcs.c on BIT(0) CORE: 140: init_efuse in components/efuse/src/esp_efuse_startup.c on BIT(0) @@ -112,7 +113,7 @@ SECONDARY: 205: init_bootloader_offset in components/esp_system/startup_funcs.c # usb_console needs to create an esp_timer at startup. # This can be done only after esp_timer initialization (esp_timer_init_os). -SECONDARY: 220: esp_usb_console_init_restart_timer in components/esp_system/port/usb_console.c on BIT(0) +SECONDARY: 220: esp_usb_console_init_restart_timer in components/esp_usb_cdc_rom_console/usb_console.c on BIT(0) # usb_serial_jtag needs to create and acquire a PM lock at startup. # This makes more sense to be done after esp_pm_impl_init (called from init_pm). diff --git a/components/esp_vfs_console/test_apps/.build-test-rules.yml b/components/esp_usb_cdc_rom_console/.build-test-rules.yml similarity index 78% rename from components/esp_vfs_console/test_apps/.build-test-rules.yml rename to components/esp_usb_cdc_rom_console/.build-test-rules.yml index 526b1ad3b0..49b4843dc5 100644 --- a/components/esp_vfs_console/test_apps/.build-test-rules.yml +++ b/components/esp_usb_cdc_rom_console/.build-test-rules.yml @@ -1,4 +1,4 @@ # Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps -components/esp_vfs_console/test_apps/usb_cdc_vfs: +components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs: enable: - if: IDF_TARGET in ["esp32s3"] # reason: console components is only implemented on these targets. TODO P4: IDF-9120 diff --git a/components/esp_usb_cdc_rom_console/CMakeLists.txt b/components/esp_usb_cdc_rom_console/CMakeLists.txt new file mode 100644 index 0000000000..01f3551f44 --- /dev/null +++ b/components/esp_usb_cdc_rom_console/CMakeLists.txt @@ -0,0 +1,18 @@ +idf_build_get_property(target IDF_TARGET) + + +if(CONFIG_ESP_CONSOLE_USB_CDC) + list(APPEND srcs "usb_console.c") +endif() + +idf_component_register(SRCS ${srcs} + INCLUDE_DIRS include + PRIV_REQUIRES esp_timer + LDFRAGMENTS linker.lf + ) + +if(CONFIG_VFS_SUPPORT_IO AND CONFIG_ESP_CONSOLE_USB_CDC) + target_link_libraries(${COMPONENT_LIB} PUBLIC idf::vfs) + target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c") + target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_vfs_dev_cdcacm_include_dev_init") +endif() diff --git a/components/esp_vfs_console/include/esp_private/esp_vfs_cdcacm.h b/components/esp_usb_cdc_rom_console/include/esp_private/esp_vfs_cdcacm.h similarity index 100% rename from components/esp_vfs_console/include/esp_private/esp_vfs_cdcacm.h rename to components/esp_usb_cdc_rom_console/include/esp_private/esp_vfs_cdcacm.h diff --git a/components/esp_system/include/esp_private/esp_vfs_cdcacm_select.h b/components/esp_usb_cdc_rom_console/include/esp_private/esp_vfs_cdcacm_select.h similarity index 100% rename from components/esp_system/include/esp_private/esp_vfs_cdcacm_select.h rename to components/esp_usb_cdc_rom_console/include/esp_private/esp_vfs_cdcacm_select.h diff --git a/components/esp_system/include/esp_private/usb_console.h b/components/esp_usb_cdc_rom_console/include/esp_private/usb_console.h similarity index 100% rename from components/esp_system/include/esp_private/usb_console.h rename to components/esp_usb_cdc_rom_console/include/esp_private/usb_console.h diff --git a/components/esp_vfs_console/include/esp_vfs_cdcacm.h b/components/esp_usb_cdc_rom_console/include/esp_vfs_cdcacm.h similarity index 100% rename from components/esp_vfs_console/include/esp_vfs_cdcacm.h rename to components/esp_usb_cdc_rom_console/include/esp_vfs_cdcacm.h diff --git a/components/esp_usb_cdc_rom_console/linker.lf b/components/esp_usb_cdc_rom_console/linker.lf new file mode 100644 index 0000000000..1ff773f6b3 --- /dev/null +++ b/components/esp_usb_cdc_rom_console/linker.lf @@ -0,0 +1,18 @@ +[mapping:esp_usb_cdc_rom_console] +archive: libesp_usb_cdc_rom_console.a +entries: + if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF: + usb_console:esp_usb_console_write_char (noflash) + usb_console:esp_usb_console_write_buf (noflash) + usb_console:esp_usb_console_flush_internal (noflash) + usb_console:esp_usb_console_osglue_wait_proc (noflash) + usb_console:esp_usb_console_osglue_dis_int (noflash) + usb_console:esp_usb_console_osglue_ena_int (noflash) + usb_console:esp_usb_console_interrupt (noflash) + usb_console:esp_usb_console_poll_interrupts (noflash) + usb_console:esp_usb_console_cdc_acm_cb (noflash) + usb_console:esp_usb_console_dfu_detach_cb (noflash) + usb_console:esp_usb_console_before_restart (noflash) + usb_console:esp_usb_console_on_restart_timeout (noflash) + vfs_cdcacm:cdcacm_tx_cb (noflash) + vfs_cdcacm:cdcacm_rx_cb (noflash) diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/CMakeLists.txt b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/CMakeLists.txt similarity index 96% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/CMakeLists.txt rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/CMakeLists.txt index 86ac25a3ab..1387c4448d 100644 --- a/components/esp_vfs_console/test_apps/usb_cdc_vfs/CMakeLists.txt +++ b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/CMakeLists.txt @@ -1,5 +1,5 @@ # This is the project CMakeLists.txt file for the test subproject -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) list(PREPEND SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers" "sdkconfig.defaults") diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/README.md b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/README.md similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/README.md rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/README.md diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt similarity index 88% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt index 14d0b8955d..c50268bee9 100644 --- a/components/esp_vfs_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt +++ b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/main/CMakeLists.txt @@ -2,6 +2,6 @@ set(src "test_app_main.c") idf_component_register(SRCS ${src} PRIV_INCLUDE_DIRS . - PRIV_REQUIRES esp_system esp_vfs_console unity + PRIV_REQUIRES esp_system esp_vfs_console unity esp_usb_cdc_rom_console WHOLE_ARCHIVE ) diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/main/test_app_main.c b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/main/test_app_main.c similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/main/test_app_main.c rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/main/test_app_main.c diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/pytest_usb_cdc_vfs.py b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/pytest_usb_cdc_vfs.py similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/pytest_usb_cdc_vfs.py rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/pytest_usb_cdc_vfs.py diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.ci b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.ci similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.ci rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.ci diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.ci.release b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.ci.release similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.ci.release rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.ci.release diff --git a/components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.defaults b/components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.defaults similarity index 100% rename from components/esp_vfs_console/test_apps/usb_cdc_vfs/sdkconfig.defaults rename to components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs/sdkconfig.defaults diff --git a/components/esp_system/port/usb_console.c b/components/esp_usb_cdc_rom_console/usb_console.c similarity index 100% rename from components/esp_system/port/usb_console.c rename to components/esp_usb_cdc_rom_console/usb_console.c diff --git a/components/esp_vfs_console/vfs_cdcacm.c b/components/esp_usb_cdc_rom_console/vfs_cdcacm.c similarity index 97% rename from components/esp_vfs_console/vfs_cdcacm.c rename to components/esp_usb_cdc_rom_console/vfs_cdcacm.c index 8b4331116c..e242d81450 100644 --- a/components/esp_vfs_console/vfs_cdcacm.c +++ b/components/esp_usb_cdc_rom_console/vfs_cdcacm.c @@ -16,9 +16,9 @@ #include "esp_attr.h" #include "sdkconfig.h" #include "esp_heap_caps.h" - #include "esp_private/esp_vfs_cdcacm_select.h" #include "esp_private/usb_console.h" +#include "esp_private/startup_internal.h" #define USB_CDC_LOCAL_FD 0 @@ -522,3 +522,19 @@ esp_err_t esp_vfs_dev_cdcacm_register(void) { return esp_vfs_register_fs("/dev/cdcacm", &s_cdcacm_vfs, ESP_VFS_FLAG_STATIC, NULL); } +#if CONFIG_ESP_CONSOLE_USB_CDC +ESP_SYSTEM_INIT_FN(init_vfs_usb_cdc_rom_console, CORE, BIT(0), 113) +{ + esp_err_t err = esp_usb_console_init(); + if (err != ESP_OK) { + return err; + } + + return esp_vfs_dev_cdcacm_register(); +} +#endif + +void esp_vfs_dev_cdcacm_include_dev_init(void) +{ + // Linker hook function, exists to make the linker examine this file +} diff --git a/components/esp_vfs_console/CMakeLists.txt b/components/esp_vfs_console/CMakeLists.txt index b5ee171f5f..5223c748bb 100644 --- a/components/esp_vfs_console/CMakeLists.txt +++ b/components/esp_vfs_console/CMakeLists.txt @@ -8,12 +8,8 @@ set(srcs "vfs_console.c") idf_component_register(SRCS ${srcs} INCLUDE_DIRS include - PRIV_REQUIRES vfs esp_driver_uart esp_driver_usb_serial_jtag - LDFRAGMENTS linker.lf) - -if(CONFIG_ESP_CONSOLE_USB_CDC) - target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c") -endif() + PRIV_REQUIRES vfs esp_driver_uart esp_driver_usb_serial_jtag esp_usb_cdc_rom_console + ) if(CONFIG_VFS_SUPPORT_IO) target_link_libraries(${COMPONENT_LIB} PUBLIC idf::vfs) diff --git a/components/esp_vfs_console/vfs_console.c b/components/esp_vfs_console/vfs_console.c index c3616b0f78..93c4a55a22 100644 --- a/components/esp_vfs_console/vfs_console.c +++ b/components/esp_vfs_console/vfs_console.c @@ -247,14 +247,6 @@ esp_err_t esp_vfs_console_register(void) primary_vfs = esp_vfs_usb_serial_jtag_get_vfs(); #elif CONFIG_ESP_CONSOLE_USB_CDC primary_vfs = esp_vfs_cdcacm_get_vfs(); - err = esp_usb_console_init(); - if (err != ESP_OK) { - return err; - } - err = esp_vfs_dev_cdcacm_register(); - if (err != ESP_OK) { - return err; - } #else primary_vfs = esp_vfs_null_get_vfs(); #endif @@ -267,7 +259,7 @@ esp_err_t esp_vfs_console_register(void) return err; } -ESP_SYSTEM_INIT_FN(init_vfs_console, CORE, BIT(0), 114) +ESP_SYSTEM_INIT_FN(init_vfs_console, CORE, BIT(0), 119) { return esp_vfs_console_register(); } diff --git a/components/newlib/src/init.c b/components/newlib/src/init.c index 809ab07af3..c21e1d5c99 100644 --- a/components/newlib/src/init.c +++ b/components/newlib/src/init.c @@ -14,7 +14,7 @@ ESP_SYSTEM_INIT_FN(init_libc, CORE, BIT(0), 102) return ESP_OK; } -ESP_SYSTEM_INIT_FN(init_libc_stdio, CORE, BIT(0), 115) +ESP_SYSTEM_INIT_FN(init_libc_stdio, CORE, BIT(0), 120) { #if CONFIG_VFS_SUPPORT_IO esp_libc_init_global_stdio("/dev/console"); diff --git a/components/vfs/CMakeLists.txt b/components/vfs/CMakeLists.txt index ca4550376a..fca10cbde8 100644 --- a/components/vfs/CMakeLists.txt +++ b/components/vfs/CMakeLists.txt @@ -15,10 +15,7 @@ list(APPEND sources "vfs.c" "nullfs.c" ) -list(APPEND pr esp_timer - # for backwards compatibility (TODO: IDF-8799) - esp_driver_uart esp_driver_usb_serial_jtag esp_vfs_console - ) +list(APPEND pr esp_vfs_console) idf_component_register(SRCS ${sources} LDFRAGMENTS "linker.lf" diff --git a/components/vfs/nullfs.c b/components/vfs/nullfs.c index 719620cb09..9237f59b37 100644 --- a/components/vfs/nullfs.c +++ b/components/vfs/nullfs.c @@ -318,7 +318,7 @@ static int vfs_null_fsync(int fd) } #if defined(CONFIG_VFS_INITIALIZE_DEV_NULL) || defined(CONFIG_ESP_CONSOLE_NONE) -ESP_SYSTEM_INIT_FN(init_vfs_nullfs, CORE, BIT(0), 113) +ESP_SYSTEM_INIT_FN(init_vfs_nullfs, CORE, BIT(0), 118) { return esp_vfs_null_register(); } diff --git a/docs/en/migration-guides/release-6.x/6.0/system.rst b/docs/en/migration-guides/release-6.x/6.0/system.rst index 9496c5fdab..6f252312ac 100644 --- a/docs/en/migration-guides/release-6.x/6.0/system.rst +++ b/docs/en/migration-guides/release-6.x/6.0/system.rst @@ -180,3 +180,9 @@ The ``CONFIG_APPTRACE_GCOV_ENABLE`` option has been renamed to ``CONFIG_ESP_GCOV **Header File Changes** For the gcov functionality, include the ``esp_gcov.h`` header file instead of ``esp_app_trace.h``. + +System Console (STDIO) +---------------------- + +``esp_vfs_cdcacm.h`` has been moved to the new component ``esp_usb_cdc_rom_console``, you will now have to add an explicit ``REQUIRES`` for ``esp_usb_cdc_rom_console`` if using any functions from this header. + diff --git a/examples/system/console/advanced/main/CMakeLists.txt b/examples/system/console/advanced/main/CMakeLists.txt index f8af67f147..925ae435e9 100644 --- a/examples/system/console/advanced/main/CMakeLists.txt +++ b/examples/system/console/advanced/main/CMakeLists.txt @@ -1,4 +1,4 @@ idf_component_register(SRCS "console_example_main.c" "console_settings.c" PRIV_REQUIRES console esp_driver_uart fatfs esp_driver_usb_serial_jtag - nvs_flash cmd_system cmd_wifi cmd_nvs + esp_usb_cdc_rom_console nvs_flash cmd_system cmd_wifi cmd_nvs INCLUDE_DIRS ".") diff --git a/tools/test_apps/system/g1_components/CMakeLists.txt b/tools/test_apps/system/g1_components/CMakeLists.txt index c14f0f526b..47d05d8485 100644 --- a/tools/test_apps/system/g1_components/CMakeLists.txt +++ b/tools/test_apps/system/g1_components/CMakeLists.txt @@ -68,10 +68,10 @@ set(extra_components_which_shouldnt_be_included # esp_timer is a dependency of esp_pm, esp_system, esp_security, esp_hw_support # esp_pm should be removed from G1 build - # esp_system's dependency is due to usb_console (used for timeout functionality) - # and task_wdt timer implementation on C2, we could possibly place this implementation in esp_timer instead + # esp_system's dependency is due to task_wdt timer implementation on C2, + # we could possibly place this implementation in esp_timer instead # esp_security uses it for esp_ds (used for timeout functionality) - # esp_hw_support uses it for componensating time after sleep (dependency could be reversed) IDF-10416 + # and for componensating time after sleep (dependency could be reversed) IDF-10416 esp_timer # esptool_py is a dependency of bootloader, app_update, partition_table, all of which @@ -94,6 +94,10 @@ set(extra_components_which_shouldnt_be_included # esp_security is required by mbedtls and spi_flash esp_security + + # esp_usb_cdc_rom_console is used by the panic handler, will be conditional on cdc console option when + # the new build-system is implemented + esp_usb_cdc_rom_console ) set(expected_components diff --git a/tools/test_apps/system/g1_components/check_dependencies.py b/tools/test_apps/system/g1_components/check_dependencies.py index 56b1029112..f899a021a9 100644 --- a/tools/test_apps/system/g1_components/check_dependencies.py +++ b/tools/test_apps/system/g1_components/check_dependencies.py @@ -2,10 +2,6 @@ # SPDX-License-Identifier: Unlicense OR CC0-1.0 import argparse import logging -from typing import Dict -from typing import List -from typing import Optional -from typing import Tuple g1_g0_components = [ 'hal', @@ -27,7 +23,7 @@ g1_g0_components = [ # Global expected dependency violations that apply to all targets expected_dep_violations = { - 'esp_system': ['esp_timer', 'bootloader_support', 'esp_pm'], + 'esp_system': ['esp_timer', 'bootloader_support', 'esp_pm', 'esp_usb_cdc_rom_console'], 'spi_flash': ['bootloader_support'], 'esp_hw_support': ['efuse', 'bootloader_support', 'esp_driver_gpio', 'esp_timer', 'esp_pm'], 'cxx': ['pthread'], @@ -46,7 +42,7 @@ target_specific_expected_dep_violations = { } -def merge_expected_violations(target: Optional[str] = None) -> Dict[str, List[str]]: +def merge_expected_violations(target: str | None = None) -> dict[str, list[str]]: """ Merge global and target-specific expected dependency violations. @@ -75,13 +71,13 @@ def merge_expected_violations(target: Optional[str] = None) -> Dict[str, List[st return merged_violations -def parse_dependencies(file_path: str, target: Optional[str] = None) -> Tuple[Dict[str, List[str]], List[str]]: +def parse_dependencies(file_path: str, target: str | None = None) -> tuple[dict[str, list[str]], list[str]]: new_dependency_errors = [] # Get merged expected violations for the specified target merged_expected_violations = merge_expected_violations(target) - with open(file_path, 'r') as file: + with open(file_path) as file: for line in file: line = line.strip(' ;')