Driver debug messages

  • Hello,


    does everone know, how to print debug information into console (terminal), when I manually load network driver?


    I have got NetDCU10 with Windows Embedded 6.0 with no display.
    I created test application, where I call folllowing:


    Code
    1. bResult = DeviceIoControl(hNdis,
    2. IOCTL_NDIS_REGISTER_ADAPTER,
    3. L"My Adapter\0My Adapter1\0\0",
    4. sizeof(L"My Adapter\0My Adapter1\0\0"),
    5. NULL,
    6. 0,
    7. NULL,
    8. NULL);


    Everything is OK, driver is loaded, but I see no debug information, that I wrote into driver with the aid of standard DEBUGMSG (RETAILMSG) macro. I'm using remote connection to device via ethernet and telnetd.


    The output from Visual Studio 2005 is set as DEBUG build. What should I do/enable to see debug messages?


    Thanks a lot for any reply,


    O. Esner

  • hello,


    Quote

    does everone know, how to print debug information into console (terminal), when I manually load network driver?


    are you are trying to use the console embedded in Visual Studio or are you running an external terminal programm like DCUTermi? In some cases the debug-console of Visual Studion 2005 isn't able to display debug outputs.


    Additionalty please regard that you have to enable usage of COM1 for debug messages in bootloader. On default ndcucfg running on this serial port. See this thread to get more information how to configure COM1 for your needs.


    If there are still some problems, please post an example how you are using the DEBUGMSG and RETAILMSG macros.


    best regards,
    M.Kiepfer

    Software developer, F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Quote from "oldaesner"

    but I see no debug information, that I wrote into driver with the aid of standard DEBUGMSG (RETAILMSG) macro.


    DEBUGMSG and RETAILMSG output their data directly on the debug port, *not* on stdout or stderr. Therefore this data can not be made visible in a console window. The only way is to activate debug output on COM1 by command 'O' (uppercase o) in Eboot. This automatically disables COM1 for usage under WinCE, which means that NDCUCFG will not be able to start on that port. Usually this is no problem as the port can be reactivated any time, for example when driver development is finished.


    Best regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • M. Kiepfer, keller:


    Thank you, it works, although it's a little bit complicated (need to have NetDCU10 connected via USB (ActiveSync), ethernet (console window) and serial cable (DcuTermi debug output) together).


    I think, it will be sufficient for me, but is there any other way (function, macro), how to print from driver DLL file something like "debug" print to stdout (console)? It means for example printf, fprintf.. Eventually, print to any created ".log, .txt" file.


    O. Esner

  • Quote from "oldaesner"

    I think, it will be sufficient for me, but is there any other way (function, macro), how to print from driver DLL file something like "debug" print to stdout (console)? It means for example printf, fprintf..


    Well, have you already tried printf? Because in a normal program it opens a console window. If this also works from a driver, I'm not sure. But it's worth a try.


    Quote

    Eventually, print to any created ".log, .txt" file.


    This should be possible with fprintf(). However the file writing might mix up your driver timing. On the other hand this is also true for Debug messages on the serial line, therefore it might not matter to you anyway.


    Best regards,


    H. Keller

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Quote


    Well, have you already tried printf?


    Yes, I tried to use printf, but it has no effect. There is also another one function - printk() - printing in kernel mode (linux), but perphaps is not included in Windows CE libraries.


    Anyway, I tested DEBUGMSG a lot yesterday and it's very powerful solution (behaviour like a printf function).



    Best regards


    O. Esner