1k views
in Platform Packages by
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
by

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.

by
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.
by

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.

by
No, still no success.
by
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.
by

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.

 

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

Which version are you using?
by
2017 Community Edition.
by

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...

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

 

Thanks
by

Hi Phil,

in case of using the latest MSVC versions, you can change the implementation of EwOpenConsole() - it is located in {Program Files (x86)}\Embedded Wizard 9.20\Platforms\Tara\Win32\RTE:

void EwOpenConsole( void )
{
  FILE* f;

  /* At first open the standard console */
  if ( !AllocConsole())
    return;

  /* Set the title of the console window */
  SetConsoleTitleA( "Embedded Wizard Console" );

  /* ... and connect this console with the standard output file handle */
  freopen_s( &f, "CONOUT$", "w", stderr );
  freopen_s( &f, "CONOUT$", "w", stdout );
}

It will be changed in the next release version.

Best regards,

Manfred.

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

...