2022-08-08 11:46 AM
Hi everybody,
I have some problems with my project : the function STM32TouchController::sampleTouch(int32_t& x, int32_t& y) is called only the first pressure.
What is the reason? I'm using Touchgfx 20 with a 480x320 SPI display: graphic is designing correctly but I don't now the cause of touch system blocking.
Is there a problem with graphic design methd? Maybe something wrong can block touch functions?
Has someone some tips?
thanks
2022-08-12 01:21 AM
Hello @MPast.1 ,
Is it possible for you to share your project please ?
Could be very helpful for debugging your issue.
Thanks,
/Yoann
2022-08-22 12:57 PM
Hi Yoann,
I'm sorry for my late answer but I was in vacation without internet connection.
Today I uploaded my test project on this link: https://www.transfernow.net/dl/20220822atfcyELp. (the link is available until 08/29/22)
The project contains everything: sources, pictures and TouchGfx project. The dimension arre 61 Mbytes.
I confirm that touch function is not more called after main screen drawing.
Can you help me to understand the reason?
The problem does not appear if I disable TEARING effect on display init procedure and if I call touchgfxSignalVSync periodically with a timer interrupt . (Can be it usefull ???)
There is an #define called USE_TEARING_IRQ for the Tearing Effect management: whe this is enable taering effect is managed by EXTernal interrupt, else by a periodic calling.
You can find the display drivers, Tearing Effect mangament and SPI&DMA communication inside the folder: Drivers/BSP/ili9488/ili9488.cpp.
The routine called bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y) is located at the original path.
Thanks in advance for your interesting.
Best regards.
MarcoP
2022-08-30 01:40 AM
Hi Yoann,
did you find something?
Do you have news?
thanks
2022-08-30 03:23 AM
Hi, I haven't looked at your code because the link is expired, but I'm pretty sure why it doesn't work. Check if the coordinates from the touch controller have changed, if they have changed return the new ones and exit with true, if they have not changed do nothing and exit with false.
2022-08-30 11:59 AM
Hi HAndr.1
the problem is that the routine mentioned above is no longer called.
If I put a breakpoint at the first line of STM32TouchController::sampleTouch(int32_t& x, int32_t& y) , firmware doesn't never halt. So the result true or false can't be returned.
2022-09-04 05:51 AM
Hi all,
@Yoann KLEIN I discover the problem, but I need some hints to solved in the right way.
The cause is the tearing effect signal witch is mssing after draw an static screen.
My system is configurated to works with partial frame buffer stategy an SPI Display that use ILI9488 controller.
I discovered when the full screen is draw and when there are not any changes on it, the earing effect signal in not generated and, in this way, external interrupt is not called.
This means touchgfxSignalVSync() is not called and in the end vsync_sem remain always at ZERO.
if vsync_sem is ZERO, sampleTouch(int32_t& x, int32_t& y) routine is not called.
So this is my question: How can I keep active touchscreen system when there are not change on screen (in other words when tearing signal is not generated due to a static Screen)?
I don't want to call touchgfxSignalVSync() with polling every X milliseconds: is it not elegant!
This can be reputed a BUG? How can be solved?
Do you have any suggestions?
Thanks
2022-09-05 02:57 AM
Hi @MPast.1 ,
I have some questions to clarify the issue :
/Yoann
2022-09-05 12:24 PM
bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)
{
TS_StateTypeDef state = {0};
/**
* By default sampleTouch returns false,
* return true if a touch has been detected, otherwise false.
*
* Coordinates are passed to the caller by reference by x and y.
*
* This function is called by the TouchGFX framework.
* By default sampleTouch is called every tick, this can be adjusted by HAL::setTouchSampleRate(int8_t);
*
*/
if (FT6206.Status.flag.DeviceInit == 0) // if touch is not ready
return false; // exit and wait
BSP_TS_GetState(&state);
if(state.touchDetected) // if something is found
{ // report coordinates
x = state.touchX;
y = state.touchY;
return true; // exit WITH touch
}
return false; // exit WITHOUT touch
}
About your last question: i'm not sure at 100% you are right: maybe I'm wronging but I'm sure that if touchgfxSignalVSync() is not called touchgfx tick is not generated. There is no activity to do on the screen because everything is rendered and showed. No tearing effect interrupt is generated by the display.
otherwise if you have an dinamic screen, everything works because touchgfxSignalVSync() is called continuously.
@Yoann KLEIN = Do you wanna see the project?
Thank you.
MarcoP