Two threads randomly crash,When I have two threads, the touchgfx Sometimes randomly crashes。I debugged and found that the OSWrappers::waitForVSync() is not executed
I used cubemx to configure the DMA2D,LDTC ,DSIHOST, GFXMMU,and FreeRTOS. I have two threads configured as follows
const osThreadAttr_t Logic_ProcessTask_attributes = {
.name = "Logic_ProcessTask",
.priority = (osPriority_t) osPriorityBelowNormal,
.stack_size = 1024 * 1
};
const osThreadAttr_t GuiTask_attributes = {
.name = "GuiTask",
.priority = (osPriority_t) osPriorityNormal,
.stack_size = 4096 * 4
};
void StartGuiTask(void *argument)
{
MX_TouchGFX_Process();
for(;;)
{
osDelay(1);
}
}
The logical tasks are as follows:
void Logic_ProcessTask(void *argument)
{
static unsigned int msCount = 0;
/* Infinite loop */
for(;;)
{
msCount++;
if(msCount % 100 == 0)
{
HAL_GPIO_TogglePin(LED_GPIO_Port,LED_Pin); //Toggel LED
}
osDelay(1);
}
}
The content of the gui task is to display the time, which is generated by TouchGFX Designer。
When I don’t create the Logic_ProcessTask, the StartGuiTask is working OK。 but When I created the Logic_ProcessTask, the StartGuiTask task sometimes crashes.
I debugged and found that when the StartGuiTask crashed, the OSWrappers::signalVSync()
is working,but the OSWrappers::waitForVSync() is not executed。 I don't know why。
Thanks a lot
