|   | 717 | This requires CONFIG_USB_FUNCTION_MASS_STORAGE to be enabled and a USB host controller that can operate in gadget mode | 
          
          
            |   | 718 |  | 
          
          
            |   | 719 |  | 
          
          
            |   | 720 | [=#gadgetacm] | 
          
          
            |   | 721 | ==== USB CDC ACM (Serial) Gadget | 
          
          
            |   | 722 | You can use USB in device mode for console input/output to a host PC which supports the standard CDC ACM USB driver: | 
          
          
            |   | 723 |  * Examples: | 
          
          
            |   | 724 |   - use only ACM for console | 
          
          
            |   | 725 | {{{#!bash | 
          
          
            |   | 726 | setenv stderr usbacm && setenv stdout usbacm && setenv stdin usbacm | 
          
          
            |   | 727 | }}} | 
          
          
            |   | 728 |   - use both ACM as well as original env based UART serial console (requires CONFIG_CONSOLE_MUX=y): | 
          
          
            |   | 729 | {{{#!bash | 
          
          
            |   | 730 | setenv stderr ${stderr},usbacm && setenv stdout ${stdout},usbacm && setenv stdin ${stdin},usbacm | 
          
          
            |   | 731 | }}} | 
          
          
            |   | 732 |  | 
          
          
            |   | 733 | After doing this on your host PC the device is connected to with a USB-C to Host cable you should see a USB ACM device enumerate and can use it: | 
          
          
            |   | 734 |  * example on a Linux PC you will see the following in syslog (dmesg): | 
          
          
            |   | 735 | {{{#!bash | 
          
          
            |   | 736 | usb 3-10.5.5: new high-speed USB device number 21 using xhci_hcd | 
          
          
            |   | 737 | usb 3-10.5.5: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice= 2.21 | 
          
          
            |   | 738 | usb 3-10.5.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 | 
          
          
            |   | 739 | usb 3-10.5.5: Product: USB download gadget | 
          
          
            |   | 740 | usb 3-10.5.5: Manufacturer: Gateworks | 
          
          
            |   | 741 | usb 3-10.5.5: SerialNumber: 445096 | 
          
          
            |   | 742 | usb-storage 3-10.5.5:1.0: USB Mass Storage device detected | 
          
          
            |   | 743 | usb-storage 3-10.5.5:1.0: Quirks match for vid 0525 pid a4a5: 10000 | 
          
          
            |   | 744 | cdc_acm 3-10.5.5:1.0: ttyACM0: USB ACM device | 
          
          
            |   | 745 |  | 
          
          
            |   | 746 | # connect to ttyACM0 with a terminal program such as screen/minicom/picocom | 
          
          
            |   | 747 | screen /dev/ttyACM0 | 
          
          
            |   | 748 | }}} | 
          
          
            |   | 749 |  | 
          
          
            |   | 750 |  | 
          
          
            |   | 751 | This requires CONFIG_USB_FUNCTION_ACM to be enabled and a USB host controller that can operate in gadget mode | 
          
          
            |   | 752 |  |