Skip to main content
ZFeng.1
Associate
August 24, 2021
Question

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​

  • August 24, 2021
  • 4 replies
  • 1060 views

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

​

This topic has been closed for replies.

4 replies

Romain DIELEMAN
ST Employee
September 9, 2021

Hi,

Digging this up. Have you been able to fix your issue ? On which mcu were you working ? I seem to have faced the same thing with a STM32L4R9dk.

/Romain

ZFeng.1
ZFeng.1Author
Associate
September 10, 2021

Thank you very much for your answer. The mcu I use is STM32L4R9VGT6. Our design scheme is the reference STM32L4R9I-disco .I tried many methods, but I couldn’t solve it,If this problem occurs, is there any way to recover it?