Getting debug (trace) messages from Win32

262 views
asked Oct 8, 2019 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, 2019 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, 2019 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, 2019 by PhilShaw
2017 Community Edition.
commented Oct 8, 2019 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, 2019 by PhilShaw
Yes, this should give me enough info to figure out what is going on.

 

Thanks
commented Oct 21, 2019 by Manfred Schweyer

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

...