Skip to content

USB Debugging for Snapdragon Devices Integrated

Qualcomm's disclosure of guidelines for handling their integrated USB debugging (EUD) has significant implications, as explained by Casey Connolly. Unfamiliar with it? Many Qualcomm System-on-Chips (SoCs) incorporate this functionality...

Debugging Tools for Snapdragon Via USB Connection
Debugging Tools for Snapdragon Via USB Connection

USB Debugging for Snapdragon Devices Integrated

The Qualcomm Embedded USB Debug (EUD) has revolutionized the way developers approach debugging on Qualcomm System on Chips (SoCs). Since its integration into most Qualcomm SoCs from around 2018, EUD offers a standard USB-based solution for SWD debugging, eliminating the need for external hardware tools like traditional JTAG debuggers[1][2].

### How EUD Enables SWD Debugging over USB

To activate EUD, developers can write to specific SoC registers and start the USB PHY. The exact method varies by Qualcomm SoC generation[1][2]. Once enabled, the host PC sees a composite USB device: a 7-port USB hub with one port being the “EUD control interface”. Sending the correct USB commands causes a second device to appear, exposing the SWD debug interface[1][2]. This SWD interface supports typical hardware debugging features like setting breakpoints, halting processors, reading/writing registers, and single stepping CPU instructions[1].

### Utilizing EUD with OpenOCD: Necessary Build Configurations and Fixes

An OpenOCD fork supports EUD-based SWD debugging, but it requires a specific build configuration. The default OpenOCD source may fail to compile properly without certain fixes that have been made available. These fixes mainly address missing dependencies or code updates needed for the EUD support to compile and run correctly[2]. The currently available OpenOCD fork is somewhat out of date, so you may need to apply patches manually or pull from updated forks and ensure correct build flags and dependencies are set[2].

### Peripherals Beyond SWD: COM and Trace

In addition to the SWD device, EUD exposes COM and trace peripherals over USB. These peripherals theoretically allow serial communication (COM) and tracing/debugging of CPU execution. However, these peripherals currently require more development effort to be usable, and documentation or tools to fully leverage them are still evolving[2].

### Effective EUD Use on Qualcomm SoCs: A Summary

| Aspect | Details | |-------------------------|----------------------------------------------------------------------------------------------| | Activation | Write specific registers and start USB PHY (SoC-dependent) | | USB interface | 7-port USB hub; one port “EUD control interface” + second device exposing SWD | | Main debug interface | SWD over USB | | Tools | OpenOCD fork (needs specific build configs and fixes) | | Additional peripherals | COM and trace interfaces available but immature in support | | Benefits | No external debug hardware needed; works over standard USB; supports kernel/U-Boot debugging|

### Recommendations

- Use the Qualcomm-published source code to interact with EUD and study current OpenOCD forks with EUD support[1][2]. - Apply known compilation fixes and ensure your build environment meets all dependencies for OpenOCD with EUD. - Experiment with COM and trace peripherals when their support matures; contribute back fixes if possible. - Keep an eye on community and Qualcomm updates for improved tooling and documentation.

This approach unlocks convenient and powerful hardware debugging capabilities on Qualcomm Snapdragon devices, especially valuable for kernel and U-Boot development[1][2].

The hardware debugging capabilities offered by the Qualcomm Embedded USB Debug (EUD) are not limited to SWD interfaces; EUD also provides access to COM and trace peripherals via USB, though these require further development and tooling improvements [2]. Moreover, data-and-cloud-computing benefits are realized through EUD, as it no longer requires external hardware tools like traditional JTAG debuggers, simplifying the debugging process and promoting the use of technology.

Read also:

    Latest