Part 1
요약·해설
Composite USB enumeration, DTR과 두 terminal 연결 절차를 설명합니다.
Two CDC-ACM ports
ttyACM1 · ttyACM2
Cross-port forwarding
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
C1699AC37D79B9465151D41C51825758357A31A8EAFA1108962FE51DF061A9A7
.. zephyr:code-sample:: usb-cdc-acm-composite
:name: USB CDC-ACM composite
:relevant-api: _usb_device_core_api
Implement a composite USB device exposing two serial ports using USB CDC-ACM driver.
Overview
********
This sample app demonstrates use of a USB Communication Device Class (CDC)
Abstract Control Model (ACM) driver provided by the Zephyr project in
Composite configuration.
Two serial ports are created when the device is plugged to the PC.
Received data from one serial port is sent to another serial port
provided by this driver.
Running
*******
Plug the board into a host device, for example, a PC running Linux.
The board will be detected as shown by the Linux dmesg command:
.. code-block:: console
usb 1-1.5.4: new full-speed USB device number 28 using ehci-pci
usb 1-1.5.4: New USB device found, idVendor=2fe3, idProduct=0002, bcdDevice= 2.03
usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.5.4: Product: Zephyr CDC ACM Composite sample
usb 1-1.5.4: Manufacturer: ZEPHYR
usb 1-1.5.4: SerialNumber: 86FE679A598AC47A
cdc_acm 1-1.5.4:1.0: ttyACM1: USB ACM device
cdc_acm 1-1.5.4:1.2: ttyACM2: USB ACM device
The app prints on serial output, used for the console:
.. code-block:: console
Wait for DTR
Open a serial port emulator, for example, minicom,
and attach it to both detected CDC ACM devices:
.. code-block:: console
minicom --device /dev/ttyACM1
minicom --device /dev/ttyACM2
The app should respond on serial output with:
.. code-block:: console
DTR set, start test
Baudrate detected: 115200
Baudrate detected: 115200
And on ttyACM devices provided by the Zephyr USB device stack:
.. code-block:: console
Send characters to another UART device
The characters entered in one serial port will be sent to another
serial port.
Part 3
한국어 전문 번역
개요
이 sample application은 Zephyr project가 제공하는 USB Communication Device Class(CDC) Abstract Control Model(ACM) driver를 composite configuration으로 사용하는 방법을 보여 줍니다.
Device를 PC에 연결하면 serial port 두 개가 생성됩니다. 한 serial port에서 수신한 data는 driver가 제공하는 다른 serial port로 전달됩니다.
실행
Board를 Linux PC 같은 host device에 연결합니다. Linux의 dmesg에는 다음과 같이 composite device와 두 interface인 ttyACM1, ttyACM2가 감지됩니다.
usb 1-1.5.4: new full-speed USB device number 28 using ehci-pci
usb 1-1.5.4: New USB device found, idVendor=2fe3, idProduct=0002, bcdDevice= 2.03
usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.5.4: Product: Zephyr CDC ACM Composite sample
usb 1-1.5.4: Manufacturer: ZEPHYR
usb 1-1.5.4: SerialNumber: 86FE679A598AC47A
cdc_acm 1-1.5.4:1.0: ttyACM1: USB ACM device
cdc_acm 1-1.5.4:1.2: ttyACM2: USB ACM device
Console로 사용하는 serial output에는 application이 DTR(Data Terminal Ready) 신호를 기다린다는 message가 나타납니다.
Wait for DTR
Minicom 같은 serial port emulator 두 개를 열어 감지된 CDC ACM device 각각에 연결합니다.
minicom --device /dev/ttyACM1
minicom --device /dev/ttyACM2
DTR이 설정되면 application의 serial output에는 test 시작과 각 port에서 감지된 baud rate가 표시됩니다.
DTR set, start test
Baudrate detected: 115200
Baudrate detected: 115200
Zephyr USB device stack이 제공하는 ttyACM device에는 다음 prompt가 표시됩니다.
Send characters to another UART device
한 serial port에 입력한 문자는 다른 serial port로 전달됩니다. 따라서 두 terminal을 동시에 열어 양쪽 data path를 확인해야 합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.