|
| 1 | +.. _cdc_acm_shield: |
| 2 | + |
| 3 | +Generic shields for CDC ACM UART |
| 4 | +################################ |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +This is a generic shield that provides devicetree and configuration overlays, |
| 10 | +and configures USB device stack so that CDC ACM UART can be used as backend |
| 11 | +for console, logging, and shell. It is mainly intended to be used with boards |
| 12 | +that do not have a debug adapter or native UART, but do have a USB device |
| 13 | +controller. |
| 14 | +This approach allows us to avoid many identical overlays in samples and tests |
| 15 | +directories (see :ref:`usb_device_cdc_acm` for more details). |
| 16 | +It also simplifies the configuration of the above mentioned boards, |
| 17 | +they can stay with the minimal configuration which minimizes the conflicts |
| 18 | +especially with different in-tree samples. |
| 19 | + |
| 20 | +These shields enable :kconfig:`CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT` and |
| 21 | +configure USB device stack so that it is automatically initialized. |
| 22 | +This is important for the boards like :ref:`nrf52840dongle_nrf52840`, |
| 23 | +otherwise in-tree samples, that do not enable USB device support, are |
| 24 | +not usable. But it also means that in-tree samples, like :ref:`usb_cdc-acm`, |
| 25 | +that initialize USB device support themselves cannot be used with these shields. |
| 26 | +This is a good compromise which provides maximum coverage of usable samples for |
| 27 | +these specific USB dongles. |
| 28 | + |
| 29 | +Current supported chosen properties |
| 30 | +=================================== |
| 31 | + |
| 32 | ++------------------------+---------------------+ |
| 33 | +| Chosen property | Shield Designation | |
| 34 | +| | | |
| 35 | ++========================+=====================+ |
| 36 | +| ``zephyr,console`` | ``cdc_acm_console`` | |
| 37 | ++------------------------+---------------------+ |
| 38 | +| ``zephyr,shell-uart`` | ``cdc_acm_shell`` | |
| 39 | ++------------------------+---------------------+ |
| 40 | +| ``zephyr,bt-c2h-uart`` | ``cdc_acm_bt_c2h`` | |
| 41 | ++------------------------+---------------------+ |
| 42 | + |
| 43 | +Requirements |
| 44 | +************ |
| 45 | + |
| 46 | +This shield can only be used with a board which provides a USB device |
| 47 | +controller. |
| 48 | + |
| 49 | +Programming |
| 50 | +*********** |
| 51 | + |
| 52 | +Set ``-DSHIELD=cdc_acm_shell`` when you invoke ``west build``. For example: |
| 53 | + |
| 54 | +.. zephyr-app-commands:: |
| 55 | + :zephyr-app: samples/subsys/shell/shell_module |
| 56 | + :board: nrf52840dongle_nrf52840 |
| 57 | + :shield: cdc_acm_shell |
| 58 | + :goals: build |
| 59 | + |
| 60 | +Or ``-DSHIELD=cdc_acm_console``, for example: |
| 61 | + |
| 62 | +.. zephyr-app-commands:: |
| 63 | + :zephyr-app: samples/basic/threads |
| 64 | + :board: nrf52840dongle_nrf52840 |
| 65 | + :shield: cdc_acm_console |
| 66 | + :goals: build |
| 67 | + |
| 68 | +With ``-DSHIELD=cdc_acm_bt_c2h``, :ref:`bluetooth-hci-uart-sample` can use |
| 69 | +CDC ACM UART as interface to the host: |
| 70 | + |
| 71 | +.. zephyr-app-commands:: |
| 72 | + :zephyr-app: samples/bluetooth/hci_uart |
| 73 | + :board: nrf52840dongle_nrf52840 |
| 74 | + :shield: cdc_acm_bt_c2h |
| 75 | + :goals: build |
0 commit comments