Skip to main content
Marco.R
Senior
December 6, 2019
Solved

DebugPrinter Feature available in TouchGFX 4.12.3?

  • December 6, 2019
  • 8 replies
  • 1657 views

Hi

Does anyone know if the DebugPrinter is still available in current version (see Link)?​. I tried to implement it but it looks like LCD16DebugPrinter isn't available anymore.

If it is still available, how can I use it?

Thanks

Marco

This topic has been closed for replies.
Best answer by Martin KJELDSEN

I think that in 4.12.3 the DebugPrinter was renamed to LCD24DebugPrinter. It probably was 24bit to begin with (related to the hand-written glyphs being used).

In 4.13.0 we have DebugPrinter support for all LCD drivers. Should be out this december.

/d/TouchGFX/4.12.3/touchgfx/lib/core/cortex_m7/gcc
$ nm libtouchgfx.a | grep DebugPrinter
00000001 W _ZN8touchgfx17LCD24DebugPrinterD0Ev
00000001 W _ZN8touchgfx17LCD24DebugPrinterD1Ev
00000001 W _ZN8touchgfx17LCD24DebugPrinterD2Ev
00000000 n _ZN8touchgfx17LCD24DebugPrinterD5Ev
00000001 T _ZNK8touchgfx17LCD24DebugPrinter4drawERKNS_3LCDE
00000000 R _ZTVN8touchgfx17LCD24DebugPrinterE

/Martin

8 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
December 6, 2019

I think that in 4.12.3 the DebugPrinter was renamed to LCD24DebugPrinter. It probably was 24bit to begin with (related to the hand-written glyphs being used).

In 4.13.0 we have DebugPrinter support for all LCD drivers. Should be out this december.

/d/TouchGFX/4.12.3/touchgfx/lib/core/cortex_m7/gcc
$ nm libtouchgfx.a | grep DebugPrinter
00000001 W _ZN8touchgfx17LCD24DebugPrinterD0Ev
00000001 W _ZN8touchgfx17LCD24DebugPrinterD1Ev
00000001 W _ZN8touchgfx17LCD24DebugPrinterD2Ev
00000000 n _ZN8touchgfx17LCD24DebugPrinterD5Ev
00000001 T _ZNK8touchgfx17LCD24DebugPrinter4drawERKNS_3LCDE
00000000 R _ZTVN8touchgfx17LCD24DebugPrinterE

/Martin

Marco.R
Marco.RAuthor
Senior
December 6, 2019

Hi @Martin KJELDSEN​

Thank you for the information. In that case I'll wait for the next release.

Marco

scottSD
Senior III
December 6, 2019

I ran across DebugPrinter yesterday and was wondering about how to implement it as well.

Thanks for providing the link you did.

Martin, are are there an example that utilizes it?

scottSD
Senior III
December 6, 2019

I did get something to compile and work (somewhat). Things have changed since the TouchGFX Tips and Tricks in the link you provided.

FrontendApplication.cpp:

#include <gui/common/FrontendApplication.hpp>
#include <platform/driver/lcd/LCD24bpp.hpp>
LCD24DebugPrinter lcd24bppDebugPrinter;
 
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
 : FrontendApplicationBase(m, heap)
{
	lcd24bppDebugPrinter.setDebugPosition(0, 0, 240, 40);
	lcd24bppDebugPrinter.setDebugScale(2);
	lcd24bppDebugPrinter.setDebugColor(0x00); //black
	Application::setDebugPrinter(&lcd24bppDebugPrinter);
}

Then when implementing it in a Screen1View.cpp, calling the following function works except not invalidated on the screen correctly.

Unicode::UnicodeChar debugStringBuffer[30];
 
void Screen1View::updateDebugString()
{
 static int count = 0;
 count++;
 Unicode::snprintf(debugStringBuffer, sizeof(debugStringBuffer), "%d", count);
 Application::getDebugPrinter()->setDebugString((const char*)debugStringBuffer);
 // touchgfx::Application::invalidateDebugRegion();
}

I needed to comment out the call to invalidateDebugRegion() because it is no longer a valid function.

I tried to call invalidateArea(), but is a protected function.