none
Debug Message Options: Not able to change in Compact embedded 2013 RRS feed

  • Question

  • Hello,

    I am using COMPACT Embedded 2013 with a AM33x BSP from Adeneo and I'm trying to disable the output  of Process ID and Thread ID on the serial console.

    My output looks always like:

    PID:032D000E TID:032C000E My message

    Normally this should work with the Debug Message Options, but it don't!
    I can't uncheck any checkbox in the Debug Message Options.

    I have done some analysis to disable the output of Process ID and Thread ID and I found the code where it is added to the output. At this code (which is in \WINCE800\private\winceos\COREOS\nk\kernel\printf.c) there is no condition for printing out the process and thread id. I can disable the output by commenting out the corresponding lines in printf.c build the nkmain.lib and do a clean sysgen. But I don't think that this is the right way to switching this off. Does anyone know a different solution?

    Monday, January 5, 2015 10:15 AM

Answers

  • The answer is to modify the OAL and set
    g_pOemGlobal->pfnWriteDebugString = NULL;

    Setting this pointer to NULL makes the kernel call g_pNKGlobal->pfnWriteDebugString directly instead of prepending the PID/TID information and calling OEMWriteDebugString().
    You should be aware that this also bypasses thread synchronization but if you are happy to remove the PID/TID you are probably experienced enough to cope!
    For more information refer to NKOutputDebugString and DoODS in WINCE700\PRIVATE\winceos\COREOS\nk\kernel\printf.c

    ______________________________________________________________________________

    Please mark as answer if the answer solved the issue.

    Vote me if you found the answer worthwhile.

    Regards

    Niveth Richard S



    Saturday, January 10, 2015 5:33 PM

All replies

  • The answer is to modify the OAL and set
    g_pOemGlobal->pfnWriteDebugString = NULL;

    Setting this pointer to NULL makes the kernel call g_pNKGlobal->pfnWriteDebugString directly instead of prepending the PID/TID information and calling OEMWriteDebugString().
    You should be aware that this also bypasses thread synchronization but if you are happy to remove the PID/TID you are probably experienced enough to cope!
    For more information refer to NKOutputDebugString and DoODS in WINCE700\PRIVATE\winceos\COREOS\nk\kernel\printf.c

    ______________________________________________________________________________

    Please mark as answer if the answer solved the issue.

    Vote me if you found the answer worthwhile.

    Regards

    Niveth Richard S



    Saturday, January 10, 2015 5:33 PM
  • To disable the PID/TID below is what you have to set 

     g_pOemGlobal->pfnWriteDebugString = NULL;

    But i have observed earlier that during suspend & resume any debug prints during OEMPowerOff will use the NULL function pointer and cause the system to crash.

    The solution is to restore the kernel to use the default serial debug during OEMPowerOff()...

    VOID BSPPowerOff()
    {
        // If OEMInit() cleared g_pOemGlobal->pfnWriteDebugString to remove VID/PID
        // from debug output, g_pNKGlobal->pfnWriteDebugString will now be NULL (see
        // NKPowerOffSystem() in WINCE700\private\winceos\COREOS\nk\kernel\kwin32.c)
        if (NULL == g_pNKGlobal->pfnWriteDebugString)
        {
            // Set kernel pfnWriteDebugString so that debug prints in OEMPowerOff()
            // do not crash the system.
            // NKPowerOffSystem() will restore the orginal value following return 
            // from OEMPowerOff()
            g_pNKGlobal->pfnWriteDebugString = (PFN_WriteDebugString)OEMWriteDebugString;
        }
    }



    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Saturday, January 10, 2015 7:29 PM