cancel
Showing results for 
Search instead for 
Did you mean: 

Stacksize of TouchGFX Task

Marco.R
Senior

Hi @Martin KJELDSEN​ 

Hi @Alexandre RENOUX​ 

I have general questions about the required stack size for the touchgfx task. I'm observing that required stack size of the touchgfx task varies even when the same screen is displayed. To my understanding it should be always the same. Is that correct?

I observe this behaviour on screens which uses ScrollList or a scrollable container. In some cases the stack size increases when scrolling, but not every time and it is in my opinion independent from slow oder fast scrolling.

The measured maximum required stacksize is about 14kByte. The maximum allowed stacksize for the touchgfx task is 16kByte. But in very seldom cases, I'm getting a stackoverflow of touchgfx task and I can not reproduce this reliable.

Is it possible to calculate the maximum required stacksize?

Or is it possible to readout this information somewhere in the system? (e.g. MVPHeap? Simulator?)

Does the transition have an impact on the stacksize, e.g. which screen was the last screen. I always use NoTransition.

Some Information about the used system (maybe it is helpful):

  • TouchGFX version 4.16.0
  • The "worst case" screen contains:
    • about 20 basic elements (textarea with wildcards / images / buttons)
    • scrolllist with 8 visible elements. 1 elements contains a text with wildcard and 24 boxes to to display every hour of a day.

Thanks

Best regards

Marco

2 REPLIES 2
Alexandre RENOUX
Principal

Hello Marco,

It's half related to TouchGFX. It's more an OS question and I'm not an expert in this field so I will answer what I can.

When it comes to calculating the maximum required stacksize for a task, there's no precise way. You can have a rough idea by getting the task high water mark.

Overall what I personally try is reducing the task size until the program does not compile or the stackoverflow is triggered at run time.

If 16 kbytes is not enough, try something higher. Hopefully you have enough memory for this.

/Alexandre

Hi @Alexandre RENOUX​ 

Thanks for your reply. I know that it is dependend on the OS (I use embOS). In the task where I get sometimes an stackoverflow, only TouchGFX is running. So it will caused by TouchGFX.

My main question is, why the stack size is not same size even when I always display the same information on screen. I'm observing this behaviour only on screens where I use a scrolllist. On the other screens the stacksize is always the same size.

I've already added a reserve of 20% to the worst case of stack size I observed. But as I mentioned at the beginning I'm getting a stackoverflow in very rare cases. And as far I know it occurs always when switching to the screens with a scroll list. Due to this I obviously do not observed the worst case of stack. 🙂

Is there a way to calculate or readout the maximum required stacksize of TouchGFX?

I've to ensure that no stackoverflow occurs, but it can't be a solution to add 50% or more reserve to the task. The memory is running out.

/Marco