Debug Trace Output
Core level debug traces are outputted from the debug task handler via an application defined trace function USBD_Trace()
. This function is located in app_usbd.c
and it is up to you to define how messages are outputted whether through console terminal printf()
statements or serial printf()
statements for example. shows an example of an implementation for USBD_Trace()
with a serial printf()
function.
Debug Trace Configuration
There are several configuration constants necessary to customize the core level debugging traces. These constants are found in usbd_cfg.h
and are summarized in .
Debug Trace Format
The debug task handler follows a simple format when outputting debug events. The format is as follows:
USB <timestamp> <interface number> <endpoint address> <error/info message>
In the event that timestamp, endpoint address, interface number or error messages are not provided, they are left void in the output. An example output is shown in . This example corresponds to traces placed in the USB device core and device driver functions. This trace shows the enumeration process where bus events are received and related endpoints are opened in the device driver. Next, a setup event is sent to the core task followed by receiving the first Get Device Descriptor standard request.