Understanding sysfs and USB

Reference’s 1) http://www.makelinux.net/ldd3/chp-13-sect-2.shtml 2) Allen Stern’s description $ cd /sys/bus/usb/devices /sys/bus/usb/devices# ls -al usb* usb1 -> ../../../devices/pci0000:00/0000:00:1d.7/usb1 usb2 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2 usb3 -> ../../../devices/pci0000:00/0000:00:1d.1/usb3 usb4 -> ../../../devices/pci0000:00/0000:00:1d.2/usb4 usb5 -> ../../../devices/pci0000:00/0000:00:1d.3/usb5 This shows that it has 5 root hubs. Now, lets try to correlate it with lsusb. A simple shell script which will print only RootHubs available … Read more

USB Ethernet Testing – Measuring network throughput using iperf

Cross Compile Iperf for ARM $ git clone https://github.com/esnet/iperf.git $ cd iperf/ Assuming toolchain is located at /home/devlab/devlab/linaro/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf $ export PATH=$PATH:/home/devlab/devlab/linaro/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin $ mkdir out $ ./configure –host=arm-linux-gnueabihf –prefix=/home/devlab/devlab/iperf/out $ make $ make install * copy ./out/bin/iperf to /usr/local/bin of BeagleBoard(ARM platform) RFS. On linux host :~$ iperf -s ———————————————————— Server listening on TCP port 5001 … Read more

How to Test USB Mass Storage Device Read/Write Speed ?

Following description show how to test linux usb mass-storage drivers/devices Simple mass-storage bench-marking – Mount usb mass-storage device at /mnt/usb (Note: for embedded target, you may need to use “su” to switch to root user for necessary mount permissions OR For desktop, you will need to use sudo) $ sudo mount /dev/sdb1 /mnt/usb Use dd … Read more

How to test USB to RS-232 Serial Adaptor ?

Following description show how to test linux usb serial drivers/devices Getting Console over USB: Refer to Serial_Console_over_USB_to_OTG FAQ – Q1. How to change the COM port number(s) assigned to USB to serial adapter by Windows 2000/XP? A. To change the COM port number assigned to a USB to RS-232 Serial Adaptor follow the steps below: … Read more

usbutils – USB userspace utilities for Linux, how to compile, install and use on Ubuntu

USButils is a collection of USB tools for use on Linux and BSD systems to query what type of USB devices are connected to the system. Clone the source code using below command, $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git $ cd usbutils/ first get usbhid-dump : $ git submodule init Submodule ‘usbhid-dump’ (https://github.com/DIGImend/usbhid-dump.git) registered for path ‘usbhid-dump’ … Read more

Flow diagram of Linux USB composite Gadget Architecture

,——————, | USER | | application | ‘——————‘ /|\ | USER \|/ ========================================================================================================================================= KERNEL /|\ | \|/ ,——————, | drivers/char/ | tty_layer | tty_io.c | ‘——————‘ /|\ | struct (1) | open/close/read/write (9) usb_gadget_driver struct | (2) usb_composite_driver \|/ ,———————, ,—————, usb_composite_ ,———————-, (4) ,———————-, | | (3) | | register | | gserial_setup | … Read more