Showing results for 
Search instead for 
Did you mean: 

How do I set the Model::Tick() cycle in TouchGFX?

Associate III

There is a Model::tick() timer function in TouchGFX.

I wonder if it is possible to set the calling period of this function.

In my program now it is repeated every 0.285msec.

I want to change this to be called every 15msec, so please give me advice on where to look.

Senior III

this question is somewhat similar to this:

You could just encapsulate the part of the code you want to 'limit' with the same approach I outline in the other thread.


  1. check if enough time has passed since last time
  2. if enough time has passed, do something and update the time you last did something
ST Employee


This is something to set outside in CubeMX or in code. Are you using an OS or running on bare metal ? The tick source of the TouchGFX application is set in the "Driver" section in the TouchGFX additionnal software settings in CubeMX. The next steps I am not sure but you can have a look at that for now 😅. Are you using a custom board or one of the ST development kits. Did you start your project with one of the application template available in TouchGFX Designer


I am developing at stm32f469i_Discovery.

It changed from a 4-inch LCD to a 5-inch ILI9806E LCD, and raised the driver to Video mode, with the Model::tick() cycle being changed.

And Touch IC changed to GT911.

The Model::tick() function still has no change in the period.

In the STM32TouchController.cpp function,

bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)


if (bsp_ts_initialized)


TS_StateTypeDef state;


if(mCount >4000){

mCount =0;


if (state.touchDetected)


x = state.touchX;

y = state.touchY;

return true;




return false;


This change made the cycle faster.

I don't know why the cycle changes.