Joe Vince
Joe Vince

Reputation: 355

Can I get debug information on USB?

Currently I am working on Yocto OS for my project. My question regarding debugging. In normal practice, the debug information is sent through the serial port. I aware about ssh debug. I have two questions:

  1. Why does every device normally support debugging over serial port?
  2. Is there any possible way to debug through the USB port (without using serial to USB converter) in Yocto?

Upvotes: 2

Views: 1061

Answers (1)

0andriy
0andriy

Reputation: 4709

  1. Because a serial driver can be simple and implemented without interrupts (it’s how the Linux kernel console actually does). This is a requirement due to emergency cases when crash log should be sent as much as possible and as full as possible.

  2. You have a few options:

  • a) use a USB-2-Serial and /dev/ttyUSB0, or
  • b) use a USB-2-Ethernet and setup netconsole, or
  • c) (only on the newest xHCI hardware with debug capability and with additional code to write) you may enable earlyprintk for USB. Note, it requires special debug cable to be connected (note, the blue colored is not the same, you need the orange one), or
  • d) USB2 (EHCI), which supports debug capability, requires a special device to be connected in between, which is not needed for USB3 (see option c) above).

Variant c) is partially supported in the v4.13-rc1 Linux kernel, there is HOWTO file (in the kernel source tree Documentation/driver-api/usb/usb3-debug-port.rst).

Upvotes: 2

Related Questions