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.



from Blog – Hackaday https://ift.tt/C34u0ix

Comments

Popular posts from this blog

Modern Radio Receiver Architecture: From Regenerative to Direct Conversion

Homebrew 68K Micro-ATX Computer Runs Its Own OS

Join the Movement with this Mini Cyberdeck