Skip to content

Commit 1f0152d

Browse files
committed
Merge branch 'feature/cdcacm_vfs_comp' into 'master'
feat(usb_cdc_console): moved usb-cdc ROM console to new component: esp_usb_cdc_rom_console Closes IDF-13797 See merge request espressif/esp-idf!41040
2 parents 9b0733b + 56e0c11 commit 1f0152d

File tree

34 files changed

+92
-62
lines changed

34 files changed

+92
-62
lines changed

.gitlab/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
/components/esp_tee/ @esp-idf-codeowners/security
120120
/components/esp_timer/ @esp-idf-codeowners/system
121121
/components/esp-tls/ @esp-idf-codeowners/app-utilities
122+
/components/esp_usb_cdc_rom_console/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals/usb
122123
/components/esp_vfs_*/ @esp-idf-codeowners/storage
123124
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
124125
/components/esp_wifi/ @esp-idf-codeowners/wifi

components/console/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ idf_component_register(SRCS ${srcs}
3838
REQUIRES "${requires}"
3939
PRIV_REQUIRES esp_driver_uart
4040
esp_driver_usb_serial_jtag
41+
esp_usb_cdc_rom_console
4142
)
4243

4344
if(CONFIG_COMPILER_STATIC_ANALYZER AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # TODO IDF-10085

components/esp_system/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ else()
7676
# [refactor-todo] requirements due to init code,
7777
# should be removable once using component init functions
7878
# link-time registration is used.
79-
bootloader_support esp_pm
79+
bootloader_support esp_pm esp_usb_cdc_rom_console
8080
LDFRAGMENTS "linker.lf" "app.lf")
8181
add_subdirectory(port)
8282

components/esp_system/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ menu "ESP System Settings"
2525
- Unified Behavior Sanitizer (UBSAN) hook
2626
- Interrupt watchdog handler
2727
- XTAL32K watchdog timer
28-
- USB CDC functions for the esp_rom_printf (if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF=y)
2928
- IPC and IPC ISR
3029

3130
choice ESP_SYSTEM_PANIC

components/esp_system/linker.lf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ entries:
3434
if COMPILER_STACK_CHECK = y:
3535
stack_check:__stack_chk_fail (noflash)
3636

37-
if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF:
38-
usb_console:esp_usb_console_write_char (noflash)
39-
usb_console:esp_usb_console_write_buf (noflash)
40-
usb_console:esp_usb_console_flush_internal (noflash)
41-
usb_console:esp_usb_console_osglue_wait_proc (noflash)
42-
usb_console:esp_usb_console_osglue_dis_int (noflash)
43-
usb_console:esp_usb_console_osglue_ena_int (noflash)
44-
usb_console:esp_usb_console_interrupt (noflash)
45-
usb_console:esp_usb_console_poll_interrupts (noflash)
46-
usb_console:esp_usb_console_cdc_acm_cb (noflash)
47-
usb_console:esp_usb_console_dfu_detach_cb (noflash)
48-
usb_console:esp_usb_console_before_restart (noflash)
49-
usb_console:esp_usb_console_on_restart_timeout (noflash)
50-
5137
if APP_BUILD_TYPE_RAM = n:
5238
image_process (noflash)
5339

components/esp_system/panic.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "esp_compiler.h"
1313

1414
#include "esp_private/system_internal.h"
15-
#include "esp_private/usb_console.h"
1615

1716
#include "esp_cpu.h"
1817
#include "soc/rtc.h"
@@ -64,6 +63,10 @@
6463
#include "hal/usb_serial_jtag_ll.h"
6564
#endif
6665

66+
#if CONFIG_ESP_CONSOLE_USB_CDC
67+
#include "esp_private/usb_console.h"
68+
#endif
69+
6770
#ifdef __XTENSA__
6871
#include "xtensa/semihosting.h"
6972
#elif __riscv

components/esp_system/port/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP)
1212
list(APPEND srcs "image_process.c")
1313
endif()
1414

15-
if(CONFIG_ESP_CONSOLE_USB_CDC)
16-
list(APPEND srcs "usb_console.c")
17-
endif()
18-
1915
if(CONFIG_ESP_IPC_ISR_ENABLE)
2016
list(APPEND srcs "esp_ipc_isr.c")
2117
if(CONFIG_IDF_TARGET_ARCH_XTENSA)

components/esp_system/system_init_fn.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ CORE: 105: init_newlib_time in components/esp_system/startup_funcs.c on BIT(0)
5555
CORE: 110: init_vfs_uart in components/esp_driver_uart/src/uart_vfs.c on BIT(0)
5656
CORE: 111: init_vfs_usj in components/esp_driver_usb_serial_jtag/src/usb_serial_jtag_vfs.c on BIT(0)
5757
CORE: 112: init_vfs_usj_sec in components/esp_driver_usb_serial_jtag/src/usb_serial_jtag_vfs.c on BIT(0)
58-
CORE: 113: init_vfs_nullfs in components/vfs/nullfs.c on BIT(0)
59-
CORE: 114: init_vfs_console in components/esp_vfs_console/vfs_console.c on BIT(0)
60-
CORE: 115: init_libc_stdio in components/newlib/src/init.c on BIT(0)
58+
CORE: 113: init_vfs_usb_cdc_rom_console in components/esp_usb_cdc_rom_console/vfs_cdcacm.c on BIT(0)
59+
CORE: 118: init_vfs_nullfs in components/vfs/nullfs.c on BIT(0)
60+
CORE: 119: init_vfs_console in components/esp_vfs_console/vfs_console.c on BIT(0)
61+
CORE: 120: init_libc_stdio in components/newlib/src/init.c on BIT(0)
6162

6263
CORE: 130: init_flash in components/esp_system/startup_funcs.c on BIT(0)
6364
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
112113

113114
# usb_console needs to create an esp_timer at startup.
114115
# This can be done only after esp_timer initialization (esp_timer_init_os).
115-
SECONDARY: 220: esp_usb_console_init_restart_timer in components/esp_system/port/usb_console.c on BIT(0)
116+
SECONDARY: 220: esp_usb_console_init_restart_timer in components/esp_usb_cdc_rom_console/usb_console.c on BIT(0)
116117

117118
# usb_serial_jtag needs to create and acquire a PM lock at startup.
118119
# This makes more sense to be done after esp_pm_impl_init (called from init_pm).
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
2-
components/esp_vfs_console/test_apps/usb_cdc_vfs:
2+
components/esp_usb_cdc_rom_console/test_apps/usb_cdc_vfs:
33
enable:
44
- if: IDF_TARGET in ["esp32s3"] # reason: console components is only implemented on these targets. TODO P4: IDF-9120
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
idf_build_get_property(target IDF_TARGET)
2+
3+
4+
if(CONFIG_ESP_CONSOLE_USB_CDC)
5+
list(APPEND srcs "usb_console.c")
6+
endif()
7+
8+
idf_component_register(SRCS ${srcs}
9+
INCLUDE_DIRS include
10+
PRIV_REQUIRES esp_timer
11+
LDFRAGMENTS linker.lf
12+
)
13+
14+
if(CONFIG_VFS_SUPPORT_IO AND CONFIG_ESP_CONSOLE_USB_CDC)
15+
target_link_libraries(${COMPONENT_LIB} PUBLIC idf::vfs)
16+
target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c")
17+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_vfs_dev_cdcacm_include_dev_init")
18+
endif()

0 commit comments

Comments
 (0)