zephyr/subsys/usb/device_next/CMakeLists.txt
Johann Fischer 7ffa6203e1 usb: device_next: allow CDC ACM UART to be initialized and enabled at boot
There are some boards and samples in the tree that use the CDC ACM UART
as the default serial backend, just like a real UART controller would.
The new device stack requires more detailed configuration than the old
one. In order to use the CDC ACM UART as the serial backend with the new
device stack in the same way as with the legacy stack, we need to
provide a solution to initialise and enable the CDC ACM UART at boot
time. We cannot use snippets as they do not support Kconfig files or
source code. Shields would be an option, but they cannot be used for
virtual devices such as the CDC ACM UART. The remaining solution is to
put the code and Kconfig file for it in the subsys directory.

Allow CDC ACM UART instance and USB device stack to be initialized and
enabled at boot time and to use it as serial backend for logging or
shell.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-12 02:22:18 +01:00

103 lines
1.7 KiB
CMake

# Copyright (c) 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
zephyr_library_sources(
usbd_device.c
usbd_desc.c
usbd_ch9.c
usbd_core.c
usbd_init.c
usbd_config.c
usbd_class.c
usbd_interface.c
usbd_endpoint.c
usbd_msg.c
)
add_subdirectory(app)
zephyr_library_sources_ifdef(
CONFIG_USBD_SHELL
usbd_shell.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_LOOPBACK_CLASS
class/loopback.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_CDC_ACM_CLASS
class/usbd_cdc_acm.c
)
zephyr_include_directories_ifdef(
CONFIG_USBD_CDC_ECM_CLASS
${ZEPHYR_BASE}/drivers/ethernet
)
zephyr_library_sources_ifdef(
CONFIG_USBD_CDC_ECM_CLASS
class/usbd_cdc_ecm.c
)
zephyr_include_directories_ifdef(
CONFIG_USBD_CDC_NCM_CLASS
${ZEPHYR_BASE}/drivers/ethernet
)
zephyr_library_sources_ifdef(
CONFIG_USBD_CDC_NCM_CLASS
class/usbd_cdc_ncm.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_BT_HCI
class/bt_hci.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_MSC_CLASS
class/usbd_msc.c
class/usbd_msc_scsi.c
)
zephyr_linker_sources_ifdef(
CONFIG_USBD_MSC_CLASS
SECTIONS class/usbd_msc.ld
)
zephyr_library_sources_ifdef(
CONFIG_USBD_AUDIO2_CLASS
class/usbd_uac2.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_MIDI2_CLASS
class/usbd_midi2.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_HID_SUPPORT
class/usbd_hid.c
class/usbd_hid_api.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_DFU
class/usbd_dfu.c
)
zephyr_library_sources_ifdef(
CONFIG_USBD_DFU_FLASH
class/usbd_dfu_flash.c
)
zephyr_linker_sources_ifdef(
CONFIG_USBD_DFU
SECTIONS class/usbd_dfu.ld
)
zephyr_linker_sources(DATA_SECTIONS usbd_data.ld)