Debug

This topic describes how to use debug messages in the USB client controller.

As the USB PDD runs in kernel mode, debug printfs are implemented using the KTRACE macro. This macro takes two arguments:

  • The debug message type

  • A kernel object that takes a message string as a constructor.

Two debug message types are used:

  • KPANIC for error messages

  • KUSBPSL for PSL information messages

The following code samples illustrate their use:

_KTRACE_OPT(KPANIC, Kern::Printf("Error: USB Controller not present"));
_KTRACE_OPT(KUSBPSL, Kern::Printf("Received new Ep0 Setup packet"));

Note: Do not use the KUSB flag. This flag is used within the PDD PIL and the USB LDD only.