Embedded USB Debug For Snapdragon

According to [Casey Connolly], Qualcomm’s release of how to interact with their embedded USB debugging (EUD) is a big deal. If you haven’t heard of it, nearly all Qualcomm SoCs made since 2018 have a built-in debugger that connects to the onboard USB port. The details vary by chip, but you write to some registers and start up the USB phy. This gives you an oddball USB interface that looks like a seven-port hub with a single device “EUD control interface.”

So what do you do with that? You send a few USB commands, and you’ll get a second device. This one connects to an SWD interface. Of course, we have plenty of tools to debug using SWD.

In particular, there’s a fork of OpenOCD that knows how to use EUD, although it required a library that wasn’t available to us mere mortals. But now it is, so smooth sailing, right?

Um, no. Unless you have a very specific build configuration, the code won’t compile. Luckily, the fixes are not that hard and are available. The OpenOCD fork is a bit out of date, too. But with perseverance, it all worked.

In addition to the SWD device, there appears to be a COM and trace peripheral available, although those may need more work to be usable. If you make progress on those, let us know.

SWD debugging can be very handy. While not everyone likes debuggers, we’ve been a fan of hardware-based debugging for a long time.

5 thoughts on “Embedded USB Debug For Snapdragon

  1. i do not love the paragraph in here that does indeed provide the pull requesti, but nonetheless made me suspect “area man struggles with ‘make’ for a couple hours” was the point of the article

    but what’s the upshot here? can qualcomm phones be rooted??? or is the story really just that qualcomm devkits / sbcs support a serial debug protocol?

    1. Qualcomm does not place any restriction on unlocking the bootloader, and by extension, rooting the phone. The only entity restricting such is the OEM. Only a few now (Google, Nothing, OnePlus, and a few others) allow you to unlock your bootloader hassle-free. Others might allow you but not easily/with caveats (Samsung, Xiaomi), but most won’t allow you to unlock AT ALL.
      Also what you might be referring to is Samsung making the American models of certain phones (which used qcom instead of exynos) unable to be unlocked.

Leave a Reply to agreenbhmCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.