cancel
Showing results for 
Search instead for 
Did you mean: 

LCD16DebugPrinter not displaying anything on RGB565 480x480 display (STM32U5)

nico23
Senior III

I'm trying to use LCD16DebugPrinter to display debug text on a 480x480 RGB565 display running on STM32U5A9J-DK (circular display). I've set it up in TouchGFXHAL::initialize():

static touchgfx::LCD16DebugPrinter debugPrinter;
debugPrinter.setPosition(0, HAL::DISPLAY_HEIGHT - 20, HAL::DISPLAY_WIDTH, 20);
debugPrinter.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
debugPrinter.setScale(1);
touchgfx::Application::setDebugPrinter(&debugPrinter);

And in my view's handleTickEvent():

static char debugStr[128];
snprintf(debugStr, sizeof(debugStr), "TICK TEST");
touchgfx::Application::setDebugString(debugStr);

Nothing appears on screen. Things I've already ruled out:

  • String buffer lifetime - using static char[] So the pointer remains valid
  • Color contrast - white background, black text
  • Widget conflict - disabled all custom widgets, issue persists

How it is supposed to work?

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks, also the issue seems to be adding the code to TouchGFXHAL::initialize() doesn't make it work.

Instead, following the documentation and adding it to FrontendApplication made it work. Thanks

View solution in original post

2 REPLIES 2
MBrau.7
Associate III

You need to call  the following function after every change of the debug string content.

touchgfx::Application::invalidateDebugRegion();

 

Thanks, also the issue seems to be adding the code to TouchGFXHAL::initialize() doesn't make it work.

Instead, following the documentation and adding it to FrontendApplication made it work. Thanks