cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx can't detect any touch

DVale
Associate II

Hello,

I started the development of a touchgfx application from a F4 evaluation board but I'm using a different display (720x720) and a different touch controller.

The video output looks good, the interactions that doesn't involve any touch action work good, but it can't detect any touch.

I forced the touchDetected field to 1 to debug this issue, I cannot understand how the touchgfx core can ignore the "touch" when x, y and the boolean returned are correct.

Is there a touch register? Is there any way to debug how the output of the sampleTouch function is used?

 Here I post the code:

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

{

 /* USER CODE BEGIN F4TouchController_sampleTouch */

   

  TS_StateTypeDef state;

  BSP_TS_GetState(&state);

  if (state.TouchDetected)

  {

    x = (int32_t)state.X;

    y = (int32_t)state.Y;

    return true;

  }

  return false;

 /* USER CODE END F4TouchController_sampleTouch */   

}

Thank you

3 REPLIES 3
Martin KJELDSEN
Chief III

Hi @DVale​,

I couldn't find this because i only monitor the TouchGFX subforum. I'll repost what i wrote in the other one and added "TouchGFX" to your tag list in this one.

TouchGFX won't ignore your touch. I'm not sure what's going on because i don't have your project or board.

TouchGFX at its core does not really care about touch outside of offering a handler that you can implement and use your own drivers (ST-drivers in this case, since its an eval board) to return x,y and whether or not the touch registers indicate a touch. We have to look to the project and version of drivers, etc. The touch registers are read by the driver through a protocol like I2C. You can't inspect it directly.

Can you please try to create your project through the designer - We should have application templates for all F4 based ST boards (that work). And which F4 board is this? You should be able to make some comparisons for your project setup

/Martin

DVale
Associate II

Probably I must avoid to send too much touch to touchgfx engine.

I added a piece of code that check the interrupt sent by the touch controller and now the touch are detected. Basically now I'm using state.TouchDetected correctly and the inferface works fine.

Thanks!

Martin KJELDSEN
Chief III

Okay, that sounds great! I'm not completely sure why it works now but glad it does! :)

/Martin