USB Device HID Debugging via Virtual TTY
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional USB debugging methods require external serial cables, which are insecure and cumbersome, and the Android Debug Bridge method necessitates additional endpoint resources and complex configuration, posing security risks and usability issues during device sales.
Innovation Solution
Implementing a Human Interface Device (HID) on a USB device using its interface to enable debugging without a device driver, utilizing a virtual serial port Teletype (TTY) device to transmit and execute input information through a GETTTY program, thereby saving endpoint resources and enhancing security.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If traditional serial cable debugging method is used, then device can be debugged, but hardware external serial cable is required and device cannot be debugged during sales phase
Solution Approach 1:
The patent extracts the debugging function from the external serial cable dependency and integrates it into the USB device itself through HID interface. The debugging capability is embedded in the device's USB interface, eliminating the need for separate external serial cables while maintaining debugging functionality during the sales phase.
Solution Approach 2:
The patent makes the USB interface serve multiple functions: both its original purpose for device communication and the additional debugging function. By implementing HID interface on the USB device, the same interface handles both normal operation and debugging operations, eliminating the need for separate dedicated debugging hardware.
2Ease of operation
If external serial port is used for debugging, then device can be debugged, but hackers can obtain important information and crack password mechanism
Solution Approach 1:
The patent introduces a virtual serial port TTY device as an intermediary between the external terminal and the device's debugging interface. This virtual port acts as a secure mediator that processes debugging commands through the HID interface, preventing direct access to the device's internal systems while maintaining debugging functionality.
Solution Approach 2:
The patent replaces the traditional physical serial cable connection with a virtual/HID-based communication mechanism. Instead of direct physical access through external serial ports, the debugging process uses the HID interface's report IDs and virtual TTY device, substituting the mechanical serial connection with a software-based secure interface.
3Ease of operation
If ADB debugging method is used, then device can be debugged, but need to install ADB driver on host and configuration is cumbersome
Solution Approach 1:
The patent enables the USB device to perform debugging operations independently through its own HID interface implementation. The device self-provides the debugging functionality through its USB interface without requiring external ADB drivers or complex configuration on the host system. The debugging capability is self-contained within the device's USB interface.
4Ease of operation
If ADB GADGET function is implemented, then device can be debugged, but requires two additional bulk endpoints which requires more endpoint resources
Solution Approach 1:
The patent makes the existing HID interface endpoints serve dual purposes: both normal device operation and debugging operations. Instead of allocating separate endpoints for ADB GADGET functionality, the same HID interface endpoints are used for both purposes, eliminating the need for additional endpoint resources while maintaining full debugging capability.
Data Source
AI summary
A debugging method for a Universal Serial Bus (USB) device includes: receiving input information of a terminal through a Human Interface Device (HID) device; when report ID of the input information is a serial port ID, transmitting the input information to a buffer of a virtual serial port Teletype (TTY) device; and extracting the input information of the terminal from the buffer of the virtual serial port TTY device, executing a shell command on the input information, and returning execution result to the terminal through an original path. The method uses a USB interface to implement a HID device, thereby realizing drive-free execution. In addition, use of the endpoint of the HID device can save endpoints needed for additional debugging and driving.


