cancel
Showing results for 
Search instead for 
Did you mean: 

Display stops working on evaluation board STM32L4R9IDISCOVERY with a project created with TouchGFX 4.16

djunho
Associate II

Hello all,

This is not a common question. It is just to report a "bug" I encountered, to get feedback from the forum about my solution and a warning to others that may face this same problem =)

I suffered some strange "behaviors" when executing a simple test with TouchGFX Designer v4.16 generated project for the board 32L4R9IDISCOVERY[1]. The display simply stop working after a while.

What I have done:

I created a project on TouchGFX version 4.16 for this board. Then I designed a screen with just an animated image.

On the main file, I created other 4 tasks that only have a delay and asm("nop") (code on below).

Behavior:

After running for a while, the display simply hangs out. But the firmware is running normally (the tasks are still running).

My analysis:

We found that in the generated (by the example board, not the TouchGFX) file "TouchGFXHAL.cpp" has some "if" on interrupt calls that caused this behavior.

When checking the 

if (osKernelGetState() == osKernelRunning)

its assumption that the Kernel is always running, which is not always correct. If the interrupts enter while the Kernel is scheduling, the kernel state is locked.

My solution:

if ((osKernelGetState() == osKernelRunning) || (osKernelGetState() == osKernelLocked))

Further analysis:

After a lot of digging into this I noticed that the TouchGFX version 4.14 does not use cmsis on these "if"s

if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)

Question:

Is this a bug? And this is an acceptable solution? Or this is simply a workaround to hide the cause of other problems?

Code inserted:

Task creation:

osThreadId_t testId2;
   const osThreadAttr_t testTask_attributes2 = {
    .name = "testTask2",
    .priority = (osPriority_t) osPriorityLow,
    .stack_size = 128 * 4
   };
   testId2 = osThreadNew(test, NULL, &testTask_attributes2);

Task function:

void test(void *argument)
{
  while(1){
    osDelay(100);
 
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop"); asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
  }
}

 The "nop"s is just to simulate something.

[1] https://www.st.com/en/evaluation-tools/32l4r9idiscovery.html

1 ACCEPTED SOLUTION

Accepted Solutions
Romain DIELEMAN
ST Employee

Thank you for reporting this.

I think this specific application template (the v3.0.2) needs a redesign, or at least deeper investigations. There are visible performance decrease between the latest version v3.0.2 and v3.0.0. The major difference between the two are the color depth change from 24bpp to 16bpp (not linked to the error but this shows that there was a lot of work on it, which means multiple potential sources for the errors...)

If the color depth is not an issue for you (and if you have time for it) I would advise trying to work with the AT v3.0.0 and see if it fixes your errors.

/Romain

View solution in original post

2 REPLIES 2
Romain DIELEMAN
ST Employee

Thank you for reporting this.

I think this specific application template (the v3.0.2) needs a redesign, or at least deeper investigations. There are visible performance decrease between the latest version v3.0.2 and v3.0.0. The major difference between the two are the color depth change from 24bpp to 16bpp (not linked to the error but this shows that there was a lot of work on it, which means multiple potential sources for the errors...)

If the color depth is not an issue for you (and if you have time for it) I would advise trying to work with the AT v3.0.0 and see if it fixes your errors.

/Romain

Thank you! I will check this. In fact, we did not have time yet to check graphics performance.