cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX application is running on simulator but failed when it runs on discovery board.

NK
Associate II

As per the tutorial 5: https://support.touchgfx.com/docs/tutorials/tutorial-05, I have implemented a custom trigger as per part 1. Its work perfectly on simulator but it did not run on discovery board.

When I debug this application, control went to buttonCallback handler but never hit to setBackGroundColor function.

Please let me know what I am missing.

void Screen1ViewBase::setBackGroundColor(colortype value)

{

  //Interaction1

  //When setBackGroundColor is called execute C++ code

  //Execute C++ code

  backGround.setColor(value);

  backGround.invalidate();

void Screen1ViewBase::buttonCallbackHandler(const touchgfx::AbstractButton& src)

{

  if (&src == &button)

  {

    //Interaction2

    //When button clicked call setBackGroundColor on Screen1

    //Call setBackGroundColor

    setBackGroundColor(touchgfx::Color::getColorFrom24BitRGB(rand()%256, rand()%256, rand()%256));

  }

}

8 REPLIES 8
Romain DIELEMAN
ST Employee

Hi,

Are you working with a custom board or from a TouchGFX Board Setup for one of ST's development kits ? What is the color depth ? Maybe also try this function instead

touchgfx::Color::getColorFromRGB(rand()%256, rand()%256, rand()%256)

I tried the tutorial with the STM32H7B3-dk and it works fine. There is nothing wrong with the piece of code you shared. Could you share your project so that I can have a look at the settings within Designer ?

/Romain

I tried on both a 24bpp board (the STM32H7B3-dk board), where it works, and a 16bpp board (STM32F429-dk) where it does not work. It seems like the rand is the issue.

/Romain

I am working on 16bpp board(STM32H747-Disco), So I will try getColorFromRGB instead of getColorFrom24BitRGB.

Thank you for your support!

I checked for getColorFromRGB function but there is no such function in color.hpp file

 

What version of TouchGFX Designer are you using ?

/Romain

I cannot run on my board from this. The project is based on TouchGFX 4.16.1 which is why you do not have the getColorFromRGB() function but it is not an issue. The online application template for the STM32H747 disco board has a color depth of 24bpp, so I suppose you created a project from scratch and set it to 16bpp ?

/Romain

NK
Associate II

Okay.Thank you!