2025-09-17 4:00 AM
Hello All,
I am working on touchgfx project where I had default __weak void TouchGFX_Task(void *argument) task which was working fine for GUI and touch.
Later I have added other task for data transfer over uart1 using another task in main.
Now the problem is the GUI task is showing only first screen and getting freeze, no touch detection and other task is sending data over uart (which is working fine).
Does adding additional task causing the elimination of TouchGFX_Task, or do I need to make some more settings or changes to TouchGFX_Task to function normal ?
2025-09-17 4:23 AM
Hello @Shiv09,
This looks like a issue with your new task running with a higher priority than the TouchGFX_Task, which cant be selected by the scheduler.
Check the way you do your UART communication, some tutorial exist and I can recommend : Getting Started With STM32 and Nucleo Part 2: How to Use I2C to Read Temperature Sensor TMP102 and Introduction to RTOS Part 3 - Task Scheduling | Digi-Key Electronics
BR,
2025-09-17 6:26 AM
Hello @LouisB ,
Thanks for the quick reply,
Yes the priority for both the TouchGFX_Task and the StartApplicationTask is at osPriorityNormal.
I saw the video shared, to get better view,
I need to some how send and receive the Data packets over UART, that's why have used other thread for this purpose. so that the received data could be displayed on UI and transmit to other controller over uart, without disturbing the GUI task.
Now the trouble is my touch is not detectable and no further progress on gui task, where as Uart task is receiving and sending the Data properly.
One thing I noticed, the Default GUI task is mentioned as weak, I dont see any functions with it , as I have with the other task, so just have a query I am going the right way or there is something else I am missing ?
Is there any way to see the tasks are running parallelly or not. or any more thing to debug ?
Just let me know will try as per your suggestion.
Thanks,
Shiv
2025-09-18 12:16 AM
Hello @LouisB ,
I tried to enable the FreeRTOS Task List in stmcubeide, now able to see the status of both tasks.
Now both the task have same priority, as Normal.
1) StartApplicationTask is running where as 2)TouchGFX_Task is moved to ready state, and may be this is causing the problem why the GUI task is not going further.
I think the default scheduler is set to PREEMPTION,
What changes should i try to change the scheduling to Round Robin,
I tried to make few modification in FreeRTOSConfig.h
FROM
define configUSE_PREEMPTION 1
TO
define configUSE_PREEMPTION 1
define configUSE_TIME_SLICING 1 // Added here extra
Is this modification enough to change the scheduling mechanism for osKernelStart() or there is
something more to do?
2025-09-24 11:13 PM
Hello @LouisB ,
Have increased the priority for touchgfx task and now Uart task has comparatively less priority.
Can see both the task running, though the touchgfx task doesnt have body so have to add the message queue get in tick function which is getting values from uart task.
Though now the problem is touchgfx task gets tick every systick.
Now the touch pad works for some time(few seconds) and after few click the touch is getting unresponsive.
I can see the Uart data getting send from other thread, but no operation on touchgfx task as the touchpannel itself got stuck,
is there something i can try to make things both of tasks working fine ?
If any one tried this then please provide your thoughts on it.
Br,
Shiv