| 103 | On the target a serial device will be created as {{{/dev/ttyGS0}}} (or the next avaialble ttyGS device). |
| 104 | |
| 105 | On a host device (ie PC) a USB CDC ACM device (VID:PID 0525:a4a7 by default) will appear and behave as a serial device. Module parameters can specify the VID, PID, device version, manufacturer string, product string, serialnumber and whether or not to use CDC ACM, CDC OBEX, and the number of ports to create. |
| 106 | |
| 107 | A Linux USB Host supports this with the {{{cdc_acm}}} driver which will create a {{{/dev/ttyACM0}}} device (or the next available ttyACM). |
| 108 | |
| 109 | To use the Windows ACM driver you must have the "linux-cdc-acm.inf" |
| 110 | file which supports all recent versions: see https://www.kernel.org/doc/Documentation/usb/gadget_serial.txt |
| 111 | |
108 | | * on host device (ie PC) a USB CDC ACM device (VID:PID 0525:a4a7 by default) will appear and behave as a serial device |
109 | | * module parameters can specify the VID, PID, device version, |
110 | | manufacturer string, product string, serialnumber |
111 | | * module parameters can specify whether or not to use CDC ACM, CDC OBEX, and the number of ports to create |
112 | | |
113 | | Linux USB Host notes: |
114 | | * the cdc_acm driver will enumerate this device as '/dev/ttyACM<n>' |
115 | | |
116 | | Windows USB Host notes: |
117 | | * see https://www.kernel.org/doc/Documentation/usb/gadget_serial.txt |
| 117 | |
| 118 | You can allow logins via the {{{/dev/ttyGS0}}} device on the target by running a {{{getty}}} process. For example: |
| 119 | * Configure Ubuntu for console login: |
| 120 | {{{#!bash |
| 121 | # Add g_serial to modules.conf so that its loaded on bootup: |
| 122 | echo g_serial >> /etc/modules-load.d/modules.conf |
| 123 | # create a systemd service for ttyGS0 by enabling a getty instance |
| 124 | sudo systemctl enable getty@ttyGS0.service |
| 125 | # (optional) edit systemd to modify ExecStart if you want to add/edit params to the getty process |
| 126 | sudo systemctl edit getty@ttyGS0.service |
| 127 | # start the getty service |
| 128 | sudo systemctl start getty@ttyGS0.serivce |
| 129 | }}} |
| 130 | - if you wish the device to be available earlier in the boot you would have to configure it static via CONFIG_USB_G_SERIAL=y and add /dev/ttyGS0 to the console kernel cmdline parameter. |
| 131 | |
| 132 | If you want to use a USB ACM serial console in U-Boot see [https://trac.gateworks.com/wiki/uboot#USBCDCACMSerialGadget here]. |