Getting debug (trace) messages from Win32

17 views
asked Oct 8 in Platform Packages by PhilShaw
Hi,

Is it possible to see trace messages from the Win32 platform package?

I have inconsistent behaviour between the prototyper and the Win32 and STM32 builds and need to trace why.

Thanks

Phil

1 Answer

0 votes
answered Oct 8 by Manfred Schweyer

Hi Phil,

of course, this is possible.

Please define the macro EW_OPEN_CONSOLE within your Win32 project and rebuild it. When you start the Win32 executable an additional terminal window appears where you will see all the trace messages.

Best regards,

Manfred.

commented Oct 8 by PhilShaw
Hi Manfred,

I am clearly missing something.

I have added a Macro called 'Debug' to the Win32 Profile with the content NEW_OPEN_CONSOLE but I do not get a new window when I run the executable.
commented Oct 8 by Manfred Schweyer

Hi Phil,

within your MSVC project you can add the macro EW_OPEN_CONSOLE (not NEW_OPEN_CONSOLE) to the project settings. You can add this define at Project Configuration - C/C++ - Preprocessor.

Does it work?

Manfred.

commented Oct 8 by PhilShaw
No, still no success.
commented Oct 8 by PhilShaw
Ok, some progress.

I have to add '<Traces>EW_OPEN_CONSOLE</Traces>' to the <PropertyGroup Label="Globals"> in the .vcxproj file to get the macro to appear in the predetermined list in VS.

I now get the console open, but I do not see the trace data that is present in the prototyper.
commented Oct 8 by Manfred Schweyer

Let me try to explain that in more details - here is a short experiment:

Open the example 'CoffeeMachine':

Edit the methods Application::Application StartBrewing() and StopBrewing():

Add a trace message in both methods, e.g.

Generate the code for Win32.
Navigate to the example directory (e.g. {User}\Documents\Embedded Wizard x.xx\Examples\CoffeeMachine) and open MSVC with the project 'CoffeeMachine.sln':

Open the project configuration and add the define EW_OPEN_CONSOLE to the set of preprocessor defines (sorry the screenshot is German):

Now, build the Win32 executable and start it:

A console window opens and the trace messages appear within the window.

Does it work?

Best regards,

Manfred.

 

commented Oct 8 by PhilShaw
No, this did not work either.
commented Oct 8 by Manfred Schweyer
It seems to be related to the MSVC version. I tried it with Visual Studio Express 2012.

Which version are you using?
commented Oct 8 by PhilShaw
2017 Community Edition.
commented Oct 8 by Manfred Schweyer

Ok. We have to analyze the missing outputs.

As a kind of workaround, you can start the Win32 executable from command line window and redirect the outputs to a file, e.g.

CoffeeMachine.exe > test.log

Maybe this helps for the moment...

commented Oct 8 by PhilShaw
Yes, this should give me enough info to figure out what is going on.

 

Thanks

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...