cancel
Showing results for 
Search instead for 
Did you mean: 

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​

ZFeng.1
Associate II

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

4 REPLIES 4
Romain DIELEMAN
ST Employee

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

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?

Wasn't there some issue with the pins in the schematic, vs those in the code defines of the bsp?

The TE pin? Off by one.

Will fish when back on a computer..​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

0693W00000DmvtzQAB.pngThank you very much for your answer. I tested it. When I used the above example on the STM32L4R9I-disco, it was normal when I didn't add my simple thread. When I added it, it sometimes crashed.When I added a simple thread, I checked it, and the stack did not overflow. The simple thread was running normally, but the Show crashed. My simple thread is as follows

unsigned int test_val;

 for(;;)

 {

test_val++;

if(test_val >= 1000)

test_val = 0;

   osDelay(1);

 }

I will try to re-port it completely, hoping to find the problem.