How to save DEBUGMSG to file?


I am using Apalis iMX6 with Windows Embedded Compact 2013

I was trying to setup a way of logging the debug messages sent to the Visual Studio console onto our device.

I found the function SetStdioPathW which would allow me to change the path of the stdin and stdout to a text file according to this forum thread.

I read, that SetStdioPathW can only be used in Kernel Mode. How can I enable this mode? Is there an easier way of logging the debug messages?

Currently those debug messages can be only sent to a serial port. This is done at a very low level in the kernel (OAL), and the functions writing them directly accesses the UART. This is by design in Windows CE, not a Toradex-specific implementation.
It’s teorically possible to store those messages in RAM and build a mechanism for a user-mode application to retrieve them and process them lately, but this will require deep modification of the OAL and the implementation of a polling mechanism that may impact performances.
If you have access to code it’s simpler to re-define the macros generating debug messages to use the console or file-based logs.