none
Capturing Debug Output (NKDbgPrintfW) RRS feed

  • Question

  • This is an OS question for Windows Embedded Compact 2013.

    We would like to capture the output that goes to debug serial port. These are fielded units so connecting a laptop to the serial port is not possible. There are thousands of units, changing the OS is undesirable. Microsoft says not to include CeLog for shipped devices.

    We tried using the Debugger API which worked fine on a user-level program but DebugActiveProcess hung when attaching to NK.exe. Platform Builder apparently uses this method but there must be something special about a kernel debugger.

    We do not need to capture output while the unit is booting, after the OS is up and running is good enough.

    Thanks in advance,
    Tom


    Signature withheld by request

    Tuesday, September 3, 2019 9:18 PM

Answers

  • DrP

    Sometimes you need to debug in the field, so sometimes you may want to include CeLog in your  shipped device.

    For one of my projects, we developed a proprietary debug output driver.  This allowed us to send the debug output from the kernel to the driver, then save the data.  We had total control of the driver, so we could turn it on/off and set file size limits to avoid overusing the filesystem.  You may want to consider developing something like this yourself.


    Bruce Eitman
    Senior Enginer
    Bruce.Eitman AT Synopsys DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for
    Synopsys

    • Marked as answer by DrP Tuesday, September 10, 2019 1:24 PM
    Friday, September 6, 2019 12:58 PM
    Moderator

All replies

  • DrP

    Sometimes you need to debug in the field, so sometimes you may want to include CeLog in your  shipped device.

    For one of my projects, we developed a proprietary debug output driver.  This allowed us to send the debug output from the kernel to the driver, then save the data.  We had total control of the driver, so we could turn it on/off and set file size limits to avoid overusing the filesystem.  You may want to consider developing something like this yourself.


    Bruce Eitman
    Senior Enginer
    Bruce.Eitman AT Synopsys DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for
    Synopsys

    • Marked as answer by DrP Tuesday, September 10, 2019 1:24 PM
    Friday, September 6, 2019 12:58 PM
    Moderator
  • Hello Bruce,

    Thank you for the advice, we are taking that direction.

    For others that may be interested;  Microsoft provides the source to CeLog and other event logging utilities. We ran CeLogFlush (which loads CeLog.dll) that created a binary file. We used SimpleReader to parse the binary to text. The messages that output on the serial debug port were captured and timestamped.

    CeLog places the log events into a ring buffer and signals a named event when the buffer is nearly full. CeLogFlush uses the event to read from the ring buffer., convert to text and save to a file. We hope to modify CeLogFlush and hook into our logging subsystem. CeLogFlush uses a Transport interface which we should be able to modify for our needs.

    Thanks again,
    Tom


    Signature withheld by request

    Tuesday, September 10, 2019 4:05 PM