USB Gadget Serial Driver

From Wiki-DB
Jump to navigationJump to search

The USB Gadget Serial Driver provides a tty style serial line interface through the USB-OTG connection of the board.


General Information

For further information have a look at http://www.kernel.org/doc/Documentation/usb/gadget_serial.txt.

Configure the USB-OTG Port

To use USB Gadget features the USB-OTG Port has to be initialized in USB slave mode. Add "otg_mode=device" to the kernel commandline on the bootloader console.

On DHCOM boards it is possible to use the u-boot environment variable "linux_add_param":

  1. enter bootloader console with DEL/BS Key
  2. setenv linux_add_param otg_mode=device
  3. saveenv


Prepare the Kernel

Prepare the Linux Kernel Sources to be able to compile.

Open a console window and go to the root directory of the kernel sources and start the kernel configuration dialog:

  • ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make menuconfig

Enable the following items:

  • Device Drivers --> USB Support --> USB Gadget Support
  • Device Drivers --> USB Support --> USB Gadget Support --> USB Peripheral Controller
choose the matching device controller:
* DHCOM AM35x: OMAP USB Device Controller
* DHCOM iMX25: Freescale Highspeed USB DR Peripheral Controller
  • Device Drivers --> USB Support --> USB Gadget Support --> USB Gadget Drivers --> Serial Gadget (with CDC ACM and CDC OBEX support)

Exit the configuration dialog an start building the kernel:

  • ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make uImage

Install the kernel on your board.


Configure the Root Filesystem

To be able to do a user-login at the usb gadget serial line add the following line to /etc/inittab near line 65:

  • T1:23:respawn:/sbin/getty -L ttyGS0 9600 vt100

If you want to able to login as "root" you have to add ttyGS0 to the file /etc/securetty.


Host PC configuration

Connect the board via usb-otg to your host pc. If you working with linux search for "/dev/ttyACM0" or similar. You can open that device-file with minicom or similar tools without additional configurations.

If you want to connect to a windows host pc you have to install the required *.inf file before using the interface.